1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-25 01:20:30 +00:00

Add a serialisation for preloading a tiddler

This commit is contained in:
Jeremy Ruston 2012-10-12 19:01:19 +01:00
parent 36e8040773
commit d4b2ab4a5f

View File

@ -167,4 +167,10 @@ exports["application/x-tiddler-encrypted-div"] = function(tiddlers) {
return "<div data-tw-encrypted-tiddlers='yes'><pre>" + $tw.utils.htmlEncode($tw.crypto.encrypt(JSON.stringify(jsonTiddlers))) + "</pre></div>";
};
exports["application/x-tiddler-javascript"] = function(tiddlers) {
return mapEachTiddler(this,tiddlers,function(tiddler) {
return "$tw.preloadTiddler(" + JSON.stringify(tiddler.fields) + ");\n"
});
};
})();