summaryrefslogtreecommitdiff
path: root/plugins/mailto/init.js
blob: 92a90f8e9b317205eac0d94dbef2011698ca050e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function mailtoArticle(id) {
	if (!id) {
		const ids = Headlines.getSelected();

		if (ids.length == 0) {
			alert(__("No articles selected."));
			return;
		}

		id = ids.toString();
	}

	if (dijit.byId("emailArticleDlg"))
		dijit.byId("emailArticleDlg").destroyRecursive();

	const query = "backend.php?op=pluginhandler&plugin=mailto&method=emailArticle&param=" + encodeURIComponent(id);

	const dialog = new dijit.Dialog({
		id: "emailArticleDlg",
		title: __("Forward article by email"),
		style: "width: 600px",
		href: query});

	dialog.show();
}