Add ability to read JSON files containing an array of tiddlers

print-window-tiddler
Jeremy Ruston 2012-10-27 14:51:43 +01:00
rodzic 416ab0c060
commit a0843f9c51
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -580,6 +580,12 @@ $tw.modules.registerModuleExports("$:/boot/tiddlerdeserializer/html","tiddlerdes
return [fields];
}
});
$tw.modules.registerModuleExports("$:/boot/tiddlerdeserializer/json","tiddlerdeserializer",{
"application/json": function(text,fields) {
var tiddlers = JSON.parse(text);
return tiddlers;
}
});
// Install the tiddler deserializer modules so they are immediately available
$tw.modules.applyMethods("tiddlerdeserializer",$tw.Wiki.tiddlerDeserializerModules);