kopia lustrzana https://github.com/miklobit/TiddlyWiki5
commit
9616b5586f
|
@ -28,7 +28,12 @@ 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));
|
||||
if(Blob != undefined) {
|
||||
var blob = new Blob([text], {type: "text/html"});
|
||||
link.setAttribute("href", URL.createObjectURL(blob));
|
||||
} else {
|
||||
link.setAttribute("href","data:text/html," + encodeURIComponent(text));
|
||||
}
|
||||
link.setAttribute("download",filename);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
|
Ładowanie…
Reference in New Issue