1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 17:15:55 +00:00

plugins: add some xhrPost refactoring

This commit is contained in:
Andrew Dolgov
2018-11-30 15:23:48 +03:00
parent 764434a491
commit 2f961ee830
5 changed files with 54 additions and 99 deletions

View File

@@ -22,15 +22,9 @@ function emailArticle(id) {
style: "width: 600px",
execute: function() {
if (this.validate()) {
new Ajax.Request("backend.php", {
parameters: dojo.objectToQuery(this.attr('value')),
onComplete: function(transport) {
console.log(transport.responseText);
var reply = JSON.parse(transport.responseText);
var error = reply['error'];
xhrJson("backend.php", this.attr('value'), (reply) => {
if (reply) {
const error = reply['error'];
if (error) {
alert(__('Error sending email:') + ' ' + error);
@@ -39,7 +33,8 @@ function emailArticle(id) {
dialog.hide();
}
} });
}
});
}
},
href: query});