mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2026-02-10 16:01:33 +00:00
rework email article dialog
This commit is contained in:
+42
-45
@@ -1869,7 +1869,47 @@ function emailArticle(id) {
|
||||
id = ids.toString();
|
||||
}
|
||||
|
||||
displayDlg('emailArticle', id,
|
||||
if (dijit.byId("emailArticleDlg"))
|
||||
dijit.byId("emailArticleDlg").destroyRecursive();
|
||||
|
||||
var query = "backend.php?op=dlg&id=emailArticle¶m=" + param_escape(id);
|
||||
|
||||
dialog = new dijit.Dialog({
|
||||
id: "emailArticleDlg",
|
||||
title: __("Forward article by email"),
|
||||
style: "width: 600px",
|
||||
execute: function() {
|
||||
if (this.validate()) {
|
||||
|
||||
new Ajax.Request("backend.php", {
|
||||
parameters: dojo.objectToQuery(this.attr('value')),
|
||||
onComplete: function(transport) {
|
||||
|
||||
var error = transport.responseXML.getElementsByTagName('error')[0];
|
||||
|
||||
if (error) {
|
||||
alert(__('Error sending email:') + ' ' + error.firstChild.nodeValue);
|
||||
} else {
|
||||
notify_info('Your message has been sent.');
|
||||
dialog.hide();
|
||||
}
|
||||
|
||||
} });
|
||||
}
|
||||
},
|
||||
href: query});
|
||||
|
||||
var tmph = dojo.connect(dialog, 'onLoad', function() {
|
||||
dojo.disconnect(tmph);
|
||||
|
||||
new Ajax.Autocompleter('emailArticleDlg_destination', 'emailArticleDlg_dst_choices',
|
||||
"backend.php?op=rpc&subop=completeEmails",
|
||||
{ tokens: '', paramName: "search" });
|
||||
});
|
||||
|
||||
dialog.show();
|
||||
|
||||
/* displayDlg('emailArticle', id,
|
||||
function () {
|
||||
document.forms['article_email_form'].destination.focus();
|
||||
|
||||
@@ -1877,56 +1917,13 @@ function emailArticle(id) {
|
||||
"backend.php?op=rpc&subop=completeEmails",
|
||||
{ tokens: '', paramName: "search" });
|
||||
|
||||
});
|
||||
}); */
|
||||
|
||||
} catch (e) {
|
||||
exception_error("emailArticle", e);
|
||||
}
|
||||
}
|
||||
|
||||
function emailArticleDo() {
|
||||
try {
|
||||
var f = document.forms['article_email_form'];
|
||||
|
||||
if (f.destination.value == "") {
|
||||
alert("Please fill in the destination email.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (f.subject.value == "") {
|
||||
alert("Please fill in the subject.");
|
||||
return;
|
||||
}
|
||||
|
||||
var query = Form.serialize("article_email_form");
|
||||
|
||||
// console.log(query);
|
||||
|
||||
new Ajax.Request("backend.php", {
|
||||
parameters: query,
|
||||
onComplete: function(transport) {
|
||||
try {
|
||||
|
||||
var error = transport.responseXML.getElementsByTagName('error')[0];
|
||||
|
||||
if (error) {
|
||||
alert(__('Error sending email:') + ' ' + error.firstChild.nodeValue);
|
||||
} else {
|
||||
notify_info('Your message has been sent.');
|
||||
closeInfoBox();
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
exception_error("sendEmailDo", e);
|
||||
}
|
||||
|
||||
} });
|
||||
|
||||
} catch (e) {
|
||||
exception_error("emailArticleDo", e);
|
||||
}
|
||||
}
|
||||
|
||||
function dismissArticle(id) {
|
||||
try {
|
||||
var elem = $("RROW-" + id);
|
||||
|
||||
Reference in New Issue
Block a user