mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-15 11:45:40 +00:00
Added support for outputting tiddlers in the MHTML format accepted by older versions of IE
I don't plan for TW5 itself to run under IE6, but it's still quite useful to be able pack base64 tiddlers in a way that IE understands
This commit is contained in:
parent
41637a791f
commit
6a7f2473db
24
js/Recipe.js
24
js/Recipe.js
@ -358,7 +358,8 @@ Recipe.tiddlerOutputMapper = {
|
|||||||
jquery: "javascript",
|
jquery: "javascript",
|
||||||
shadow: "shadow",
|
shadow: "shadow",
|
||||||
title: "title",
|
title: "title",
|
||||||
jsmodule: "jsmodule"
|
jsmodule: "jsmodule",
|
||||||
|
base64ie: "base64ie"
|
||||||
};
|
};
|
||||||
|
|
||||||
Recipe.compatibilityCheats = {
|
Recipe.compatibilityCheats = {
|
||||||
@ -421,6 +422,27 @@ Recipe.tiddlerOutputter = {
|
|||||||
out.push("});");
|
out.push("});");
|
||||||
out.push("</" + "script>");
|
out.push("</" + "script>");
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
base64ie: function(out,tiddlers) {
|
||||||
|
// For IE, we output binary tiddlers in MHTML format (http://www.phpied.com/mhtml-when-you-need-data-uris-in-ie7-and-under/)
|
||||||
|
if(tiddlers.length) {
|
||||||
|
out.push("<!--\n");
|
||||||
|
out.push("Content-Type: multipart/related; boundary=\"_tw_mhtml" + "_tiddler\"\n");
|
||||||
|
out.push("\n");
|
||||||
|
for(var t=0; t<tiddlers.length; t++) {
|
||||||
|
var tiddler = this.store.getTiddler(tiddlers[t]);
|
||||||
|
out.push("--_tw_mhtml" + "_tiddler\n");
|
||||||
|
out.push("Content-Location:" + tiddler.title + "\n");
|
||||||
|
out.push("Content-Type:" + tiddler.type + "\n");
|
||||||
|
out.push("Content-Transfer-Encoding:base64\n");
|
||||||
|
out.push("\n");
|
||||||
|
out.push(tiddler.text);
|
||||||
|
out.push("\n\n");
|
||||||
|
}
|
||||||
|
out.push("--_tw_mhtml" + "_tiddler--\n");
|
||||||
|
out.push("\n");
|
||||||
|
out.push("-->\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user