summaryrefslogtreecommitdiff
path: root/plugins/mail/mail.js
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mail/mail.js')
-rw-r--r--plugins/mail/mail.js31
1 files changed, 15 insertions, 16 deletions
diff --git a/plugins/mail/mail.js b/plugins/mail/mail.js
index 929b35243..eb7b7e6b6 100644
--- a/plugins/mail/mail.js
+++ b/plugins/mail/mail.js
@@ -1,10 +1,10 @@
-function emailArticle(id) {
- try {
+Plugins.Mail = {
+ send: function(id) {
if (!id) {
- var ids = getSelectedArticleIds2();
+ let ids = Headlines.getSelected();
if (ids.length == 0) {
- alert(__("No articles are selected."));
+ alert(__("No articles selected."));
return;
}
@@ -14,13 +14,13 @@ function emailArticle(id) {
if (dijit.byId("emailArticleDlg"))
dijit.byId("emailArticleDlg").destroyRecursive();
- var query = "backend.php?op=pluginhandler&plugin=mail&method=emailArticle&param=" + param_escape(id);
+ const query = "backend.php?op=pluginhandler&plugin=mail&method=emailArticle&param=" + encodeURIComponent(id);
- dialog = new dijit.Dialog({
+ const dialog = new dijit.Dialog({
id: "emailArticleDlg",
title: __("Forward article by email"),
style: "width: 600px",
- execute: function() {
+ execute: function () {
if (this.validate()) {
xhrJson("backend.php", this.attr('value'), (reply) => {
if (reply) {
@@ -29,7 +29,7 @@ function emailArticle(id) {
if (error) {
alert(__('Error sending email:') + ' ' + error);
} else {
- notify_info('Your message has been sent.');
+ Notify.info('Your message has been sent.');
dialog.hide();
}
@@ -37,10 +37,11 @@ function emailArticle(id) {
});
}
},
- href: query});
+ href: query
+ });
/* var tmph = dojo.connect(dialog, 'onLoad', function() {
- dojo.disconnect(tmph);
+ dojo.disconnect(tmph);
new Ajax.Autocompleter('emailArticleDlg_destination', 'emailArticleDlg_dst_choices',
"backend.php?op=pluginhandler&plugin=mail&method=completeEmails",
@@ -48,10 +49,8 @@ function emailArticle(id) {
}); */
dialog.show();
-
- } catch (e) {
- exception_error("emailArticle", e);
+ },
+ onHotkey: function(id) {
+ Plugins.Mail.send(id);
}
-}
-
-
+};