summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-19 13:44:56 +0300
committerAndrew Dolgov <[email protected]>2021-02-19 13:44:56 +0300
commit660a1bbe011fef5f0fa6bb0af43521fed7598cc7 (patch)
treef31ee123db91e479b93a6d086fd78de2ecfae014 /plugins
parentbb4e4282f46824308aebc2eaeac29fa29f8687ad (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')
-rw-r--r--plugins/af_proxy_http/init.php4
-rw-r--r--plugins/af_psql_trgm/init.js6
-rw-r--r--plugins/af_psql_trgm/init.php4
-rwxr-xr-xplugins/af_readability/init.php4
-rwxr-xr-xplugins/af_redditimgur/init.php4
-rw-r--r--plugins/mail/init.php4
-rw-r--r--plugins/mail/mail.js6
-rw-r--r--plugins/mailto/init.js6
-rw-r--r--plugins/note/note.js6
-rw-r--r--plugins/nsfw/init.php4
-rw-r--r--plugins/share/share.js10
-rw-r--r--plugins/share/share_prefs.js6
12 files changed, 32 insertions, 32 deletions
diff --git a/plugins/af_proxy_http/init.php b/plugins/af_proxy_http/init.php
index 2c472a32d..a5ba1d62d 100644
--- a/plugins/af_proxy_http/init.php
+++ b/plugins/af_proxy_http/init.php
@@ -221,8 +221,8 @@ class Af_Proxy_Http extends Plugin {
<script type="dojo/method" event="onSubmit" args="evt">
evt.preventDefault();
if (this.validate()) {
- xhrPost("backend.php", this.getValues(), (transport) => {
- Notify.info(transport.responseText);
+ xhr.post("backend.php", this.getValues(), (reply) => {
+ Notify.info(reply);
})
}
</script>
diff --git a/plugins/af_psql_trgm/init.js b/plugins/af_psql_trgm/init.js
index e5bc21885..921272c4b 100644
--- a/plugins/af_psql_trgm/init.js
+++ b/plugins/af_psql_trgm/init.js
@@ -1,4 +1,4 @@
-/* global dijit, dojo, Plugins, xhrPost, __ */
+/* global dijit, dojo, Plugins, xhr, __ */
Plugins.Psql_Trgm = {
showRelated: function (id) {
@@ -10,8 +10,8 @@ Plugins.Psql_Trgm = {
const tmph = dojo.connect(dialog, "onShow", null, function (/* e */) {
dojo.disconnect(tmph);
- xhrPost("backend.php", {op: 'pluginhandler', plugin: 'af_psql_trgm', method: 'showrelated', id: id}, (transport) => {
- dialog.attr('content', transport.responseText);
+ xhr.post("backend.php", {op: 'pluginhandler', plugin: 'af_psql_trgm', method: 'showrelated', id: id}, (reply) => {
+ dialog.attr('content', reply);
});
});
diff --git a/plugins/af_psql_trgm/init.php b/plugins/af_psql_trgm/init.php
index 4ecfe0cd5..3b7ed6b14 100644
--- a/plugins/af_psql_trgm/init.php
+++ b/plugins/af_psql_trgm/init.php
@@ -152,8 +152,8 @@ class Af_Psql_Trgm extends Plugin {
evt.preventDefault();
if (this.validate()) {
Notify.progress('Saving data...', true);
- xhrPost("backend.php", this.getValues(), (transport) => {
- Notify.info(transport.responseText);
+ xhr.post("backend.php", this.getValues(), (reply) => {
+ Notify.info(reply);
})
}
</script>
diff --git a/plugins/af_readability/init.php b/plugins/af_readability/init.php
index 4cd72904a..be9220cda 100755
--- a/plugins/af_readability/init.php
+++ b/plugins/af_readability/init.php
@@ -71,8 +71,8 @@ class Af_Readability extends Plugin {
evt.preventDefault();
if (this.validate()) {
Notify.progress('Saving data...', true);
- xhrPost("backend.php", this.getValues(), (transport) => {
- Notify.info(transport.responseText);
+ xhr.post("backend.php", this.getValues(), (reply) => {
+ Notify.info(reply);
})
}
</script>
diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php
index 827a4c310..2677fdd90 100755
--- a/plugins/af_redditimgur/init.php
+++ b/plugins/af_redditimgur/init.php
@@ -47,8 +47,8 @@ class Af_RedditImgur extends Plugin {
evt.preventDefault();
if (this.validate()) {
Notify.progress('Saving data...', true);
- xhrPost("backend.php", this.getValues(), (transport) => {
- Notify.info(transport.responseText);
+ xhr.post("backend.php", this.getValues(), (reply) => {
+ Notify.info(reply);
})
}
</script>
diff --git a/plugins/mail/init.php b/plugins/mail/init.php
index 16e22f342..467f8294a 100644
--- a/plugins/mail/init.php
+++ b/plugins/mail/init.php
@@ -51,8 +51,8 @@ class Mail extends Plugin {
evt.preventDefault();
if (this.validate()) {
Notify.progress('Saving data...', true);
- xhrPost("backend.php", this.getValues(), (transport) => {
- Notify.info(transport.responseText);
+ xhr.post("backend.php", this.getValues(), (reply) => {
+ Notify.info(reply);
})
}
</script>
diff --git a/plugins/mail/mail.js b/plugins/mail/mail.js
index fc0898085..d2bafe0e9 100644
--- a/plugins/mail/mail.js
+++ b/plugins/mail/mail.js
@@ -1,4 +1,4 @@
-/* global Plugins, Headlines, dojo, xhrPost, xhrJson, Notify, fox, __ */
+/* global Plugins, Headlines, dojo, App, xhr, Notify, fox, __ */
Plugins.Mail = {
send: function(id) {
@@ -38,8 +38,8 @@ Plugins.Mail = {
const tmph = dojo.connect(dialog, 'onShow', function () {
dojo.disconnect(tmph);
- xhrPost("backend.php", App.getPhArgs("mail", "emailArticle", {ids: id}), (transport) => {
- dialog.attr('content', transport.responseText);
+ xhr.post("backend.php", App.getPhArgs("mail", "emailArticle", {ids: id}), (reply) => {
+ dialog.attr('content', reply);
});
});
diff --git a/plugins/mailto/init.js b/plugins/mailto/init.js
index b5e68680b..4a9557249 100644
--- a/plugins/mailto/init.js
+++ b/plugins/mailto/init.js
@@ -1,4 +1,4 @@
-/* global Plugins, Headlines, xhrPost, dojo, fox, __ */
+/* global Plugins, Headlines, xhr, dojo, fox, __ */
Plugins.Mailto = {
send: function (id) {
@@ -21,8 +21,8 @@ Plugins.Mailto = {
const tmph = dojo.connect(dialog, 'onShow', function () {
dojo.disconnect(tmph);
- xhrPost("backend.php", App.getPhArgs("mailto", "emailArticle", {ids: id}), (transport) => {
- dialog.attr('content', transport.responseText);
+ xhr.post("backend.php", App.getPhArgs("mailto", "emailArticle", {ids: id}), (reply) => {
+ dialog.attr('content', reply);
});
});
diff --git a/plugins/note/note.js b/plugins/note/note.js
index 36bc426cd..d42fca2c1 100644
--- a/plugins/note/note.js
+++ b/plugins/note/note.js
@@ -1,4 +1,4 @@
-/* global dojo, xhrPost, Plugins, xhrJson, Notify, fox, __ */
+/* global dojo, Plugins, xhr, App, Notify, fox, __ */
Plugins.Note = {
edit: function(id) {
@@ -33,8 +33,8 @@ Plugins.Note = {
const tmph = dojo.connect(dialog, 'onShow', function () {
dojo.disconnect(tmph);
- xhrPost("backend.php", App.getPhArgs("note", "edit", {id: id}), (transport) => {
- dialog.attr('content', transport.responseText);
+ xhr.post("backend.php", App.getPhArgs("note", "edit", {id: id}), (reply) => {
+ dialog.attr('content', reply);
});
});
diff --git a/plugins/nsfw/init.php b/plugins/nsfw/init.php
index fdc6a3974..3205b436b 100644
--- a/plugins/nsfw/init.php
+++ b/plugins/nsfw/init.php
@@ -56,8 +56,8 @@ class NSFW extends Plugin {
evt.preventDefault();
if (this.validate()) {
Notify.progress('Saving data...', true);
- xhrPost("backend.php", this.getValues(), (transport) => {
- Notify.info(transport.responseText);
+ xhr.post("backend.php", this.getValues(), (reply) => {
+ Notify.info(reply);
})
}
</script>
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);
});
}