|
|
|
@ -131,6 +131,139 @@ const App = {
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const Prefs = {
|
|
|
|
|
clearEventLog: function() {
|
|
|
|
|
if (confirm(__("Clear event log?"))) {
|
|
|
|
|
|
|
|
|
|
notify_progress("Loading, please wait...");
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", {op: "pref-system", method: "clearLog"}, () => {
|
|
|
|
|
updateSystemList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
editProfiles: function() {
|
|
|
|
|
|
|
|
|
|
if (dijit.byId("profileEditDlg"))
|
|
|
|
|
dijit.byId("profileEditDlg").destroyRecursive();
|
|
|
|
|
|
|
|
|
|
const query = "backend.php?op=pref-prefs&method=editPrefProfiles";
|
|
|
|
|
|
|
|
|
|
const dialog = new dijit.Dialog({
|
|
|
|
|
id: "profileEditDlg",
|
|
|
|
|
title: __("Settings Profiles"),
|
|
|
|
|
style: "width: 600px",
|
|
|
|
|
getSelectedProfiles: function () {
|
|
|
|
|
return Tables.getSelected("prefFeedProfileList");
|
|
|
|
|
},
|
|
|
|
|
removeSelected: function () {
|
|
|
|
|
const sel_rows = this.getSelectedProfiles();
|
|
|
|
|
|
|
|
|
|
if (sel_rows.length > 0) {
|
|
|
|
|
if (confirm(__("Remove selected profiles? Active and default profiles will not be removed."))) {
|
|
|
|
|
notify_progress("Removing selected profiles...", true);
|
|
|
|
|
|
|
|
|
|
const query = {
|
|
|
|
|
op: "rpc", method: "remprofiles",
|
|
|
|
|
ids: sel_rows.toString()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", query, () => {
|
|
|
|
|
notify('');
|
|
|
|
|
Prefs.editProfiles();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
alert(__("No profiles are selected."));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
activateProfile: function () {
|
|
|
|
|
const sel_rows = this.getSelectedProfiles();
|
|
|
|
|
|
|
|
|
|
if (sel_rows.length == 1) {
|
|
|
|
|
if (confirm(__("Activate selected profile?"))) {
|
|
|
|
|
notify_progress("Loading, please wait...");
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", {op: "rpc", method: "setprofile", id: sel_rows.toString()}, () => {
|
|
|
|
|
window.location.reload();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
alert(__("Please choose a profile to activate."));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
addProfile: function () {
|
|
|
|
|
if (this.validate()) {
|
|
|
|
|
notify_progress("Creating profile...", true);
|
|
|
|
|
|
|
|
|
|
const query = {op: "rpc", method: "addprofile", title: dialog.attr('value').newprofile};
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", query, () => {
|
|
|
|
|
notify('');
|
|
|
|
|
Prefs.editProfiles();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
execute: function () {
|
|
|
|
|
if (this.validate()) {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
href: query
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
dialog.show();
|
|
|
|
|
},
|
|
|
|
|
customizeCSS: function() {
|
|
|
|
|
const query = "backend.php?op=pref-prefs&method=customizeCSS";
|
|
|
|
|
|
|
|
|
|
if (dijit.byId("cssEditDlg"))
|
|
|
|
|
dijit.byId("cssEditDlg").destroyRecursive();
|
|
|
|
|
|
|
|
|
|
const dialog = new dijit.Dialog({
|
|
|
|
|
id: "cssEditDlg",
|
|
|
|
|
title: __("Customize stylesheet"),
|
|
|
|
|
style: "width: 600px",
|
|
|
|
|
execute: function () {
|
|
|
|
|
notify_progress('Saving data...', true);
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", this.attr('value'), () => {
|
|
|
|
|
window.location.reload();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
href: query
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
dialog.show();
|
|
|
|
|
},
|
|
|
|
|
confirmReset: function() {
|
|
|
|
|
if (confirm(__("Reset to defaults?"))) {
|
|
|
|
|
xhrPost("backend.php", {op: "pref-prefs", method: "resetconfig"}, (transport) => {
|
|
|
|
|
Prefs.refresh();
|
|
|
|
|
notify_info(transport.responseText);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
clearPluginData: function(name) {
|
|
|
|
|
if (confirm(__("Clear stored data for this plugin?"))) {
|
|
|
|
|
notify_progress("Loading, please wait...");
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", {op: "pref-prefs", method: "clearplugindata", name: name}, () => {
|
|
|
|
|
Prefs.refresh();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
refresh: function() {
|
|
|
|
|
xhrPost("backend.php", { op: "pref-prefs" }, (transport) => {
|
|
|
|
|
dijit.byId('genConfigTab').attr('content', transport.responseText);
|
|
|
|
|
notify("");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function notify_callback2(transport, sticky) {
|
|
|
|
|
notify_info(transport.responseText, sticky);
|
|
|
|
|
}
|
|
|
|
@ -143,7 +276,6 @@ function updateFeedList() {
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", { op: "pref-feeds", search: search }, (transport) => {
|
|
|
|
|
dijit.byId('feedConfigTab').attr('content', transport.responseText);
|
|
|
|
|
selectTab("feedConfig", true);
|
|
|
|
|
notify("");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -156,7 +288,6 @@ function updateUsersList(sort_key) {
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", query, (transport) => {
|
|
|
|
|
dijit.byId('userConfigTab').attr('content', transport.responseText);
|
|
|
|
|
selectTab("userConfig", true)
|
|
|
|
|
notify("");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -359,7 +490,6 @@ function opmlImport() {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function updateFilterList() {
|
|
|
|
|
const user_search = $("filter_search");
|
|
|
|
|
let search = "";
|
|
|
|
@ -378,13 +508,6 @@ function updateLabelList() {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updatePrefsList() {
|
|
|
|
|
xhrPost("backend.php", { op: "pref-prefs" }, (transport) => {
|
|
|
|
|
dijit.byId('genConfigTab').attr('content', transport.responseText);
|
|
|
|
|
notify("");
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updateSystemList() {
|
|
|
|
|
xhrPost("backend.php", { op: "pref-system" }, (transport) => {
|
|
|
|
|
dijit.byId('systemConfigTab').attr('content', transport.responseText);
|
|
|
|
@ -392,112 +515,6 @@ function updateSystemList() {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function selectTab(id, selectOnly) {
|
|
|
|
|
if (!selectOnly) {
|
|
|
|
|
notify_progress("Loading, please wait...");
|
|
|
|
|
|
|
|
|
|
switch (id) {
|
|
|
|
|
case "feedConfig":
|
|
|
|
|
updateFeedList();
|
|
|
|
|
break;
|
|
|
|
|
case "filterConfig":
|
|
|
|
|
updateFilterList();
|
|
|
|
|
break;
|
|
|
|
|
case "labelConfig":
|
|
|
|
|
updateLabelList();
|
|
|
|
|
break;
|
|
|
|
|
case "genConfig":
|
|
|
|
|
updatePrefsList();
|
|
|
|
|
break;
|
|
|
|
|
case "userConfig":
|
|
|
|
|
updateUsersList();
|
|
|
|
|
break;
|
|
|
|
|
case "systemConfig":
|
|
|
|
|
updateSystemList();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
console.warn("unknown tab", id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const tab = dijit.byId(id + "Tab");
|
|
|
|
|
dijit.byId("pref-tabs").selectChild(tab);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function validatePrefsReset() {
|
|
|
|
|
if (confirm(__("Reset to defaults?"))) {
|
|
|
|
|
|
|
|
|
|
const query = "?op=pref-prefs&method=resetconfig";
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", { op: "pref-prefs", method: "resetconfig" }, (transport) => {
|
|
|
|
|
updatePrefsList();
|
|
|
|
|
notify_info(transport.responseText);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function removeCategory(id, item) {
|
|
|
|
|
|
|
|
|
|
if (confirm(__("Remove category %s? Any nested feeds would be placed into Uncategorized.").replace("%s", item.name))) {
|
|
|
|
|
notify_progress("Removing category...");
|
|
|
|
|
|
|
|
|
|
const query = { op: "pref-feeds", method: "removeCat",
|
|
|
|
|
ids: id };
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", query, () => {
|
|
|
|
|
notify('');
|
|
|
|
|
updateFeedList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function showInactiveFeeds() {
|
|
|
|
|
const query = "backend.php?op=pref-feeds&method=inactiveFeeds";
|
|
|
|
|
|
|
|
|
|
if (dijit.byId("inactiveFeedsDlg"))
|
|
|
|
|
dijit.byId("inactiveFeedsDlg").destroyRecursive();
|
|
|
|
|
|
|
|
|
|
const dialog = new dijit.Dialog({
|
|
|
|
|
id: "inactiveFeedsDlg",
|
|
|
|
|
title: __("Feeds without recent updates"),
|
|
|
|
|
style: "width: 600px",
|
|
|
|
|
getSelectedFeeds: function () {
|
|
|
|
|
return Tables.getSelected("prefInactiveFeedList");
|
|
|
|
|
},
|
|
|
|
|
removeSelected: function () {
|
|
|
|
|
const sel_rows = this.getSelectedFeeds();
|
|
|
|
|
|
|
|
|
|
if (sel_rows.length > 0) {
|
|
|
|
|
if (confirm(__("Remove selected feeds?"))) {
|
|
|
|
|
notify_progress("Removing selected feeds...", true);
|
|
|
|
|
|
|
|
|
|
const query = { op: "pref-feeds", method: "remove",
|
|
|
|
|
ids: sel_rows.toString() };
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", query, () => {
|
|
|
|
|
notify('');
|
|
|
|
|
dialog.hide();
|
|
|
|
|
updateFeedList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
alert(__("No feeds are selected."));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
execute: function () {
|
|
|
|
|
if (this.validate()) {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
href: query
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
dialog.show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function opmlRegenKey() {
|
|
|
|
|
if (confirm(__("Replace current OPML publishing address with a new one?"))) {
|
|
|
|
|
notify_progress("Trying to change address...", true);
|
|
|
|
@ -524,79 +541,6 @@ function opmlRegenKey() {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function editProfiles() {
|
|
|
|
|
|
|
|
|
|
if (dijit.byId("profileEditDlg"))
|
|
|
|
|
dijit.byId("profileEditDlg").destroyRecursive();
|
|
|
|
|
|
|
|
|
|
const query = "backend.php?op=pref-prefs&method=editPrefProfiles";
|
|
|
|
|
|
|
|
|
|
const dialog = new dijit.Dialog({
|
|
|
|
|
id: "profileEditDlg",
|
|
|
|
|
title: __("Settings Profiles"),
|
|
|
|
|
style: "width: 600px",
|
|
|
|
|
getSelectedProfiles: function () {
|
|
|
|
|
return Tables.getSelected("prefFeedProfileList");
|
|
|
|
|
},
|
|
|
|
|
removeSelected: function () {
|
|
|
|
|
const sel_rows = this.getSelectedProfiles();
|
|
|
|
|
|
|
|
|
|
if (sel_rows.length > 0) {
|
|
|
|
|
if (confirm(__("Remove selected profiles? Active and default profiles will not be removed."))) {
|
|
|
|
|
notify_progress("Removing selected profiles...", true);
|
|
|
|
|
|
|
|
|
|
const query = { op: "rpc", method: "remprofiles",
|
|
|
|
|
ids: sel_rows.toString() };
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", query, () => {
|
|
|
|
|
notify('');
|
|
|
|
|
editProfiles();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
alert(__("No profiles are selected."));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
activateProfile: function () {
|
|
|
|
|
const sel_rows = this.getSelectedProfiles();
|
|
|
|
|
|
|
|
|
|
if (sel_rows.length == 1) {
|
|
|
|
|
if (confirm(__("Activate selected profile?"))) {
|
|
|
|
|
notify_progress("Loading, please wait...");
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", { op: "rpc", method: "setprofile", id: sel_rows.toString() }, () => {
|
|
|
|
|
window.location.reload();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
alert(__("Please choose a profile to activate."));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
addProfile: function () {
|
|
|
|
|
if (this.validate()) {
|
|
|
|
|
notify_progress("Creating profile...", true);
|
|
|
|
|
|
|
|
|
|
const query = { op: "rpc", method: "addprofile", title: dialog.attr('value').newprofile };
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", query, () => {
|
|
|
|
|
notify('');
|
|
|
|
|
editProfiles();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
execute: function () {
|
|
|
|
|
if (this.validate()) {
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
href: query
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
dialog.show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function clearFeedAccessKeys() {
|
|
|
|
|
|
|
|
|
|
if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) {
|
|
|
|
@ -610,72 +554,7 @@ function clearFeedAccessKeys() {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function editCat(id, item) {
|
|
|
|
|
const new_name = prompt(__('Rename category to:'), item.name);
|
|
|
|
|
|
|
|
|
|
if (new_name && new_name != item.name) {
|
|
|
|
|
|
|
|
|
|
notify_progress("Loading, please wait...");
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", { op: 'pref-feeds', method: 'renamecat', id: id, title: new_name }, () => {
|
|
|
|
|
updateFeedList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function customizeCSS() {
|
|
|
|
|
const query = "backend.php?op=pref-prefs&method=customizeCSS";
|
|
|
|
|
|
|
|
|
|
if (dijit.byId("cssEditDlg"))
|
|
|
|
|
dijit.byId("cssEditDlg").destroyRecursive();
|
|
|
|
|
|
|
|
|
|
const dialog = new dijit.Dialog({
|
|
|
|
|
id: "cssEditDlg",
|
|
|
|
|
title: __("Customize stylesheet"),
|
|
|
|
|
style: "width: 600px",
|
|
|
|
|
execute: function () {
|
|
|
|
|
notify_progress('Saving data...', true);
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", this.attr('value'), () => {
|
|
|
|
|
window.location.reload();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
href: query
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
dialog.show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function insertSSLserial(value) {
|
|
|
|
|
dijit.byId("SSL_CERT_SERIAL").attr('value', value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function gotoExportOpml(filename, settings) {
|
|
|
|
|
const tmp = settings ? 1 : 0;
|
|
|
|
|
document.location.href = "backend.php?op=opml&method=export&filename=" + filename + "&settings=" + tmp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function clearPluginData(name) {
|
|
|
|
|
if (confirm(__("Clear stored data for this plugin?"))) {
|
|
|
|
|
notify_progress("Loading, please wait...");
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", { op: "pref-prefs", method: "clearplugindata", name: name }, () => {
|
|
|
|
|
notify('');
|
|
|
|
|
updatePrefsList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function clearSqlLog() {
|
|
|
|
|
|
|
|
|
|
if (confirm(__("Clear all messages in the error log?"))) {
|
|
|
|
|
|
|
|
|
|
notify_progress("Loading, please wait...");
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", { op: "pref-system", method: "clearLog" }, () => {
|
|
|
|
|
updateSystemList();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|