mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-06-03 07:04:07 +00:00
Small revision to previous commit, avoids double encoding.
We don't need to encodeURIComponent at all when using blob links. The data never goes into the dom directly, just a guid reference. This makes saving with blobs very fast!
This commit is contained in:
parent
aef8e63cf8
commit
c45f4d1c62
@ -29,7 +29,7 @@ DownloadSaver.prototype.save = function(text) {
|
|||||||
var link = document.createElement("a");
|
var link = document.createElement("a");
|
||||||
link.setAttribute("target","_blank");
|
link.setAttribute("target","_blank");
|
||||||
if(Blob != undefined) {
|
if(Blob != undefined) {
|
||||||
var blob = new Blob([encodeURIComponent(text)], {type: "text/html"});
|
var blob = new Blob([text], {type: "text/html"});
|
||||||
link.setAttribute("href", URL.createObjectURL(blob));
|
link.setAttribute("href", URL.createObjectURL(blob));
|
||||||
} else {
|
} else {
|
||||||
link.setAttribute("href","data:text/html," + encodeURIComponent(text));
|
link.setAttribute("href","data:text/html," + encodeURIComponent(text));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user