From 526389b2d380177490605037fdc3a24ebc688fac Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 2 Dec 2018 20:56:30 +0300 Subject: update notify_* calls to use Notify --- plugins/share/share_prefs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/share/share_prefs.js') diff --git a/plugins/share/share_prefs.js b/plugins/share/share_prefs.js index 79ca37284..92975f8f4 100644 --- a/plugins/share/share_prefs.js +++ b/plugins/share/share_prefs.js @@ -1,11 +1,11 @@ function clearArticleAccessKeys() { if (confirm(__("This will invalidate all previously shared article URLs. Continue?"))) { - notify_progress("Clearing URLs..."); + Notify.progress("Clearing URLs..."); const query = { op: "pluginhandler", plugin: "share", method: "clearArticleKeys" }; xhrPost("backend.php", query, () => { - notify_info("Shared URLs cleared."); + Notify.info("Shared URLs cleared."); }); } -- cgit v1.2.3 From 78cc470193448048759b3f315ee630e50acb064b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 3 Dec 2018 10:51:14 +0300 Subject: remove some plugin JS code out of global context --- plugins/share/share_prefs.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'plugins/share/share_prefs.js') 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; + } +}; -- cgit v1.2.3