From d4b2ab4a5f24cf5db197bce08c1de7ad266f9b11 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 12 Oct 2012 19:01:19 +0100 Subject: [PATCH] Add a serialisation for preloading a tiddler --- core/modules/serializers.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/modules/serializers.js b/core/modules/serializers.js index e6952de9b..f1de9022b 100644 --- a/core/modules/serializers.js +++ b/core/modules/serializers.js @@ -167,4 +167,10 @@ exports["application/x-tiddler-encrypted-div"] = function(tiddlers) { return "
" + $tw.utils.htmlEncode($tw.crypto.encrypt(JSON.stringify(jsonTiddlers))) + "
"; }; +exports["application/x-tiddler-javascript"] = function(tiddlers) { + return mapEachTiddler(this,tiddlers,function(tiddler) { + return "$tw.preloadTiddler(" + JSON.stringify(tiddler.fields) + ");\n" + }); +}; + })();