Add 2 new hooks for detecting page changes in the webUI

This commit is contained in:
Ryan Blenis 2019-12-28 06:55:09 -05:00
parent 2fb79ae605
commit f6913b4918
2 changed files with 4 additions and 0 deletions

View File

@ -63,6 +63,8 @@ These are separated into the following categories depending on the type of funct
`registerPluginTab`: callable when a device is selected in the MeshCentral web interface to register a new tab for plugin data, if required. Accepts an object, or function that returns an object, with the following properties: { tabId: "yourShortNameHere", tabTitle: "Your Display Name"}. A tab and div with the associated ID and title will be created for your use `registerPluginTab`: callable when a device is selected in the MeshCentral web interface to register a new tab for plugin data, if required. Accepts an object, or function that returns an object, with the following properties: { tabId: "yourShortNameHere", tabTitle: "Your Display Name"}. A tab and div with the associated ID and title will be created for your use
`onDesktopDisconnect`: called when a remote desktop session is disconnected `onDesktopDisconnect`: called when a remote desktop session is disconnected
`onWebUIStartupEnd`: called when the page has loaded for the first time after a login / refresh `onWebUIStartupEnd`: called when the page has loaded for the first time after a login / refresh
`goPageStart`: called before page changes take effect. Passes 2 arguments (<page number> : int, <event> : Event)
`goPageEnd`: called after page changes take effect. Passes 2 arguments (<page number> : int, <event> : Event)
#### Exports #### Exports
Any function can be exported to the Web UI layer by adding the name of the function to an `exports` array in the plugin object. Any function can be exported to the Web UI layer by adding the name of the function to an `exports` array in the plugin object.

View File

@ -9834,6 +9834,7 @@
} }
function go(x, event) { function go(x, event) {
if (pluginHandler != null) pluginHandler.callHook('goPageStart', x, event);
setSessionActivity(); setSessionActivity();
if (xxdialogMode) return; if (xxdialogMode) return;
QV('uiMenu', false); QV('uiMenu', false);
@ -9959,6 +9960,7 @@
} else { } else {
document.title = decodeURIComponent('{{{extitle}}}'); document.title = decodeURIComponent('{{{extitle}}}');
} }
if (pluginHandler != null) pluginHandler.callHook('goPageEnd', x, event);
} }
// //