kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Added download saver, our fallback based on standard HTML
It's clunky, and requires manual intervention to accomplish a save, but it does work on Chrome, Safari, iOS mobile safariprint-window-tiddler
rodzic
632c846ae0
commit
9404d670d3
|
@ -18,7 +18,16 @@ Select the appropriate saver module and set it up
|
|||
var DownloadSaver = function() {
|
||||
};
|
||||
|
||||
DownloadSaver.prototype.save = function() {
|
||||
DownloadSaver.prototype.save = function(text) {
|
||||
// Set up the link
|
||||
var link = document.createElement("a");
|
||||
link.setAttribute("target","_blank");
|
||||
link.setAttribute("href","data:text/html," + encodeURIComponent(text));
|
||||
// Use the download attribute to download it if it is supported
|
||||
if(link.download !== undefined) {
|
||||
link.setAttribute("download","tiddlywiki.html");
|
||||
}
|
||||
link.click();
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
Ładowanie…
Reference in New Issue