summaryrefslogtreecommitdiff
path: root/plugins/af_redditimgur
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-18 12:27:26 +0300
committerAndrew Dolgov <[email protected]>2021-02-18 12:27:26 +0300
commit39c0fe3697c71e9cfeec74c020b0c31fca376dc0 (patch)
treeb67a018eb001e5c819f3366bc62f2e69b3ff0cd0 /plugins/af_redditimgur
parentee0b66b6bd14d116b878a57f1d35b466d9994138 (diff)
shorten many invocations of Ajax.Request in inline form methods
Diffstat (limited to 'plugins/af_redditimgur')
-rwxr-xr-xplugins/af_redditimgur/init.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php
index 5066186db..827a4c310 100755
--- a/plugins/af_redditimgur/init.php
+++ b/plugins/af_redditimgur/init.php
@@ -43,16 +43,13 @@ class Af_RedditImgur extends Plugin {
<?= \Controls\pluginhandler_tags($this, "save") ?>
- <script type='dojo/method' event='onSubmit' args='evt'>
+ <script type="dojo/method" event="onSubmit" args="evt">
evt.preventDefault();
if (this.validate()) {
- console.log(dojo.objectToQuery(this.getValues()));
- new Ajax.Request('backend.php', {
- parameters: dojo.objectToQuery(this.getValues()),
- onComplete: function(transport) {
- Notify.info(transport.responseText);
- }
- });
+ Notify.progress('Saving data...', true);
+ xhrPost("backend.php", this.getValues(), (transport) => {
+ Notify.info(transport.responseText);
+ })
}
</script>