2021-02-12 12:22:10 +00:00
|
|
|
/* global Plugins, Headlines, fox, __ */
|
|
|
|
|
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
|
|
|
const query = "backend.php?op=pluginhandler&plugin=mailto&method=emailArticle¶m=" + encodeURIComponent(id);
|
2013-03-19 14:32:49 +00:00
|
|
|
|
2021-02-12 12:22:10 +00:00
|
|
|
const dialog = new fox.SingleUseDialog({
|
2018-12-03 11:21:50 +00:00
|
|
|
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);
|
2021-02-12 12:22:10 +00:00
|
|
|
};
|