summaryrefslogtreecommitdiff
path: root/plugins/share
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-17 21:44:21 +0300
committerAndrew Dolgov <[email protected]>2021-02-17 21:44:21 +0300
commite4609c18efceebb1e021d814f53061ada7f6489a (patch)
tree0968e0da3dc2d1b4cdc12c2a29549c27dc82ea14 /plugins/share
parentb16abc157ee584f4be80a537ee24ec9e5ff25496 (diff)
* add (disabled) shortcut syntax for plugin methods
* add controls shortcut for pluginhandler tags * add similar shortcut for frontend * allow plugins to selectively exclude their methods from CSRF checking
Diffstat (limited to 'plugins/share')
-rw-r--r--plugins/share/share.js8
-rw-r--r--plugins/share/share_prefs.js2
2 files changed, 4 insertions, 6 deletions
diff --git a/plugins/share/share.js b/plugins/share/share.js
index 09fb145c9..46b62ca5b 100644
--- a/plugins/share/share.js
+++ b/plugins/share/share.js
@@ -10,9 +10,7 @@ Plugins.Share = {
Notify.progress("Trying to change URL...", true);
- const query = {op: "pluginhandler", plugin: "share", method: "newkey", id: id};
-
- xhrJson("backend.php", query, (reply) => {
+ xhrJson("backend.php", App.getPhArgs("share", "newkey", {id: id}), (reply) => {
if (reply) {
const new_link = reply.link;
const target = dialog.domNode.querySelector(".target-url");
@@ -45,7 +43,7 @@ Plugins.Share = {
},
unshare: function () {
if (confirm(__("Remove sharing for this article?"))) {
- xhrPost("backend.php", {op: "pluginhandler", plugin: "share", method: "unshare", id: id}, (transport) => {
+ xhrPost("backend.php", App.getPhArgs("share", "unshare", {id: id}), (transport) => {
Notify.info(transport.responseText);
const icon = document.querySelector(".share-icon-" + id);
@@ -64,7 +62,7 @@ Plugins.Share = {
const tmph = dojo.connect(dialog, 'onShow', function () {
dojo.disconnect(tmph);
- xhrPost("backend.php", {op: "pluginhandler", plugin: "share", method: "shareDialog", id: id}, (transport) => {
+ xhrPost("backend.php", App.getPhArgs("share", "shareDialog", {id: id}), (transport) => {
dialog.attr('content', transport.responseText)
const icon = document.querySelector(".share-icon-" + id);
diff --git a/plugins/share/share_prefs.js b/plugins/share/share_prefs.js
index 29c9aeaf8..91f979daf 100644
--- a/plugins/share/share_prefs.js
+++ b/plugins/share/share_prefs.js
@@ -5,7 +5,7 @@ Plugins.Share = {
if (confirm(__("This will invalidate all previously shared article URLs. Continue?"))) {
Notify.progress("Clearing URLs...");
- xhrPost("backend.php", {op: "pluginhandler", plugin: "share", method: "clearArticleKeys"}, (transport) => {
+ xhrPost("backend.php", App.getPhArgs("share", "clearArticleKeys"), (transport) => {
Notify.info(transport.responseText);
});
}