]>
git.wh0rd.org - tt-rss.git/blob - js/mail_button.js
1 function emailArticle(id
) {
4 var ids
= getSelectedArticleIds2();
7 alert(__("No articles are selected."));
14 if (dijit
.byId("emailArticleDlg"))
15 dijit
.byId("emailArticleDlg").destroyRecursive();
17 var query
= "backend.php?op=rpc&method=buttonPlugin&plugin=mail&plugin_method=emailArticle¶m=" + param_escape(id
);
19 dialog
= new dijit
.Dialog({
20 id
: "emailArticleDlg",
21 title
: __("Forward article by email"),
22 style
: "width: 600px",
24 if (this.validate()) {
26 new Ajax
.Request("backend.php", {
27 parameters
: dojo
.objectToQuery(this.attr('value')),
28 onComplete: function(transport
) {
30 var reply
= JSON
.parse(transport
.responseText
);
32 var error
= reply
['error'];
35 alert(__('Error sending email:') + ' ' + error
);
37 notify_info('Your message has been sent.');
46 var tmph
= dojo
.connect(dialog
, 'onLoad', function() {
47 dojo
.disconnect(tmph
);
49 new Ajax
.Autocompleter('emailArticleDlg_destination', 'emailArticleDlg_dst_choices',
50 "backend.php?op=rpc&method=buttonPlugin&plugin=mail&plugin_method=completeEmails",
51 { tokens
: '', paramName
: "search" });
57 exception_error("emailArticle", e
);