diff options
author | Andrew Dolgov <[email protected]> | 2021-02-19 13:44:56 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-19 13:44:56 +0300 |
commit | 660a1bbe011fef5f0fa6bb0af43521fed7598cc7 (patch) | |
tree | f31ee123db91e479b93a6d086fd78de2ecfae014 /plugins/share | |
parent | bb4e4282f46824308aebc2eaeac29fa29f8687ad (diff) |
* switch to xhr.post() almost everywhere
* call App.handlerpcjson() automatically on json request (if possible)
* show net/log indicators in prefs
Diffstat (limited to 'plugins/share')
-rw-r--r-- | plugins/share/share.js | 10 | ||||
-rw-r--r-- | plugins/share/share_prefs.js | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/plugins/share/share.js b/plugins/share/share.js index d7b8cd1f9..1be9db682 100644 --- a/plugins/share/share.js +++ b/plugins/share/share.js @@ -1,4 +1,4 @@ -/* global dojo, Effect, Plugins, xhrJson, Notify, fox, xhrPost, __ */ +/* global dojo, Plugins, App, Notify, fox, xhr, __ */ Plugins.Share = { shareArticle: function(id) { @@ -40,8 +40,8 @@ Plugins.Share = { }, unshare: function () { if (confirm(__("Remove sharing for this article?"))) { - xhrPost("backend.php", App.getPhArgs("share", "unshare", {id: id}), (transport) => { - Notify.info(transport.responseText); + xhr.post("backend.php", App.getPhArgs("share", "unshare", {id: id}), (reply) => { + Notify.info(reply); const icon = document.querySelector(".share-icon-" + id); @@ -59,8 +59,8 @@ Plugins.Share = { const tmph = dojo.connect(dialog, 'onShow', function () { dojo.disconnect(tmph); - xhrPost("backend.php", App.getPhArgs("share", "shareDialog", {id: id}), (transport) => { - dialog.attr('content', transport.responseText) + xhr.post("backend.php", App.getPhArgs("share", "shareDialog", {id: id}), (reply) => { + dialog.attr('content', reply) const icon = document.querySelector(".share-icon-" + id); diff --git a/plugins/share/share_prefs.js b/plugins/share/share_prefs.js index 91f979daf..d974af618 100644 --- a/plugins/share/share_prefs.js +++ b/plugins/share/share_prefs.js @@ -1,12 +1,12 @@ -/* global Plugins, Notify, xhrPost */ +/* global Plugins, Notify, xhr, App */ Plugins.Share = { clearKeys: function() { if (confirm(__("This will invalidate all previously shared article URLs. Continue?"))) { Notify.progress("Clearing URLs..."); - xhrPost("backend.php", App.getPhArgs("share", "clearArticleKeys"), (transport) => { - Notify.info(transport.responseText); + xhr.post("backend.php", App.getPhArgs("share", "clearArticleKeys"), (reply) => { + Notify.info(reply); }); } |