1
0
mirror of https://tt-rss.org/git/tt-rss.git synced 2024-07-02 12:50:52 +02:00
ttrss/plugins/mailto/init.js
Andrew Dolgov 3d11c61f32 * OPML import: don't reload everything, just feed tree
* dialogs: use auto-destroying dialog for almost all dialogs instead of destroying them manually
* some general dialog-related cleanup
2021-02-12 15:22:10 +03:00

33 lines
669 B
JavaScript

/* global Plugins, Headlines, fox, __ */
Plugins.Mailto = {
send: function (id) {
if (!id) {
const ids = Headlines.getSelected();
if (ids.length == 0) {
alert(__("No articles selected."));
return;
}
id = ids.toString();
}
const query = "backend.php?op=pluginhandler&plugin=mailto&method=emailArticle&param=" + encodeURIComponent(id);
const dialog = new fox.SingleUseDialog({
id: "emailArticleDlg",
title: __("Forward article by email"),
href: query});
dialog.show();
}
};
// override default hotkey action if enabled
Plugins.Mail = Plugins.Mail || {};
Plugins.Mail.onHotkey = function(id) {
Plugins.Mailto.send(id);
};