mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 03:15:56 +00:00
shorten many invocations of Ajax.Request in inline form methods
This commit is contained in:
@@ -69,19 +69,15 @@ class Af_Readability 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);
|
||||
}
|
||||
});
|
||||
//this.reset();
|
||||
Notify.progress('Saving data...', true);
|
||||
xhrPost("backend.php", this.getValues(), (transport) => {
|
||||
Notify.info(transport.responseText);
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<fieldset>
|
||||
<label class='checkbox'>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -50,15 +50,12 @@ class Mail extends Plugin {
|
||||
<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>
|
||||
</script>
|
||||
|
||||
<header><?= __("You can set predefined email addressed here (comma-separated list):") ?></header>
|
||||
|
||||
@@ -70,7 +67,6 @@ class Mail extends Plugin {
|
||||
<?= \Controls\submit_tag(__("Save")) ?>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -55,12 +55,10 @@ class NSFW extends Plugin {
|
||||
<script type="dojo/method" event="onSubmit" args="evt">
|
||||
evt.preventDefault();
|
||||
if (this.validate()) {
|
||||
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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user