2018-12-03 11:21:50 +00:00
|
|
|
Plugins.Mailto = {
|
|
|
|
send: function (id) {
|
|
|
|
if (!id) {
|
|
|
|
const ids = Headlines.getSelected();
|
2013-03-19 14:32:49 +00:00
|
|
|
|
2018-12-03 11:21:50 +00:00
|
|
|
if (ids.length == 0) {
|
|
|
|
alert(__("No articles selected."));
|
|
|
|
return;
|
|
|
|
}
|
2013-03-19 14:32:49 +00:00
|
|
|
|
2018-12-03 11:21:50 +00:00
|
|
|
id = ids.toString();
|
|
|
|
}
|
2013-03-19 14:32:49 +00:00
|
|
|
|
2018-12-03 11:21:50 +00:00
|
|
|
if (dijit.byId("emailArticleDlg"))
|
|
|
|
dijit.byId("emailArticleDlg").destroyRecursive();
|
2013-03-19 14:32:49 +00:00
|
|
|
|
2018-12-03 11:21:50 +00:00
|
|
|
const query = "backend.php?op=pluginhandler&plugin=mailto&method=emailArticle¶m=" + encodeURIComponent(id);
|
2013-03-19 14:32:49 +00:00
|
|
|
|
2018-12-03 11:21:50 +00:00
|
|
|
const dialog = new dijit.Dialog({
|
|
|
|
id: "emailArticleDlg",
|
|
|
|
title: __("Forward article by email"),
|
|
|
|
href: query});
|
2013-03-19 14:32:49 +00:00
|
|
|
|
2018-12-03 11:21:50 +00:00
|
|
|
dialog.show();
|
|
|
|
}
|
|
|
|
};
|
2013-03-19 14:32:49 +00:00
|
|
|
|
2018-12-03 11:21:50 +00:00
|
|
|
// override default hotkey action if enabled
|
|
|
|
Plugins.Mail = Plugins.Mail || {};
|
2013-03-19 14:32:49 +00:00
|
|
|
|
2018-12-03 11:21:50 +00:00
|
|
|
Plugins.Mail.onHotkey = function(id) {
|
|
|
|
Plugins.Mailto.send(id);
|
|
|
|
};
|