diff options
author | Andrew Dolgov <[email protected]> | 2018-12-03 10:51:14 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2018-12-03 10:51:14 +0300 |
commit | 78cc470193448048759b3f315ee630e50acb064b (patch) | |
tree | dcb14ea4a2ba9c10666b7b2669bf7776bc04d6b4 /plugins/share/share_prefs.js | |
parent | 84affc7b1d71769038dfd25d74e40d6bf744e5fb (diff) |
remove some plugin JS code out of global context
Diffstat (limited to 'plugins/share/share_prefs.js')
-rw-r--r-- | plugins/share/share_prefs.js | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/plugins/share/share_prefs.js b/plugins/share/share_prefs.js index 92975f8f4..071a6667c 100644 --- a/plugins/share/share_prefs.js +++ b/plugins/share/share_prefs.js @@ -1,16 +1,15 @@ -function clearArticleAccessKeys() { - if (confirm(__("This will invalidate all previously shared article URLs. Continue?"))) { - Notify.progress("Clearing URLs..."); - - const query = { op: "pluginhandler", plugin: "share", method: "clearArticleKeys" }; - - xhrPost("backend.php", query, () => { - Notify.info("Shared URLs cleared."); - }); - } - - return false; -} +Plugins.Share = { + clearKeys: function() { + if (confirm(__("This will invalidate all previously shared article URLs. Continue?"))) { + Notify.progress("Clearing URLs..."); + const query = {op: "pluginhandler", plugin: "share", method: "clearArticleKeys"}; + xhrPost("backend.php", query, () => { + Notify.info("Shared URLs cleared."); + }); + } + return false; + } +}; |