mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-08 14:55:17 +00:00
Make the widget tree for the page accessible to the JS console
Now you can browse the render tree of widgets by inspecting `$tw.pageWidgetNode` in the JS console
This commit is contained in:
parent
4f4d45a972
commit
4118afe9e8
@ -104,14 +104,14 @@ exports.startup = function() {
|
|||||||
});
|
});
|
||||||
// Display the PageTemplate
|
// Display the PageTemplate
|
||||||
var templateTitle = "$:/core/ui/PageTemplate",
|
var templateTitle = "$:/core/ui/PageTemplate",
|
||||||
parser = $tw.wiki.new_parseTiddler(templateTitle),
|
parser = $tw.wiki.new_parseTiddler(templateTitle);
|
||||||
widgetNode = $tw.wiki.makeWidget(parser,{document: document, parentWidget: $tw.rootWidget});
|
$tw.pageWidgetNode = $tw.wiki.makeWidget(parser,{document: document, parentWidget: $tw.rootWidget});
|
||||||
$tw.pageContainer = document.createElement("div");
|
$tw.pageContainer = document.createElement("div");
|
||||||
$tw.utils.addClass($tw.pageContainer,"tw-page-container");
|
$tw.utils.addClass($tw.pageContainer,"tw-page-container");
|
||||||
document.body.insertBefore($tw.pageContainer,document.body.firstChild);
|
document.body.insertBefore($tw.pageContainer,document.body.firstChild);
|
||||||
widgetNode.render($tw.pageContainer,null);
|
$tw.pageWidgetNode.render($tw.pageContainer,null);
|
||||||
$tw.wiki.addEventListener("change",function(changes) {
|
$tw.wiki.addEventListener("change",function(changes) {
|
||||||
widgetNode.refresh(changes,$tw.pageContainer,null);
|
$tw.pageWidgetNode.refresh(changes,$tw.pageContainer,null);
|
||||||
});
|
});
|
||||||
// If we're being viewed on a data: URI then give instructions for how to save
|
// If we're being viewed on a data: URI then give instructions for how to save
|
||||||
if(document.location.protocol === "data:") {
|
if(document.location.protocol === "data:") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user