Added support for tiddlers preloaded through JavaScript

print-window-tiddler
Jeremy Ruston 2012-10-12 19:01:03 +01:00
rodzic aba6fb5ffd
commit 36e8040773
2 zmienionych plików z 14 dodań i 0 usunięć

Wyświetl plik

@ -709,6 +709,10 @@ $tw.wiki.addTiddlers($tw.wiki.deserializeTiddlers("(DOM)",document.getElementByI
$tw.wiki.addTiddlers($tw.wiki.deserializeTiddlers("(DOM)",document.getElementById("storeArea")));
// Load the shadow tiddlers from the DOM
$tw.wiki.addTiddlers($tw.wiki.deserializeTiddlers("(DOM)",document.getElementById("shadowArea")),true);
// Load any preloaded tiddlers
if($tw.preloadTiddlers) {
$tw.wiki.addTiddlers($tw.preloadTiddlers,true);
}
// End of if($tw.browser)
}

Wyświetl plik

@ -31,3 +31,13 @@ $tw.modules.define = function(moduleName,moduleType,fn) {
fn: fn
};
};
/*
Define a tiddler
*/
$tw.preloadTiddlers = $tw.preloadTiddlers || [];
$tw.preloadTiddler = function(fields) {
$tw.preloadTiddlers.push(fields);
};