mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2026-02-10 16:01:33 +00:00
* 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
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
/* global Plugins, Headlines, xhrJson, Notify, fox, __ */
|
||||
|
||||
Plugins.Mail = {
|
||||
send: function(id) {
|
||||
if (!id) {
|
||||
let ids = Headlines.getSelected();
|
||||
const ids = Headlines.getSelected();
|
||||
|
||||
if (ids.length == 0) {
|
||||
alert(__("No articles selected."));
|
||||
@@ -11,12 +13,9 @@ Plugins.Mail = {
|
||||
id = ids.toString();
|
||||
}
|
||||
|
||||
if (dijit.byId("emailArticleDlg"))
|
||||
dijit.byId("emailArticleDlg").destroyRecursive();
|
||||
|
||||
const query = "backend.php?op=pluginhandler&plugin=mail&method=emailArticle¶m=" + encodeURIComponent(id);
|
||||
|
||||
const dialog = new dijit.Dialog({
|
||||
const dialog = new fox.SingleUseDialog({
|
||||
id: "emailArticleDlg",
|
||||
title: __("Forward article by email"),
|
||||
execute: function () {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* global Plugins, Headlines, fox, __ */
|
||||
|
||||
Plugins.Mailto = {
|
||||
send: function (id) {
|
||||
if (!id) {
|
||||
@@ -11,12 +13,9 @@ Plugins.Mailto = {
|
||||
id = ids.toString();
|
||||
}
|
||||
|
||||
if (dijit.byId("emailArticleDlg"))
|
||||
dijit.byId("emailArticleDlg").destroyRecursive();
|
||||
|
||||
const query = "backend.php?op=pluginhandler&plugin=mailto&method=emailArticle¶m=" + encodeURIComponent(id);
|
||||
|
||||
const dialog = new dijit.Dialog({
|
||||
const dialog = new fox.SingleUseDialog({
|
||||
id: "emailArticleDlg",
|
||||
title: __("Forward article by email"),
|
||||
href: query});
|
||||
@@ -30,4 +29,4 @@ Plugins.Mail = Plugins.Mail || {};
|
||||
|
||||
Plugins.Mail.onHotkey = function(id) {
|
||||
Plugins.Mailto.send(id);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
/* global Plugins, xhrJson, Notify, fox, __ */
|
||||
|
||||
Plugins.Note = {
|
||||
edit: function(id) {
|
||||
const query = "backend.php?op=pluginhandler&plugin=note&method=edit¶m=" + encodeURIComponent(id);
|
||||
|
||||
if (dijit.byId("editNoteDlg"))
|
||||
dijit.byId("editNoteDlg").destroyRecursive();
|
||||
|
||||
const dialog = new dijit.Dialog({
|
||||
const dialog = new fox.SingleUseDialog({
|
||||
id: "editNoteDlg",
|
||||
title: __("Edit article note"),
|
||||
execute: function () {
|
||||
@@ -36,4 +35,4 @@ Plugins.Note = {
|
||||
|
||||
dialog.show();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
/* global Plugins, xhrJson, Notify, fox, xhrPost, __ */
|
||||
|
||||
Plugins.Share = {
|
||||
shareArticle: function(id) {
|
||||
if (dijit.byId("shareArticleDlg"))
|
||||
dijit.byId("shareArticleDlg").destroyRecursive();
|
||||
|
||||
const query = "backend.php?op=pluginhandler&plugin=share&method=shareArticle¶m=" + encodeURIComponent(id);
|
||||
|
||||
const dialog = new dijit.Dialog({
|
||||
const dialog = new fox.SingleUseDialog({
|
||||
id: "shareArticleDlg",
|
||||
title: __("Share article by URL"),
|
||||
newurl: function () {
|
||||
@@ -73,7 +72,4 @@ Plugins.Share = {
|
||||
const img = $("SHARE-IMG-" + id);
|
||||
img.addClassName("shared");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user