mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-23 10:07:19 +00:00
Added support for tiddlers preloaded through JavaScript
This commit is contained in:
parent
aba6fb5ffd
commit
36e8040773
@ -709,6 +709,10 @@ $tw.wiki.addTiddlers($tw.wiki.deserializeTiddlers("(DOM)",document.getElementByI
|
|||||||
$tw.wiki.addTiddlers($tw.wiki.deserializeTiddlers("(DOM)",document.getElementById("storeArea")));
|
$tw.wiki.addTiddlers($tw.wiki.deserializeTiddlers("(DOM)",document.getElementById("storeArea")));
|
||||||
// Load the shadow tiddlers from the DOM
|
// Load the shadow tiddlers from the DOM
|
||||||
$tw.wiki.addTiddlers($tw.wiki.deserializeTiddlers("(DOM)",document.getElementById("shadowArea")),true);
|
$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)
|
// End of if($tw.browser)
|
||||||
}
|
}
|
||||||
|
@ -31,3 +31,13 @@ $tw.modules.define = function(moduleName,moduleType,fn) {
|
|||||||
fn: fn
|
fn: fn
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
Define a tiddler
|
||||||
|
*/
|
||||||
|
$tw.preloadTiddlers = $tw.preloadTiddlers || [];
|
||||||
|
|
||||||
|
$tw.preloadTiddler = function(fields) {
|
||||||
|
$tw.preloadTiddlers.push(fields);
|
||||||
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user