2021-02-17 11:56:36 +00:00
|
|
|
/* global Plugins, Headlines, xhrPost, dojo, fox, __ */
|
2021-02-12 12:22:10 +00:00
|
|
|
|
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
|
|
|
|
2021-02-12 12:22:10 +00:00
|
|
|
const dialog = new fox.SingleUseDialog({
|
2018-12-03 11:21:50 +00:00
|
|
|
title: __("Forward article by email"),
|
2021-02-17 11:56:36 +00:00
|
|
|
content: __("Loading, please wait...")
|
|
|
|
});
|
|
|
|
|
|
|
|
const tmph = dojo.connect(dialog, 'onShow', function () {
|
|
|
|
dojo.disconnect(tmph);
|
|
|
|
|
|
|
|
xhrPost("backend.php", {op: "pluginhandler", plugin: "mailto", method: "emailArticle", ids: id}, (transport) => {
|
|
|
|
dialog.attr('content', transport.responseText);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
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
|
|
|
};
|