X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=blobdiff_plain;f=plugins%2Fmail%2Fmail.js;h=929b352433fc7fb5c1b6ec49a79b6b810316548c;hp=db0503ff95774173256400e0885d549939c3b80d;hb=2f961ee830af21166d22bf3fae104291f614e7dd;hpb=764434a491ee0b42b70d262fa49aee2b6a9e93a8 diff --git a/plugins/mail/mail.js b/plugins/mail/mail.js index db0503ff..929b3524 100644 --- a/plugins/mail/mail.js +++ b/plugins/mail/mail.js @@ -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});