mirror of
https://git.tt-rss.org/fox/tt-rss.git
synced 2025-11-29 01:51:00 +01: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:
parent
219cc9a0ab
commit
3d11c61f32
@ -8,7 +8,7 @@ class Pref_Prefs extends Handler_Protected {
|
|||||||
private $profile_blacklist = [];
|
private $profile_blacklist = [];
|
||||||
|
|
||||||
function csrf_ignore($method) {
|
function csrf_ignore($method) {
|
||||||
$csrf_ignored = array("index", "updateself", "editprefprofiles", "otpqrcode");
|
$csrf_ignored = array("index", "updateself", "otpqrcode");
|
||||||
|
|
||||||
return array_search($method, $csrf_ignored) !== false;
|
return array_search($method, $csrf_ignored) !== false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class Pref_Users extends Handler_Protected {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function csrf_ignore($method) {
|
function csrf_ignore($method) {
|
||||||
$csrf_ignored = array("index", "edit", "userdetails");
|
$csrf_ignored = array("index", "userdetails");
|
||||||
|
|
||||||
return array_search($method, $csrf_ignored) !== false;
|
return array_search($method, $csrf_ignored) !== false;
|
||||||
}
|
}
|
||||||
|
|||||||
11
js/App.js
11
js/App.js
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/* global __, Article, Ajax, Headlines, Filters */
|
/* global __, Article, Ajax, Headlines, Filters, fox */
|
||||||
/* global xhrPost, xhrJson, dojo, dijit, PluginHost, Notify, $$, Feeds, Cookie */
|
/* global xhrPost, xhrJson, dojo, dijit, PluginHost, Notify, $$, Feeds, Cookie */
|
||||||
/* global CommonDialogs, Plugins, Effect */
|
/* global CommonDialogs, Plugins, Effect */
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ const App = {
|
|||||||
},
|
},
|
||||||
helpDialog: function(topic) {
|
helpDialog: function(topic) {
|
||||||
xhrPost("backend.php", {op: "backend", method: "help", topic: topic}, (transport) => {
|
xhrPost("backend.php", {op: "backend", method: "help", topic: topic}, (transport) => {
|
||||||
const dialog = new dijit.Dialog({
|
const dialog = new fox.SingleUseDialog({
|
||||||
title: __("Help"),
|
title: __("Help"),
|
||||||
content: transport.responseText,
|
content: transport.responseText,
|
||||||
});
|
});
|
||||||
@ -333,7 +333,7 @@ const App = {
|
|||||||
let dialog = dijit.byId("infoBox");
|
let dialog = dijit.byId("infoBox");
|
||||||
|
|
||||||
if (!dialog) {
|
if (!dialog) {
|
||||||
dialog = new dijit.Dialog({
|
dialog = new fox.SingleUseDialog({
|
||||||
title: title,
|
title: title,
|
||||||
id: 'infoBox',
|
id: 'infoBox',
|
||||||
onCancel: function () {
|
onCancel: function () {
|
||||||
@ -577,9 +577,6 @@ const App = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (dijit.byId("exceptionDlg"))
|
|
||||||
dijit.byId("exceptionDlg").destroyRecursive();
|
|
||||||
|
|
||||||
let stack_msg = "";
|
let stack_msg = "";
|
||||||
|
|
||||||
if (error.stack)
|
if (error.stack)
|
||||||
@ -599,7 +596,7 @@ const App = {
|
|||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
const dialog = new fox.SingleUseDialog({
|
||||||
id: "exceptionDlg",
|
id: "exceptionDlg",
|
||||||
title: params.title || __("Unhandled exception"),
|
title: params.title || __("Unhandled exception"),
|
||||||
content: content
|
content: content
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
/* global __, ngettext, App, Headlines, xhrPost, xhrJson, dojo, dijit, PluginHost, Notify, $$, Ajax */
|
/* global __, ngettext, App, Headlines, xhrPost, xhrJson, dojo, dijit, PluginHost, Notify, $$, Ajax, fox */
|
||||||
|
|
||||||
const Article = {
|
const Article = {
|
||||||
_scroll_reset_timeout: false,
|
_scroll_reset_timeout: false,
|
||||||
@ -250,12 +250,9 @@ const Article = {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
editTags: function (id) {
|
editTags: function (id) {
|
||||||
if (dijit.byId("editTagsDlg"))
|
|
||||||
dijit.byId("editTagsDlg").destroyRecursive();
|
|
||||||
|
|
||||||
xhrPost("backend.php", {op: "article", method: "editarticletags", param: id}, (transport) => {
|
xhrPost("backend.php", {op: "article", method: "editarticletags", param: id}, (transport) => {
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
const dialog = new fox.SingleUseDialog({
|
||||||
id: "editTagsDlg",
|
id: "editTagsDlg",
|
||||||
title: __("Edit article Tags"),
|
title: __("Edit article Tags"),
|
||||||
content: transport.responseText,
|
content: transport.responseText,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
/* global __, ngettext, dojo, dijit, Notify, App, Feeds, $$, xhrPost, xhrJson, Tables, Effect */
|
/* global __, ngettext, dojo, dijit, Notify, App, Feeds, $$, xhrPost, xhrJson, Tables, Effect, fox */
|
||||||
|
|
||||||
/* exported CommonDialogs */
|
/* exported CommonDialogs */
|
||||||
const CommonDialogs = {
|
const CommonDialogs = {
|
||||||
@ -75,16 +75,11 @@ const CommonDialogs = {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
quickAddFeed: function() {
|
quickAddFeed: function() {
|
||||||
|
|
||||||
// overlapping widgets
|
|
||||||
if (dijit.byId("batchSubDlg")) dijit.byId("batchSubDlg").destroyRecursive();
|
|
||||||
if (dijit.byId("feedAddDlg")) dijit.byId("feedAddDlg").destroyRecursive();
|
|
||||||
|
|
||||||
xhrPost("backend.php",
|
xhrPost("backend.php",
|
||||||
{op: "feeds", method: "quickAddFeed"},
|
{op: "feeds", method: "quickAddFeed"},
|
||||||
(transport) => {
|
(transport) => {
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
const dialog = new fox.SingleUseDialog({
|
||||||
id: "feedAddDlg",
|
id: "feedAddDlg",
|
||||||
title: __("Subscribe to Feed"),
|
title: __("Subscribe to Feed"),
|
||||||
content: transport.responseText,
|
content: transport.responseText,
|
||||||
@ -192,10 +187,7 @@ const CommonDialogs = {
|
|||||||
showFeedsWithErrors: function() {
|
showFeedsWithErrors: function() {
|
||||||
const query = {op: "pref-feeds", method: "feedsWithErrors"};
|
const query = {op: "pref-feeds", method: "feedsWithErrors"};
|
||||||
|
|
||||||
if (dijit.byId("errorFeedsDlg"))
|
const dialog = new fox.SingleUseDialog({
|
||||||
dijit.byId("errorFeedsDlg").destroyRecursive();
|
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
|
||||||
id: "errorFeedsDlg",
|
id: "errorFeedsDlg",
|
||||||
title: __("Feeds with update errors"),
|
title: __("Feeds with update errors"),
|
||||||
getSelectedFeeds: function () {
|
getSelectedFeeds: function () {
|
||||||
@ -298,13 +290,7 @@ const CommonDialogs = {
|
|||||||
|
|
||||||
console.log("editFeed", query);
|
console.log("editFeed", query);
|
||||||
|
|
||||||
if (dijit.byId("filterEditDlg"))
|
const dialog = new fox.SingleUseDialog({
|
||||||
dijit.byId("filterEditDlg").destroyRecursive();
|
|
||||||
|
|
||||||
if (dijit.byId("feedEditDlg"))
|
|
||||||
dijit.byId("feedEditDlg").destroyRecursive();
|
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
|
||||||
id: "feedEditDlg",
|
id: "feedEditDlg",
|
||||||
title: __("Edit Feed"),
|
title: __("Edit Feed"),
|
||||||
execute: function () {
|
execute: function () {
|
||||||
@ -363,10 +349,7 @@ const CommonDialogs = {
|
|||||||
|
|
||||||
xhrJson("backend.php", {op: "pref-feeds", method: "getOPMLKey"}, (reply) => {
|
xhrJson("backend.php", {op: "pref-feeds", method: "getOPMLKey"}, (reply) => {
|
||||||
try {
|
try {
|
||||||
if (dijit.byId("publicOPMLDlg"))
|
const dialog = new fox.SingleUseDialog({
|
||||||
dijit.byId("publicOPMLDlg").destroyRecursive();
|
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
|
||||||
title: __("Public OPML URL"),
|
title: __("Public OPML URL"),
|
||||||
id: 'publicOPMLDlg',
|
id: 'publicOPMLDlg',
|
||||||
onCancel: function () {
|
onCancel: function () {
|
||||||
@ -411,14 +394,10 @@ const CommonDialogs = {
|
|||||||
|
|
||||||
xhrJson("backend.php", {op: "pref-feeds", method: "getFeedKey", id: feed, is_cat: is_cat}, (reply) => {
|
xhrJson("backend.php", {op: "pref-feeds", method: "getFeedKey", id: feed, is_cat: is_cat}, (reply) => {
|
||||||
try {
|
try {
|
||||||
if (dijit.byId("genFeedDlg"))
|
|
||||||
dijit.byId("genFeedDlg").destroyRecursive();
|
|
||||||
|
|
||||||
const feed_title = Feeds.getName(feed, is_cat);
|
const feed_title = Feeds.getName(feed, is_cat);
|
||||||
|
|
||||||
const secret_url = rss_url + "&key=" + encodeURIComponent(reply.link);
|
const secret_url = rss_url + "&key=" + encodeURIComponent(reply.link);
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
const dialog = new fox.SingleUseDialog({
|
||||||
title: __("Show as feed"),
|
title: __("Show as feed"),
|
||||||
id: 'genFeedDlg',
|
id: 'genFeedDlg',
|
||||||
onCancel: function () {
|
onCancel: function () {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
/* global __, App, Article, Lists, Effect */
|
/* global __, App, Article, Lists, Effect, fox */
|
||||||
/* global xhrPost, dojo, dijit, Notify, $$, Feeds */
|
/* global xhrPost, dojo, dijit, Notify, $$, Feeds */
|
||||||
|
|
||||||
const Filters = {
|
const Filters = {
|
||||||
@ -138,10 +138,7 @@ const Filters = {
|
|||||||
},
|
},
|
||||||
test: function(params) {
|
test: function(params) {
|
||||||
|
|
||||||
if (dijit.byId("filterTestDlg"))
|
const test_dlg = new fox.SingleUseDialog({
|
||||||
dijit.byId("filterTestDlg").destroyRecursive();
|
|
||||||
|
|
||||||
const test_dlg = new dijit.Dialog({
|
|
||||||
id: "filterTestDlg",
|
id: "filterTestDlg",
|
||||||
title: "Test Filter",
|
title: "Test Filter",
|
||||||
results: 0,
|
results: 0,
|
||||||
@ -249,128 +246,127 @@ const Filters = {
|
|||||||
console.log('Filters.edit', query);
|
console.log('Filters.edit', query);
|
||||||
|
|
||||||
xhrPost("backend.php", query, function (transport) {
|
xhrPost("backend.php", query, function (transport) {
|
||||||
if (dijit.byId("feedEditDlg"))
|
try {
|
||||||
dijit.byId("feedEditDlg").destroyRecursive();
|
const dialog = new fox.SingleUseDialog({
|
||||||
|
id: "filterEditDlg",
|
||||||
|
title: __("Create Filter"),
|
||||||
|
test: function () {
|
||||||
|
Filters.test(this.attr('value'));
|
||||||
|
},
|
||||||
|
selectRules: function (select) {
|
||||||
|
Lists.select("filterDlg_Matches", select);
|
||||||
|
},
|
||||||
|
selectActions: function (select) {
|
||||||
|
Lists.select("filterDlg_Actions", select);
|
||||||
|
},
|
||||||
|
editRule: function (e) {
|
||||||
|
const li = e.closest('li');
|
||||||
|
const rule = li.querySelector('input[name="rule[]"]').value
|
||||||
|
|
||||||
if (dijit.byId("filterEditDlg"))
|
Filters.addFilterRule(li, rule);
|
||||||
dijit.byId("filterEditDlg").destroyRecursive();
|
},
|
||||||
|
editAction: function (e) {
|
||||||
|
const li = e.closest('li');
|
||||||
|
const action = li.querySelector('input[name="action[]"]').value
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
Filters.addFilterAction(li, action);
|
||||||
id: "filterEditDlg",
|
},
|
||||||
title: __("Create Filter"),
|
removeFilter: function () {
|
||||||
test: function () {
|
const msg = __("Remove filter?");
|
||||||
Filters.test(this.attr('value'));
|
|
||||||
},
|
|
||||||
selectRules: function (select) {
|
|
||||||
Lists.select("filterDlg_Matches", select);
|
|
||||||
},
|
|
||||||
selectActions: function (select) {
|
|
||||||
Lists.select("filterDlg_Actions", select);
|
|
||||||
},
|
|
||||||
editRule: function (e) {
|
|
||||||
const li = e.closest('li');
|
|
||||||
const rule = li.querySelector('input[name="rule[]"]').value
|
|
||||||
|
|
||||||
Filters.addFilterRule(li, rule);
|
if (confirm(msg)) {
|
||||||
},
|
this.hide();
|
||||||
editAction: function (e) {
|
|
||||||
const li = e.closest('li');
|
|
||||||
const action = li.querySelector('input[name="action[]"]').value
|
|
||||||
|
|
||||||
Filters.addFilterAction(li, action);
|
Notify.progress("Removing filter...");
|
||||||
},
|
|
||||||
removeFilter: function () {
|
|
||||||
const msg = __("Remove filter?");
|
|
||||||
|
|
||||||
if (confirm(msg)) {
|
const query = {op: "pref-filters", method: "remove", ids: this.attr('value').id};
|
||||||
this.hide();
|
|
||||||
|
|
||||||
Notify.progress("Removing filter...");
|
xhrPost("backend.php", query, () => {
|
||||||
|
const tree = dijit.byId("filterTree");
|
||||||
|
|
||||||
const query = {op: "pref-filters", method: "remove", ids: this.attr('value').id};
|
if (tree) tree.reload();
|
||||||
|
});
|
||||||
xhrPost("backend.php", query, () => {
|
}
|
||||||
const tree = dijit.byId("filterTree");
|
},
|
||||||
|
addAction: function () {
|
||||||
if (tree) tree.reload();
|
Filters.addFilterAction();
|
||||||
|
},
|
||||||
|
addRule: function () {
|
||||||
|
Filters.addFilterRule();
|
||||||
|
},
|
||||||
|
deleteAction: function () {
|
||||||
|
$$("#filterDlg_Actions li[class*=Selected]").each(function (e) {
|
||||||
|
e.parentNode.removeChild(e)
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
},
|
deleteRule: function () {
|
||||||
addAction: function () {
|
$$("#filterDlg_Matches li[class*=Selected]").each(function (e) {
|
||||||
Filters.addFilterAction();
|
e.parentNode.removeChild(e)
|
||||||
},
|
|
||||||
addRule: function () {
|
|
||||||
Filters.addFilterRule();
|
|
||||||
},
|
|
||||||
deleteAction: function () {
|
|
||||||
$$("#filterDlg_Actions li[class*=Selected]").each(function (e) {
|
|
||||||
e.parentNode.removeChild(e)
|
|
||||||
});
|
|
||||||
},
|
|
||||||
deleteRule: function () {
|
|
||||||
$$("#filterDlg_Matches li[class*=Selected]").each(function (e) {
|
|
||||||
e.parentNode.removeChild(e)
|
|
||||||
});
|
|
||||||
},
|
|
||||||
execute: function () {
|
|
||||||
if (this.validate()) {
|
|
||||||
|
|
||||||
Notify.progress("Saving data...", true);
|
|
||||||
|
|
||||||
xhrPost("backend.php", this.attr('value'), () => {
|
|
||||||
dialog.hide();
|
|
||||||
|
|
||||||
const tree = dijit.byId("filterTree");
|
|
||||||
if (tree) tree.reload();
|
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
},
|
execute: function () {
|
||||||
content: transport.responseText
|
if (this.validate()) {
|
||||||
});
|
|
||||||
|
|
||||||
if (!App.isPrefs()) {
|
Notify.progress("Saving data...", true);
|
||||||
/* global getSelectionText */
|
|
||||||
const selectedText = getSelectionText();
|
|
||||||
|
|
||||||
const lh = dojo.connect(dialog, "onShow", function () {
|
xhrPost("backend.php", this.attr('value'), () => {
|
||||||
dojo.disconnect(lh);
|
dialog.hide();
|
||||||
|
|
||||||
if (selectedText != "") {
|
const tree = dijit.byId("filterTree");
|
||||||
|
if (tree) tree.reload();
|
||||||
const feed_id = Feeds.activeIsCat() ? 'CAT:' + parseInt(Feeds.getActive()) :
|
});
|
||||||
Feeds.getActive();
|
}
|
||||||
|
},
|
||||||
const rule = {reg_exp: selectedText, feed_id: [feed_id], filter_type: 1};
|
content: transport.responseText
|
||||||
|
|
||||||
Filters.addFilterRule(null, dojo.toJson(rule));
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
const query = {op: "rpc", method: "getlinktitlebyid", id: Article.getActive()};
|
|
||||||
|
|
||||||
xhrPost("backend.php", query, (transport) => {
|
|
||||||
const reply = JSON.parse(transport.responseText);
|
|
||||||
|
|
||||||
let title = false;
|
|
||||||
|
|
||||||
if (reply && reply.title) title = reply.title;
|
|
||||||
|
|
||||||
if (title || Feeds.getActive() || Feeds.activeIsCat()) {
|
|
||||||
|
|
||||||
console.log(title + " " + Feeds.getActive());
|
|
||||||
|
|
||||||
const feed_id = Feeds.activeIsCat() ? 'CAT:' + parseInt(Feeds.getActive()) :
|
|
||||||
Feeds.getActive();
|
|
||||||
|
|
||||||
const rule = {reg_exp: title, feed_id: [feed_id], filter_type: 1};
|
|
||||||
|
|
||||||
Filters.addFilterRule(null, dojo.toJson(rule));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!App.isPrefs()) {
|
||||||
|
/* global getSelectionText */
|
||||||
|
const selectedText = getSelectionText();
|
||||||
|
|
||||||
|
const lh = dojo.connect(dialog, "onShow", function () {
|
||||||
|
dojo.disconnect(lh);
|
||||||
|
|
||||||
|
if (selectedText != "") {
|
||||||
|
|
||||||
|
const feed_id = Feeds.activeIsCat() ? 'CAT:' + parseInt(Feeds.getActive()) :
|
||||||
|
Feeds.getActive();
|
||||||
|
|
||||||
|
const rule = {reg_exp: selectedText, feed_id: [feed_id], filter_type: 1};
|
||||||
|
|
||||||
|
Filters.addFilterRule(null, dojo.toJson(rule));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
const query = {op: "rpc", method: "getlinktitlebyid", id: Article.getActive()};
|
||||||
|
|
||||||
|
xhrPost("backend.php", query, (transport) => {
|
||||||
|
const reply = JSON.parse(transport.responseText);
|
||||||
|
|
||||||
|
let title = false;
|
||||||
|
|
||||||
|
if (reply && reply.title) title = reply.title;
|
||||||
|
|
||||||
|
if (title || Feeds.getActive() || Feeds.activeIsCat()) {
|
||||||
|
|
||||||
|
console.log(title + " " + Feeds.getActive());
|
||||||
|
|
||||||
|
const feed_id = Feeds.activeIsCat() ? 'CAT:' + parseInt(Feeds.getActive()) :
|
||||||
|
Feeds.getActive();
|
||||||
|
|
||||||
|
const rule = {reg_exp: title, feed_id: [feed_id], filter_type: 1};
|
||||||
|
|
||||||
|
Filters.addFilterRule(null, dojo.toJson(rule));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
dialog.show();
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
App.Error.report(e);
|
||||||
}
|
}
|
||||||
dialog.show();
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
106
js/Feeds.js
106
js/Feeds.js
@ -1,6 +1,6 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
/* global __, App, Headlines, xhrPost, dojo, dijit, Form, fox, PluginHost, Notify, $$ */
|
/* global __, App, Headlines, xhrPost, dojo, dijit, Form, fox, PluginHost, Notify, $$, fox */
|
||||||
|
|
||||||
const Feeds = {
|
const Feeds = {
|
||||||
counters_last_request: 0,
|
counters_last_request: 0,
|
||||||
@ -223,10 +223,7 @@ const Feeds = {
|
|||||||
if (App.getInitParam("is_default_pw")) {
|
if (App.getInitParam("is_default_pw")) {
|
||||||
console.warn("user password is at default value");
|
console.warn("user password is at default value");
|
||||||
|
|
||||||
if (dijit.byId("defaultPasswordDlg"))
|
const dialog = new fox.SingleUseDialog({
|
||||||
dijit.byId("defaultPasswordDlg").destroyRecursive();
|
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
|
||||||
title: __("Your password is at default value"),
|
title: __("Your password is at default value"),
|
||||||
content: `<div class='alert alert-error'>
|
content: `<div class='alert alert-error'>
|
||||||
${__("You are using default tt-rss password. Please change it in the Preferences (Personal data / Authentication).")}
|
${__("You are using default tt-rss password. Please change it in the Preferences (Personal data / Authentication).")}
|
||||||
@ -236,51 +233,26 @@ const Feeds = {
|
|||||||
<button dojoType='dijit.form.Button' class='alt-primary' onclick="document.location.href = 'prefs.php'">
|
<button dojoType='dijit.form.Button' class='alt-primary' onclick="document.location.href = 'prefs.php'">
|
||||||
${__('Open Preferences')}
|
${__('Open Preferences')}
|
||||||
</button>
|
</button>
|
||||||
<button dojoType='dijit.form.Button' onclick="return dijit.byId('defaultPasswordDlg').hide()">
|
<button dojoType='dijit.form.Button' onclick="App.dialogOf(this).hide()">
|
||||||
${__('Close this window')}
|
${__('Close this window')}
|
||||||
</button>
|
</button>
|
||||||
</footer>`,
|
</footer>`
|
||||||
id: 'defaultPasswordDlg',
|
|
||||||
onCancel: function () {
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
onExecute: function () {
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
onClose: function () {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dijit.byId("safeModeDlg"))
|
|
||||||
dijit.byId("safeModeDlg").destroyRecursive();
|
|
||||||
|
|
||||||
if (App.getInitParam("safe_mode")) {
|
if (App.getInitParam("safe_mode")) {
|
||||||
const dialog = new dijit.Dialog({
|
const dialog = new fox.SingleUseDialog({
|
||||||
title: __("Safe mode"),
|
title: __("Safe mode"),
|
||||||
content: `
|
content: `<div class='alert alert-info'>
|
||||||
<div class='alert alert-info'>
|
|
||||||
${__('Tiny Tiny RSS is running in safe mode. All themes and plugins are disabled. You will need to log out and back in to disable it.')}
|
${__('Tiny Tiny RSS is running in safe mode. All themes and plugins are disabled. You will need to log out and back in to disable it.')}
|
||||||
</div>
|
</div>
|
||||||
<footer class='text-center'>
|
<footer class='text-center'>
|
||||||
<button dojoType='dijit.form.Button' type='submit' class='alt-primary'>
|
<button dojoType='dijit.form.Button' type='submit' class='alt-primary'>
|
||||||
${__('Close this window')}
|
${__('Close this window')}
|
||||||
</button>
|
</button>
|
||||||
</footer>
|
</footer>`
|
||||||
`,
|
|
||||||
id: 'safeModeDlg',
|
|
||||||
onCancel: function () {
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
onExecute: function () {
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
onClose: function () {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
@ -598,43 +570,43 @@ const Feeds = {
|
|||||||
{op: "feeds", method: "search",
|
{op: "feeds", method: "search",
|
||||||
param: Feeds.getActive() + ":" + Feeds.activeIsCat()},
|
param: Feeds.getActive() + ":" + Feeds.activeIsCat()},
|
||||||
(transport) => {
|
(transport) => {
|
||||||
if (dijit.byId("searchDlg"))
|
try {
|
||||||
dijit.byId("searchDlg").destroyRecursive();
|
const dialog = new fox.SingleUseDialog({
|
||||||
|
id: "searchDlg",
|
||||||
|
content: transport.responseText,
|
||||||
|
title: __("Search"),
|
||||||
|
execute: function () {
|
||||||
|
if (this.validate()) {
|
||||||
|
Feeds._search_query = this.attr('value');
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
// disallow empty queries
|
||||||
id: "searchDlg",
|
if (!Feeds._search_query.query)
|
||||||
content: transport.responseText,
|
Feeds._search_query = false;
|
||||||
title: __("Search"),
|
|
||||||
execute: function () {
|
|
||||||
if (this.validate()) {
|
|
||||||
Feeds._search_query = this.attr('value');
|
|
||||||
|
|
||||||
// disallow empty queries
|
this.hide();
|
||||||
if (!Feeds._search_query.query)
|
Feeds.reloadCurrent();
|
||||||
Feeds._search_query = false;
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
this.hide();
|
const tmph = dojo.connect(dialog, 'onShow', function () {
|
||||||
Feeds.reloadCurrent();
|
dojo.disconnect(tmph);
|
||||||
|
|
||||||
|
if (Feeds._search_query) {
|
||||||
|
if (Feeds._search_query.query)
|
||||||
|
dijit.byId('search_query')
|
||||||
|
.attr('value', Feeds._search_query.query);
|
||||||
|
|
||||||
|
if (Feeds._search_query.search_language)
|
||||||
|
dijit.byId('search_language')
|
||||||
|
.attr('value', Feeds._search_query.search_language);
|
||||||
}
|
}
|
||||||
},
|
});
|
||||||
});
|
|
||||||
|
|
||||||
const tmph = dojo.connect(dialog, 'onShow', function () {
|
dialog.show();
|
||||||
dojo.disconnect(tmph);
|
} catch (e) {
|
||||||
|
App.Error.report(e);
|
||||||
if (Feeds._search_query) {
|
}
|
||||||
if (Feeds._search_query.query)
|
|
||||||
dijit.byId('search_query')
|
|
||||||
.attr('value', Feeds._search_query.query);
|
|
||||||
|
|
||||||
if (Feeds._search_query.search_language)
|
|
||||||
dijit.byId('search_language')
|
|
||||||
.attr('value', Feeds._search_query.search_language);
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
dialog.show();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/* global __, lib, dijit, define, dojo, CommonDialogs, Notify, Tables, xhrPost */
|
/* global __, lib, dijit, define, dojo, CommonDialogs, Notify, Tables, xhrPost, fox, App */
|
||||||
|
|
||||||
define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], function (declare, domConstruct) {
|
define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], function (declare, domConstruct) {
|
||||||
|
|
||||||
@ -250,64 +250,65 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
|||||||
|
|
||||||
Notify.progress("Loading, please wait...");
|
Notify.progress("Loading, please wait...");
|
||||||
|
|
||||||
if (dijit.byId("feedEditDlg"))
|
|
||||||
dijit.byId("feedEditDlg").destroyRecursive();
|
|
||||||
|
|
||||||
xhrPost("backend.php", {op: "pref-feeds", method: "editfeeds", ids: rows.toString()}, (transport) => {
|
xhrPost("backend.php", {op: "pref-feeds", method: "editfeeds", ids: rows.toString()}, (transport) => {
|
||||||
Notify.close();
|
Notify.close();
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
try {
|
||||||
id: "feedEditDlg",
|
const dialog = new fox.SingleUseDialog({
|
||||||
title: __("Edit Multiple Feeds"),
|
id: "feedEditDlg",
|
||||||
getChildByName: function (name) {
|
title: __("Edit Multiple Feeds"),
|
||||||
let rv = null;
|
getChildByName: function (name) {
|
||||||
this.getChildren().each(
|
let rv = null;
|
||||||
function (child) {
|
this.getChildren().each(
|
||||||
if (child.name == name) {
|
function (child) {
|
||||||
rv = child;
|
if (child.name == name) {
|
||||||
return;
|
rv = child;
|
||||||
}
|
return;
|
||||||
});
|
}
|
||||||
return rv;
|
});
|
||||||
},
|
return rv;
|
||||||
toggleField: function (checkbox, elem, label) {
|
},
|
||||||
this.getChildByName(elem).attr('disabled', !checkbox.checked);
|
toggleField: function (checkbox, elem, label) {
|
||||||
|
this.getChildByName(elem).attr('disabled', !checkbox.checked);
|
||||||
|
|
||||||
if ($(label))
|
if ($(label))
|
||||||
if (checkbox.checked)
|
if (checkbox.checked)
|
||||||
$(label).removeClassName('text-muted');
|
$(label).removeClassName('text-muted');
|
||||||
else
|
else
|
||||||
$(label).addClassName('text-muted');
|
$(label).addClassName('text-muted');
|
||||||
|
|
||||||
},
|
},
|
||||||
execute: function () {
|
execute: function () {
|
||||||
if (this.validate() && confirm(__("Save changes to selected feeds?"))) {
|
if (this.validate() && confirm(__("Save changes to selected feeds?"))) {
|
||||||
const query = this.attr('value');
|
const query = this.attr('value');
|
||||||
|
|
||||||
/* normalize unchecked checkboxes because [] is not serialized */
|
/* normalize unchecked checkboxes because [] is not serialized */
|
||||||
|
|
||||||
Object.keys(query).each((key) => {
|
Object.keys(query).each((key) => {
|
||||||
let val = query[key];
|
let val = query[key];
|
||||||
|
|
||||||
if (typeof val == "object" && val.length == 0)
|
if (typeof val == "object" && val.length == 0)
|
||||||
query[key] = ["off"];
|
query[key] = ["off"];
|
||||||
});
|
});
|
||||||
|
|
||||||
Notify.progress("Saving data...", true);
|
Notify.progress("Saving data...", true);
|
||||||
|
|
||||||
xhrPost("backend.php", query, () => {
|
xhrPost("backend.php", query, () => {
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
|
|
||||||
const tree = dijit.byId("feedTree");
|
const tree = dijit.byId("feedTree");
|
||||||
|
|
||||||
if (tree) tree.reload();
|
if (tree) tree.reload();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
content: transport.responseText
|
content: transport.responseText
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
} catch (e) {
|
||||||
|
App.Error.report(e);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
editCategory: function(id, item) {
|
editCategory: function(id, item) {
|
||||||
@ -339,13 +340,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
batchSubscribe: function() {
|
batchSubscribe: function() {
|
||||||
const query = "backend.php?op=pref-feeds&method=batchSubscribe";
|
const dialog = new fox.SingleUseDialog({
|
||||||
|
|
||||||
// overlapping widgets
|
|
||||||
if (dijit.byId("batchSubDlg")) dijit.byId("batchSubDlg").destroyRecursive();
|
|
||||||
if (dijit.byId("feedAddDlg")) dijit.byId("feedAddDlg").destroyRecursive();
|
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
|
||||||
id: "batchSubDlg",
|
id: "batchSubDlg",
|
||||||
title: __("Batch subscribe"),
|
title: __("Batch subscribe"),
|
||||||
execute: function () {
|
execute: function () {
|
||||||
@ -362,18 +357,13 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
href: query
|
href: "backend.php?" + dojo.objectToQuery({op: 'pref-feeds', method: 'batchSubscribe'})
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
},
|
},
|
||||||
showInactiveFeeds: function() {
|
showInactiveFeeds: function() {
|
||||||
const query = "backend.php?op=pref-feeds&method=inactiveFeeds";
|
const dialog = new fox.SingleUseDialog({
|
||||||
|
|
||||||
if (dijit.byId("inactiveFeedsDlg"))
|
|
||||||
dijit.byId("inactiveFeedsDlg").destroyRecursive();
|
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
|
||||||
id: "inactiveFeedsDlg",
|
id: "inactiveFeedsDlg",
|
||||||
title: __("Feeds without recent updates"),
|
title: __("Feeds without recent updates"),
|
||||||
getSelectedFeeds: function () {
|
getSelectedFeeds: function () {
|
||||||
@ -405,11 +395,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
|
|||||||
alert(__("No feeds selected."));
|
alert(__("No feeds selected."));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
execute: function () {
|
href: 'backend.php?' + dojo.objectToQuery({op: 'pref-feeds', method: 'inactiveFeeds'})
|
||||||
if (this.validate()) {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
href: query
|
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/* global __, dijit, dojo, Tables, xhrPost, Notify, xhrJson, App */
|
/* global __, dijit, dojo, Tables, xhrPost, Notify, xhrJson, App, fox */
|
||||||
|
|
||||||
const Helpers = {
|
const Helpers = {
|
||||||
AppPasswords: {
|
AppPasswords: {
|
||||||
@ -83,14 +83,7 @@ const Helpers = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
editProfiles: function() {
|
editProfiles: function() {
|
||||||
|
const dialog = new fox.SingleUseDialog({
|
||||||
if (dijit.byId("profileEditDlg"))
|
|
||||||
dijit.byId("profileEditDlg").destroyRecursive();
|
|
||||||
|
|
||||||
const query = "backend.php?op=pref-prefs&method=editPrefProfiles";
|
|
||||||
|
|
||||||
// noinspection JSUnusedGlobalSymbols
|
|
||||||
const dialog = new dijit.Dialog({
|
|
||||||
id: "profileEditDlg",
|
id: "profileEditDlg",
|
||||||
title: __("Settings Profiles"),
|
title: __("Settings Profiles"),
|
||||||
getSelectedProfiles: function () {
|
getSelectedProfiles: function () {
|
||||||
@ -110,7 +103,7 @@ const Helpers = {
|
|||||||
|
|
||||||
xhrPost("backend.php", query, () => {
|
xhrPost("backend.php", query, () => {
|
||||||
Notify.close();
|
Notify.close();
|
||||||
Helpers.editProfiles();
|
dialog.refresh();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,11 +119,16 @@ const Helpers = {
|
|||||||
|
|
||||||
xhrPost("backend.php", query, () => {
|
xhrPost("backend.php", query, () => {
|
||||||
Notify.close();
|
Notify.close();
|
||||||
Helpers.editProfiles();
|
dialog.refresh();
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
refresh: function() {
|
||||||
|
xhrPost("backend.php", {op: 'pref-prefs', method: 'editPrefProfiles'}, (transport) => {
|
||||||
|
dialog.attr('content', transport.responseText);
|
||||||
|
});
|
||||||
|
},
|
||||||
execute: function () {
|
execute: function () {
|
||||||
const sel_rows = this.getSelectedProfiles();
|
const sel_rows = this.getSelectedProfiles();
|
||||||
|
|
||||||
@ -147,15 +145,16 @@ const Helpers = {
|
|||||||
alert(__("Please choose a profile to activate."));
|
alert(__("Please choose a profile to activate."));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
href: query
|
content: ""
|
||||||
});
|
});
|
||||||
|
|
||||||
|
dialog.refresh();
|
||||||
dialog.show();
|
dialog.show();
|
||||||
},
|
},
|
||||||
customizeCSS: function() {
|
customizeCSS: function() {
|
||||||
xhrJson("backend.php", {op: "pref-prefs", method: "customizeCSS"}, (reply) => {
|
xhrJson("backend.php", {op: "pref-prefs", method: "customizeCSS"}, (reply) => {
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
const dialog = new fox.SingleUseDialog({
|
||||||
title: __("Customize stylesheet"),
|
title: __("Customize stylesheet"),
|
||||||
apply: function() {
|
apply: function() {
|
||||||
xhrPost("backend.php", this.attr('value'), () => {
|
xhrPost("backend.php", this.attr('value'), () => {
|
||||||
@ -245,13 +244,15 @@ const Helpers = {
|
|||||||
xhr.onload = function () {
|
xhr.onload = function () {
|
||||||
Notify.close();
|
Notify.close();
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
const dialog = new fox.SingleUseDialog({
|
||||||
title: __("OPML Import"),
|
title: __("OPML Import"),
|
||||||
onCancel: function () {
|
onCancel: function () {
|
||||||
window.location.reload();
|
this.execute();
|
||||||
},
|
},
|
||||||
execute: function () {
|
execute: function () {
|
||||||
window.location.reload();
|
const tree = dijit.byId('feedTree');
|
||||||
|
|
||||||
|
if (tree) tree.reload();
|
||||||
},
|
},
|
||||||
content: `
|
content: `
|
||||||
<div class='alert alert-info'>
|
<div class='alert alert-info'>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
/* global __, define, lib, dijit, dojo, xhrPost, Notify */
|
/* global __, define, lib, dijit, dojo, xhrPost, Notify, fox */
|
||||||
|
|
||||||
define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/form/DropDownButton"], function (declare, domConstruct) {
|
define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/form/DropDownButton"], function (declare, domConstruct) {
|
||||||
|
|
||||||
@ -62,10 +62,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f
|
|||||||
const query = "backend.php?op=pref-labels&method=edit&id=" +
|
const query = "backend.php?op=pref-labels&method=edit&id=" +
|
||||||
encodeURIComponent(id);
|
encodeURIComponent(id);
|
||||||
|
|
||||||
if (dijit.byId("labelEditDlg"))
|
const dialog = new fox.SingleUseDialog({
|
||||||
dijit.byId("labelEditDlg").destroyRecursive();
|
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
|
||||||
id: "labelEditDlg",
|
id: "labelEditDlg",
|
||||||
title: __("Label Editor"),
|
title: __("Label Editor"),
|
||||||
style: "width: 650px",
|
style: "width: 650px",
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
'use strict'
|
'use strict'
|
||||||
|
|
||||||
/* global __ */
|
/* global __ */
|
||||||
/* global xhrPost, dojo, dijit, Notify, Tables */
|
/* global xhrPost, dojo, dijit, Notify, Tables, fox */
|
||||||
|
|
||||||
const Users = {
|
const Users = {
|
||||||
reload: function(sort) {
|
reload: function(sort) {
|
||||||
@ -27,29 +27,25 @@ const Users = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
edit: function(id) {
|
edit: function(id) {
|
||||||
const query = "backend.php?op=pref-users&method=edit&id=" +
|
xhrPost('backend.php', {op: 'pref-users', method: 'edit', id: id}, (transport) => {
|
||||||
encodeURIComponent(id);
|
const dialog = new fox.SingleUseDialog({
|
||||||
|
id: "userEditDlg",
|
||||||
|
title: __("User Editor"),
|
||||||
|
execute: function () {
|
||||||
|
if (this.validate()) {
|
||||||
|
Notify.progress("Saving data...", true);
|
||||||
|
|
||||||
if (dijit.byId("userEditDlg"))
|
xhrPost("backend.php", dojo.formToObject("user_edit_form"), (/* transport */) => {
|
||||||
dijit.byId("userEditDlg").destroyRecursive();
|
dialog.hide();
|
||||||
|
Users.reload();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
content: transport.responseText
|
||||||
|
});
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
dialog.show();
|
||||||
id: "userEditDlg",
|
|
||||||
title: __("User Editor"),
|
|
||||||
execute: function () {
|
|
||||||
if (this.validate()) {
|
|
||||||
Notify.progress("Saving data...", true);
|
|
||||||
|
|
||||||
xhrPost("backend.php", dojo.formToObject("user_edit_form"), (/* transport */) => {
|
|
||||||
dialog.hide();
|
|
||||||
Users.reload();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
href: query
|
|
||||||
});
|
});
|
||||||
|
|
||||||
dialog.show();
|
|
||||||
},
|
},
|
||||||
resetSelected: function() {
|
resetSelected: function() {
|
||||||
const rows = this.getSelection();
|
const rows = this.getSelection();
|
||||||
|
|||||||
8
js/SingleUseDialog.js
Normal file
8
js/SingleUseDialog.js
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/* global dijit, define */
|
||||||
|
define(["dojo/_base/declare", "dijit/Dialog"], function (declare) {
|
||||||
|
return declare("fox.SingleUseDialog", dijit.Dialog, {
|
||||||
|
onHide: function() {
|
||||||
|
this.destroyRecursive();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -51,6 +51,7 @@ require(["dojo/_base/kernel",
|
|||||||
"fox/PrefFilterTree",
|
"fox/PrefFilterTree",
|
||||||
"fox/PrefLabelTree",
|
"fox/PrefLabelTree",
|
||||||
"fox/Toolbar",
|
"fox/Toolbar",
|
||||||
|
"fox/SingleUseDialog",
|
||||||
"fox/form/ValidationTextArea",
|
"fox/form/ValidationTextArea",
|
||||||
"fox/form/Select",
|
"fox/form/Select",
|
||||||
"fox/form/ComboButton",
|
"fox/form/ComboButton",
|
||||||
|
|||||||
@ -50,6 +50,7 @@ require(["dojo/_base/kernel",
|
|||||||
"fox/FeedStoreModel",
|
"fox/FeedStoreModel",
|
||||||
"fox/FeedTree",
|
"fox/FeedTree",
|
||||||
"fox/Toolbar",
|
"fox/Toolbar",
|
||||||
|
"fox/SingleUseDialog",
|
||||||
"fox/form/ValidationTextArea",
|
"fox/form/ValidationTextArea",
|
||||||
"fox/form/Select",
|
"fox/form/Select",
|
||||||
"fox/form/ComboButton",
|
"fox/form/ComboButton",
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
|
/* global Plugins, Headlines, xhrJson, Notify, fox, __ */
|
||||||
|
|
||||||
Plugins.Mail = {
|
Plugins.Mail = {
|
||||||
send: function(id) {
|
send: function(id) {
|
||||||
if (!id) {
|
if (!id) {
|
||||||
let ids = Headlines.getSelected();
|
const ids = Headlines.getSelected();
|
||||||
|
|
||||||
if (ids.length == 0) {
|
if (ids.length == 0) {
|
||||||
alert(__("No articles selected."));
|
alert(__("No articles selected."));
|
||||||
@ -11,12 +13,9 @@ Plugins.Mail = {
|
|||||||
id = ids.toString();
|
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 query = "backend.php?op=pluginhandler&plugin=mail&method=emailArticle¶m=" + encodeURIComponent(id);
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
const dialog = new fox.SingleUseDialog({
|
||||||
id: "emailArticleDlg",
|
id: "emailArticleDlg",
|
||||||
title: __("Forward article by email"),
|
title: __("Forward article by email"),
|
||||||
execute: function () {
|
execute: function () {
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
/* global Plugins, Headlines, fox, __ */
|
||||||
|
|
||||||
Plugins.Mailto = {
|
Plugins.Mailto = {
|
||||||
send: function (id) {
|
send: function (id) {
|
||||||
if (!id) {
|
if (!id) {
|
||||||
@ -11,12 +13,9 @@ Plugins.Mailto = {
|
|||||||
id = ids.toString();
|
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 query = "backend.php?op=pluginhandler&plugin=mailto&method=emailArticle¶m=" + encodeURIComponent(id);
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
const dialog = new fox.SingleUseDialog({
|
||||||
id: "emailArticleDlg",
|
id: "emailArticleDlg",
|
||||||
title: __("Forward article by email"),
|
title: __("Forward article by email"),
|
||||||
href: query});
|
href: query});
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
|
/* global Plugins, xhrJson, Notify, fox, __ */
|
||||||
|
|
||||||
Plugins.Note = {
|
Plugins.Note = {
|
||||||
edit: function(id) {
|
edit: function(id) {
|
||||||
const query = "backend.php?op=pluginhandler&plugin=note&method=edit¶m=" + encodeURIComponent(id);
|
const query = "backend.php?op=pluginhandler&plugin=note&method=edit¶m=" + encodeURIComponent(id);
|
||||||
|
|
||||||
if (dijit.byId("editNoteDlg"))
|
const dialog = new fox.SingleUseDialog({
|
||||||
dijit.byId("editNoteDlg").destroyRecursive();
|
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
|
||||||
id: "editNoteDlg",
|
id: "editNoteDlg",
|
||||||
title: __("Edit article note"),
|
title: __("Edit article note"),
|
||||||
execute: function () {
|
execute: function () {
|
||||||
|
|||||||
@ -1,11 +1,10 @@
|
|||||||
|
/* global Plugins, xhrJson, Notify, fox, xhrPost, __ */
|
||||||
|
|
||||||
Plugins.Share = {
|
Plugins.Share = {
|
||||||
shareArticle: function(id) {
|
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 query = "backend.php?op=pluginhandler&plugin=share&method=shareArticle¶m=" + encodeURIComponent(id);
|
||||||
|
|
||||||
const dialog = new dijit.Dialog({
|
const dialog = new fox.SingleUseDialog({
|
||||||
id: "shareArticleDlg",
|
id: "shareArticleDlg",
|
||||||
title: __("Share article by URL"),
|
title: __("Share article by URL"),
|
||||||
newurl: function () {
|
newurl: function () {
|
||||||
@ -73,7 +72,4 @@ Plugins.Share = {
|
|||||||
const img = $("SHARE-IMG-" + id);
|
const img = $("SHARE-IMG-" + id);
|
||||||
img.addClassName("shared");
|
img.addClassName("shared");
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user