diff --git a/core/modules/startup/render.js b/core/modules/startup/render.js index e77eb1a32..effa2dc51 100644 --- a/core/modules/startup/render.js +++ b/core/modules/startup/render.js @@ -57,6 +57,7 @@ exports.startup = function() { $tw.utils.addClass($tw.pageContainer,"tc-page-container-wrapper"); document.body.insertBefore($tw.pageContainer,document.body.firstChild); $tw.pageWidgetNode.render($tw.pageContainer,null); + $tw.hooks.invokeHook("th-page-refreshed"); })(); // Prepare refresh mechanism var deferredChanges = Object.create(null), @@ -65,6 +66,7 @@ exports.startup = function() { // Process the refresh $tw.pageWidgetNode.refresh(deferredChanges); deferredChanges = Object.create(null); + $tw.hooks.invokeHook("th-page-refreshed"); } // Add the change event handler $tw.wiki.addEventListener("change",$tw.perf.report("mainRefresh",function(changes) { diff --git a/editions/dev/tiddlers/new/Hook_ th-page-refreshed.tid b/editions/dev/tiddlers/new/Hook_ th-page-refreshed.tid new file mode 100644 index 000000000..6584c7361 --- /dev/null +++ b/editions/dev/tiddlers/new/Hook_ th-page-refreshed.tid @@ -0,0 +1,15 @@ +created: 20180104155916980 +modified: 20180104160025999 +tags: HookMechanism +title: Hook: th-page-refreshed +type: text/vnd.tiddlywiki + +This hook notifies plugins that a page refresh has just occurred. It is typically used to apply post-rendering effects. + +Hook function parameters: + +* (none) + +Return value: + +* (none)