diff options
author | Andrew Dolgov <[email protected]> | 2022-01-13 13:59:36 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2022-01-13 13:59:36 +0300 |
commit | 304845f3807cc1021de1f29a35e2e3c370ff9882 (patch) | |
tree | 12206fcb33d26907254ee6adfe2bb20a553bbbca /js/PluginHost.js | |
parent | 8cf9c451dc1d5f3ed23ead40bee41592f7c07254 (diff) | |
parent | f1607902e6953aa5c486157835105c0c8f08779f (diff) |
Merge branch 'master' of git.fakecake.org:fox/tt-rss
Diffstat (limited to 'js/PluginHost.js')
-rw-r--r-- | js/PluginHost.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/js/PluginHost.js b/js/PluginHost.js index deb7c0645..513429e4a 100644 --- a/js/PluginHost.js +++ b/js/PluginHost.js @@ -21,6 +21,7 @@ const PluginHost = { HOOK_HEADLINE_MUTATIONS_SYNCED: 16, HOOK_HEADLINES_RENDERED: 17, HOOK_HEADLINES_SCROLL_HANDLER: 18, + HOOK_HEADLINE_TOOLBAR_SELECT_MENU_ITEM2: 19, hooks: [], register: function (name, callback) { if (typeof(this.hooks[name]) == 'undefined') @@ -36,6 +37,17 @@ const PluginHost = { this.hooks[name][i](args); } }, + run_until: function (name, check, ...args) { + //console.warn('PluginHost.run_until', name, check, args); + + if (typeof(this.hooks[name]) != 'undefined') + for (let i = 0; i < this.hooks[name].length; i++) { + if (this.hooks[name][i](args) == check) + return true; + } + + return false; + }, unregister: function (name, callback) { for (let i = 0; i < this.hooks[name].length; i++) if (this.hooks[name][i] == callback) |