From 865ecc87963dc3b26e66296616eef2a1cc41ac3f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 25 Oct 2023 12:55:09 +0300 Subject: move to psr-4 autoloader --- js/App.js | 28 ++++++++++++++-------------- js/Article.js | 8 ++++---- js/CommonDialogs.js | 24 ++++++++++++------------ js/CommonFilters.js | 16 ++++++++-------- js/FeedTree.js | 4 ++-- js/Feeds.js | 16 ++++++++-------- js/Headlines.js | 20 ++++++++++---------- js/PrefFeedStore.js | 2 +- js/PrefFeedTree.js | 30 +++++++++++++++--------------- js/PrefFilterStore.js | 2 +- js/PrefFilterTree.js | 8 ++++---- js/PrefHelpers.js | 46 +++++++++++++++++++++++----------------------- js/PrefLabelTree.js | 12 ++++++------ js/PrefUsers.js | 14 +++++++------- 14 files changed, 115 insertions(+), 115 deletions(-) (limited to 'js') diff --git a/js/App.js b/js/App.js index 963a032c5..9d3f6a47d 100644 --- a/js/App.js +++ b/js/App.js @@ -153,7 +153,7 @@ const App = { return dijit.getEnclosingWidget(elem.closest('.dijitDialog')); }, getPhArgs(plugin, method, args = {}) { - return {...{op: "pluginhandler", plugin: plugin, method: method}, ...args}; + return {...{op: "PluginHandler", plugin: plugin, method: method}, ...args}; }, label_to_feed_id: function(label) { return this.LABEL_BASE_INDEX - 1 - Math.abs(label); @@ -291,7 +291,7 @@ const App = { setCombinedMode: function(combined) { const value = combined ? "true" : "false"; - xhr.post("backend.php", {op: "rpc", method: "setpref", key: "COMBINED_DISPLAY_MODE", value: value}, () => { + xhr.post("backend.php", {op: "RPC", method: "setpref", key: "COMBINED_DISPLAY_MODE", value: value}, () => { this.setInitParam("combined_display_mode", !this.getInitParam("combined_display_mode")); @@ -306,7 +306,7 @@ const App = { if (App.isCombinedMode()) { const value = expand ? "true" : "false"; - xhr.post("backend.php", {op: "rpc", method: "setpref", key: "CDM_EXPANDED", value: value}, () => { + xhr.post("backend.php", {op: "RPC", method: "setpref", key: "CDM_EXPANDED", value: value}, () => { this.setInitParam("cdm_expanded", !this.getInitParam("cdm_expanded")); Headlines.renderAgain(); }); @@ -440,7 +440,7 @@ const App = { } }, hotkeyHelp: function() { - xhr.post("backend.php", {op: "rpc", method: "hotkeyHelp"}, (reply) => { + xhr.post("backend.php", {op: "RPC", method: "hotkeyHelp"}, (reply) => { const dialog = new fox.SingleUseDialog({ title: __("Keyboard shortcuts"), content: reply, @@ -621,7 +621,7 @@ const App = { try { xhr.post("backend.php", - {op: "rpc", method: "log", + {op: "RPC", method: "log", file: params.filename ? params.filename : error.fileName, line: params.lineno ? params.lineno : error.lineNumber, msg: message, @@ -703,7 +703,7 @@ const App = { this.initHotkeyActions(); const params = { - op: "rpc", + op: "RPC", method: "sanityCheck", clientTzOffset: new Date().getTimezoneOffset() * 60, hasSandbox: "sandbox" in document.createElement("iframe"), @@ -737,7 +737,7 @@ const App = { return errorMsg == ""; }, updateRuntimeInfo: function() { - xhr.json("backend.php", {op: "rpc", method: "getruntimeinfo"}, () => { + xhr.json("backend.php", {op: "RPC", method: "getruntimeinfo"}, () => { // handled by xhr.json() }); }, @@ -858,7 +858,7 @@ const App = { checkForUpdates: function() { console.log('checking for updates...'); - xhr.json("backend.php", {op: 'rpc', method: 'checkforupdates'}) + xhr.json("backend.php", {op: 'RPC', method: 'checkforupdates'}) .then((reply) => { console.log('update reply', reply); @@ -965,7 +965,7 @@ const App = { if (article_id) Article.view(article_id); - xhr.post("backend.php", {op: "rpc", method: "setWidescreen", wide: wide ? 1 : 0}); + xhr.post("backend.php", {op: "RPC", method: "setWidescreen", wide: wide ? 1 : 0}); }, initHotkeyActions: function() { if (this.is_prefs) { @@ -1149,7 +1149,7 @@ const App = { if (!Feeds.activeIsCat() && parseInt(Feeds.getActive()) > 0) { /* global __csrf_token */ - App.postOpenWindow("backend.php", {op: "feeds", method: "updatedebugger", + App.postOpenWindow("backend.php", {op: "Feeds", method: "updatedebugger", feed_id: Feeds.getActive(), csrf_token: __csrf_token}); } else { @@ -1158,7 +1158,7 @@ const App = { }; this.hotkey_actions["feed_debug_viewfeed"] = () => { - App.postOpenWindow("backend.php", {op: "feeds", method: "view", + App.postOpenWindow("backend.php", {op: "Feeds", method: "view", feed: Feeds.getActive(), timestamps: 1, debug: 1, cat: Feeds.activeIsCat(), csrf_token: __csrf_token}); }; @@ -1177,13 +1177,13 @@ const App = { Headlines.reverse(); }; this.hotkey_actions["feed_toggle_grid"] = () => { - xhr.json("backend.php", {op: "rpc", method: "togglepref", key: "CDM_ENABLE_GRID"}, (reply) => { + xhr.json("backend.php", {op: "RPC", method: "togglepref", key: "CDM_ENABLE_GRID"}, (reply) => { App.setInitParam("cdm_enable_grid", reply.value); Headlines.renderAgain(); }) }; this.hotkey_actions["feed_toggle_vgroup"] = () => { - xhr.post("backend.php", {op: "rpc", method: "togglepref", key: "VFEED_GROUP_BY_FEED"}, () => { + xhr.post("backend.php", {op: "RPC", method: "togglepref", key: "VFEED_GROUP_BY_FEED"}, () => { Feeds.reloadCurrent(); }) }; @@ -1274,7 +1274,7 @@ const App = { CommonDialogs.subscribeToFeed(); break; case "qmcDigest": - window.location.href = "backend.php?op=digest"; + window.location.href = "backend.php?op=Digest"; break; case "qmcEditFeed": if (Feeds.activeIsCat()) diff --git a/js/Article.js b/js/Article.js index 5f3a8c2e9..85cee6322 100644 --- a/js/Article.js +++ b/js/Article.js @@ -123,7 +123,7 @@ const Article = { Article.setActive(0); }, displayUrl: function (id) { - const query = {op: "article", method: "getmetadatabyid", id: id}; + const query = {op: "Article", method: "getmetadatabyid", id: id}; xhr.json("backend.php", query, (reply) => { if (reply && reply.link) { @@ -136,7 +136,7 @@ const Article = { openInNewWindow: function (id) { /* global __csrf_token */ App.postOpenWindow("backend.php", - { "op": "article", "method": "redirect", "id": id, "csrf_token": __csrf_token }); + { "op": "Article", "method": "redirect", "id": id, "csrf_token": __csrf_token }); Headlines.toggleUnread(id, 0); }, @@ -395,7 +395,7 @@ const Article = { const tmph = dojo.connect(dialog, 'onShow', function () { dojo.disconnect(tmph); - xhr.json("backend.php", {op: "article", method: "printArticleTags", id: id}, (reply) => { + xhr.json("backend.php", {op: "Article", method: "printArticleTags", id: id}, (reply) => { dijit.getEnclosingWidget(App.byId("tags_str")) .attr('value', reply.tags.join(", ")) @@ -404,7 +404,7 @@ const Article = { App.byId('tags_str').onkeyup = (e) => { const last_tag = e.target.value.split(',').pop().trim(); - xhr.json("backend.php", {op: 'article', method: 'completeTags', search: last_tag}, (data) => { + xhr.json("backend.php", {op: 'Article', method: 'completeTags', search: last_tag}, (data) => { App.byId("tags_choices").innerHTML = `${data.map((tag) => `${tag}` ) .join(', ')}` diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js index a141c29be..e7190e07c 100644 --- a/js/CommonDialogs.js +++ b/js/CommonDialogs.js @@ -28,7 +28,7 @@ const CommonDialogs = { }, subscribeToFeed: function() { xhr.json("backend.php", - {op: "feeds", method: "subscribeToFeed"}, + {op: "Feeds", method: "subscribeToFeed"}, (reply) => { const dialog = new fox.SingleUseDialog({ title: __("Subscribe to feed"), @@ -215,7 +215,7 @@ const CommonDialogs = { }, showFeedsWithErrors: function() { - xhr.json("backend.php", {op: "pref-feeds", method: "feedsWithErrors"}, (reply) => { + xhr.json("backend.php", {op: "Pref_Feeds", method: "feedsWithErrors"}, (reply) => { const dialog = new fox.SingleUseDialog({ id: "errorFeedsDlg", @@ -231,7 +231,7 @@ const CommonDialogs = { Notify.progress("Removing selected feeds...", true); const query = { - op: "pref-feeds", method: "remove", + op: "Pref_Feeds", method: "remove", ids: sel_rows.toString() }; @@ -305,7 +305,7 @@ const CommonDialogs = { if (caption != undefined && caption.trim().length > 0) { - const query = {op: "pref-labels", method: "add", caption: caption.trim()}; + const query = {op: "Pref_Labels", method: "add", caption: caption.trim()}; Notify.progress("Loading, please wait...", true); @@ -325,7 +325,7 @@ const CommonDialogs = { if (typeof title == "undefined" || confirm(msg)) { Notify.progress("Removing feed..."); - const query = {op: "pref-feeds", quiet: 1, method: "remove", ids: feed_id}; + const query = {op: "Pref_Feeds", quiet: 1, method: "remove", ids: feed_id}; xhr.post("backend.php", query, () => { if (App.isPrefs()) { @@ -348,7 +348,7 @@ const CommonDialogs = { if (feed_id <= 0) return alert(__("You can't edit this kind of feed.")); - const query = {op: "pref-feeds", method: "editfeed", id: feed_id}; + const query = {op: "Pref_Feeds", method: "editfeed", id: feed_id}; console.log("editFeed", query); @@ -378,7 +378,7 @@ const CommonDialogs = { const fd = new FormData(); fd.append('icon_file', icon_file) fd.append('feed_id', feed_id); - fd.append('op', 'pref-feeds'); + fd.append('op', 'Pref_Feeds'); fd.append('method', 'uploadIcon'); fd.append('csrf_token', App.getInitParam("csrf_token")); @@ -427,7 +427,7 @@ const CommonDialogs = { if (confirm(__("Remove stored feed icon?"))) { Notify.progress("Removing feed icon...", true); - xhr.post("backend.php", {op: "pref-feeds", method: "removeicon", feed_id: id}, () => { + xhr.post("backend.php", {op: "Pref_Feeds", method: "removeicon", feed_id: id}, () => { Notify.info("Feed icon removed."); if (App.isPrefs()) @@ -470,7 +470,7 @@ const CommonDialogs = { const tmph = dojo.connect(dialog, 'onShow', function () { dojo.disconnect(tmph); - xhr.json("backend.php", {op: "pref-feeds", method: "editfeed", id: feed_id}, (reply) => { + xhr.json("backend.php", {op: "Pref_Feeds", method: "editfeed", id: feed_id}, (reply) => { const feed = reply.feed; const is_readonly = reply.user.access_level == App.UserAccessLevels.ACCESS_LEVEL_READONLY; @@ -493,7 +493,7 @@ const CommonDialogs = {
${App.FormFields.hidden_tag("id", feed_id)} - ${App.FormFields.hidden_tag("op", "pref-feeds")} + ${App.FormFields.hidden_tag("op", "Pref_Feeds")} ${App.FormFields.hidden_tag("method", "editSave")}
@@ -621,7 +621,7 @@ const CommonDialogs = { Notify.progress("Loading, please wait...", true); - xhr.json("backend.php", {op: "pref-feeds", method: "getsharedurl", id: feed, is_cat: is_cat, search: search}, (reply) => { + xhr.json("backend.php", {op: "Pref_Feeds", method: "getsharedurl", id: feed, is_cat: is_cat, search: search}, (reply) => { try { const dialog = new fox.SingleUseDialog({ title: __("Show as feed"), @@ -630,7 +630,7 @@ const CommonDialogs = { Notify.progress("Trying to change address...", true); - const query = {op: "pref-feeds", method: "regenFeedKey", id: feed, is_cat: is_cat}; + const query = {op: "Pref_Feeds", method: "regenFeedKey", id: feed, is_cat: is_cat}; xhr.json("backend.php", query, (reply) => { const new_link = reply.link; diff --git a/js/CommonFilters.js b/js/CommonFilters.js index 1a0ce1606..8be9e2613 100644 --- a/js/CommonFilters.js +++ b/js/CommonFilters.js @@ -115,7 +115,7 @@ const Filters = { insertRule: function(parentNode, replaceNode) { const rule = dojo.formToJson("filter_new_rule_form"); - xhr.post("backend.php", {op: "pref-filters", method: "printrulename", rule: rule}, (reply) => { + xhr.post("backend.php", {op: "Pref_Filters", method: "printrulename", rule: rule}, (reply) => { try { const li = document.createElement('li'); li.addClassName("rule"); @@ -147,7 +147,7 @@ const Filters = { const action = dojo.formToJson(form); - xhr.post("backend.php", { op: "pref-filters", method: "printactionname", action: action }, (reply) => { + xhr.post("backend.php", { op: "Pref_Filters", method: "printactionname", action: action }, (reply) => { try { const li = document.createElement('li'); li.addClassName("action"); @@ -200,7 +200,7 @@ const Filters = { console.log(rule, dialog.filter_info); - xhr.json("backend.php", {op: "pref-filters", method: "editrule", ids: rule.feed_id.join(",")}, function (editrule) { + xhr.json("backend.php", {op: "Pref_Filters", method: "editrule", ids: rule.feed_id.join(",")}, function (editrule) { edit_rule_dialog.attr('content', `
@@ -326,7 +326,7 @@ const Filters = { dijit.byId("filterDlg_actionSelect").attr('value', action.action_id); - /*xhr.post("backend.php", {op: 'pref-filters', method: 'newaction', action: actionStr}, (reply) => { + /*xhr.post("backend.php", {op: 'Pref_Filters', method: 'newaction', action: actionStr}, (reply) => { edit_action_dialog.attr('content', reply); setTimeout(() => { @@ -365,7 +365,7 @@ const Filters = { Notify.progress("Removing filter..."); - const query = {op: "pref-filters", method: "remove", ids: this.attr('value').id}; + const query = {op: "Pref_Filters", method: "remove", ids: this.attr('value').id}; xhr.post("backend.php", query, () => { const tree = dijit.byId("filterTree"); @@ -411,7 +411,7 @@ const Filters = { const tmph = dojo.connect(dialog, 'onShow', function () { dojo.disconnect(tmph); - xhr.json("backend.php", {op: "pref-filters", method: "edit", id: filter_id}, function (filter) { + xhr.json("backend.php", {op: "Pref_Filters", method: "edit", id: filter_id}, function (filter) { dialog.filter_info = filter; @@ -425,7 +425,7 @@ const Filters = { ` - ${App.FormFields.hidden_tag("op", "pref-filters")} + ${App.FormFields.hidden_tag("op", "Pref_Filters")} ${App.FormFields.hidden_tag("id", filter_id)} ${App.FormFields.hidden_tag("method", filter_id ? "editSave" : "add")} ${App.FormFields.hidden_tag("csrf_token", App.getInitParam('csrf_token'))} @@ -541,7 +541,7 @@ const Filters = { dialog.editRule(null, dojo.toJson(rule)); } else { - const query = {op: "article", method: "getmetadatabyid", id: Article.getActive()}; + const query = {op: "Article", method: "getmetadatabyid", id: Article.getActive()}; xhr.json("backend.php", query, (reply) => { let title; diff --git a/js/FeedTree.js b/js/FeedTree.js index 3eaa61263..df026a7bc 100755 --- a/js/FeedTree.js +++ b/js/FeedTree.js @@ -104,7 +104,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dojo/_base/array", "dojo/co menu.addChild(new dijit.MenuItem({ label: __("Open site"), onClick: function() { - App.postOpenWindow("backend.php", {op: "feeds", method: "opensite", + App.postOpenWindow("backend.php", {op: "Feeds", method: "opensite", feed_id: this.getParent().row_id, csrf_token: __csrf_token}); }})); @@ -114,7 +114,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "dojo/_base/array", "dojo/co label: __("Debug feed"), onClick: function() { /* global __csrf_token */ - App.postOpenWindow("backend.php", {op: "feeds", method: "updatedebugger", + App.postOpenWindow("backend.php", {op: "Feeds", method: "updatedebugger", feed_id: this.getParent().row_id, csrf_token: __csrf_token}); }})); } diff --git a/js/Feeds.js b/js/Feeds.js index 7a5678084..a6eecaf81 100644 --- a/js/Feeds.js +++ b/js/Feeds.js @@ -160,7 +160,7 @@ const Feeds = { }, // null = get all data, [] would give empty response for specific type requestCounters: function(feed_ids = null, label_ids = null) { - xhr.json("backend.php", {op: "rpc", + xhr.json("backend.php", {op: "RPC", method: "getAllCounters", "feed_ids[]": feed_ids, "feed_id_count": feed_ids ? feed_ids.length : -1, @@ -179,7 +179,7 @@ const Feeds = { } const store = new dojo.data.ItemFileWriteStore({ - url: "backend.php?op=pref_feeds&method=getfeedtree&mode=2" + url: "backend.php?op=Pref_Feeds&method=getfeedtree&mode=2" }); // noinspection JSUnresolvedFunction @@ -347,7 +347,7 @@ const Feeds = { toggleUnread: function() { const hide = !App.getInitParam("hide_read_feeds"); - xhr.post("backend.php", {op: "rpc", method: "setpref", key: "HIDE_READ_FEEDS", value: hide}, () => { + xhr.post("backend.php", {op: "RPC", method: "setpref", key: "HIDE_READ_FEEDS", value: hide}, () => { this.hideOrShowFeeds(hide); App.setInitParam("hide_read_feeds", hide); }); @@ -386,7 +386,7 @@ const Feeds = { }, 10 * 1000); } - let query = {...{op: "feeds", method: "view", feed: feed}, ...dojo.formToObject("toolbar-main")}; + let query = {...{op: "Feeds", method: "view", feed: feed}, ...dojo.formToObject("toolbar-main")}; if (method) query.m = method; @@ -435,7 +435,7 @@ const Feeds = { Notify.progress("Marking all feeds as read..."); - xhr.json("backend.php", {op: "feeds", method: "catchupAll"}, () => { + xhr.json("backend.php", {op: "Feeds", method: "catchupAll"}, () => { this.reloadCurrent(); }); @@ -473,7 +473,7 @@ const Feeds = { } const catchup_query = { - op: 'rpc', method: 'catchupFeed', feed_id: feed, + op: 'RPC', method: 'catchupFeed', feed_id: feed, is_cat: is_cat, mode: mode, search_query: this.last_search_query[0], search_lang: this.last_search_query[1] }; @@ -612,7 +612,7 @@ const Feeds = { }, search: function() { xhr.json("backend.php", - {op: "feeds", method: "search"}, + {op: "Feeds", method: "search"}, (reply) => { try { const dialog = new fox.SingleUseDialog({ @@ -686,7 +686,7 @@ const Feeds = { updateRandom: function() { console.log("in update_random_feed"); - xhr.json("backend.php", {op: "rpc", method: "updaterandomfeed"}, () => { + xhr.json("backend.php", {op: "RPC", method: "updaterandomfeed"}, () => { // }); }, diff --git a/js/Headlines.js b/js/Headlines.js index 5706377f8..6a439f744 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -160,26 +160,26 @@ const Headlines = { if (ops.tmark.length != 0) promises.push(xhr.post("backend.php", - {op: "rpc", method: "markSelected", "ids[]": ops.tmark, cmode: 2})); + {op: "RPC", method: "markSelected", "ids[]": ops.tmark, cmode: 2})); if (ops.tpub.length != 0) promises.push(xhr.post("backend.php", - {op: "rpc", method: "publishSelected", "ids[]": ops.tpub, cmode: 2})); + {op: "RPC", method: "publishSelected", "ids[]": ops.tpub, cmode: 2})); if (ops.read.length != 0) promises.push(xhr.post("backend.php", - {op: "rpc", method: "catchupSelected", "ids[]": ops.read, cmode: 0})); + {op: "RPC", method: "catchupSelected", "ids[]": ops.read, cmode: 0})); if (ops.unread.length != 0) promises.push(xhr.post("backend.php", - {op: "rpc", method: "catchupSelected", "ids[]": ops.unread, cmode: 1})); + {op: "RPC", method: "catchupSelected", "ids[]": ops.unread, cmode: 1})); const scores = Object.keys(ops.rescore); if (scores.length != 0) { scores.forEach((score) => { promises.push(xhr.post("backend.php", - {op: "article", method: "setScore", "ids[]": ops.rescore[score], score: score})); + {op: "Article", method: "setScore", "ids[]": ops.rescore[score], score: score})); }); } @@ -1132,7 +1132,7 @@ const Headlines = { } const query = { - op: "article", method: "removeFromLabel", + op: "Article", method: "removeFromLabel", ids: ids.toString(), lid: id }; @@ -1149,7 +1149,7 @@ const Headlines = { } const query = { - op: "article", method: "assignToLabel", + op: "Article", method: "assignToLabel", ids: ids.toString(), lid: id }; @@ -1181,7 +1181,7 @@ const Headlines = { return; } - const query = {op: "rpc", method: "delete", ids: rows.toString()}; + const query = {op: "RPC", method: "delete", ids: rows.toString()}; xhr.json("backend.php", query, () => { Feeds.reloadCurrent(); @@ -1586,7 +1586,7 @@ const Headlines = { menu.addChild(new dijit.MenuItem({ label: __("Open site"), onClick: function() { - App.postOpenWindow("backend.php", {op: "feeds", method: "opensite", + App.postOpenWindow("backend.php", {op: "Feeds", method: "opensite", feed_id: this.getParent().currentTarget.getAttribute("data-feed-id"), csrf_token: __csrf_token}); }})); @@ -1596,7 +1596,7 @@ const Headlines = { label: __("Debug feed"), onClick: function() { /* global __csrf_token */ - App.postOpenWindow("backend.php", {op: "feeds", method: "updatedebugger", + App.postOpenWindow("backend.php", {op: "Feeds", method: "updatedebugger", feed_id: this.getParent().currentTarget.getAttribute("data-feed-id"), csrf_token: __csrf_token}); }})); diff --git a/js/PrefFeedStore.js b/js/PrefFeedStore.js index ee983af54..348cbd995 100644 --- a/js/PrefFeedStore.js +++ b/js/PrefFeedStore.js @@ -8,7 +8,7 @@ define(["dojo/_base/declare", "dojo/data/ItemFileWriteStore"], function (declare dojo.xhrPost({ url: "backend.php", - content: {op: "pref-feeds", method: "savefeedorder", + content: {op: "Pref_Feeds", method: "savefeedorder", payload: newFileContentString}, error: saveFailedCallback, load: saveCompleteCallback}); diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js index 85b262b6d..f1729382c 100644 --- a/js/PrefFeedTree.js +++ b/js/PrefFeedTree.js @@ -150,7 +150,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b const searchElem = App.byId("feed_search"); const search = (searchElem) ? searchElem.value : ""; - xhr.post("backend.php", { op: "pref-feeds", search: search }, (reply) => { + xhr.post("backend.php", { op: "Pref_Feeds", search: search }, (reply) => { dijit.byId('feedsTab').attr('content', reply); Notify.close(); }); @@ -185,14 +185,14 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b resetFeedOrder: function() { Notify.progress("Loading, please wait..."); - xhr.post("backend.php", {op: "pref-feeds", method: "feedsortreset"}, () => { + xhr.post("backend.php", {op: "Pref_Feeds", method: "feedsortreset"}, () => { this.reload(); }); }, resetCatOrder: function() { Notify.progress("Loading, please wait..."); - xhr.post("backend.php", {op: "pref-feeds", method: "catsortreset"}, () => { + xhr.post("backend.php", {op: "Pref_Feeds", method: "catsortreset"}, () => { this.reload(); }); }, @@ -200,7 +200,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b if (confirm(__("Remove category %s? Any nested feeds would be placed into Uncategorized.").replace("%s", item.name))) { Notify.progress("Removing category..."); - xhr.post("backend.php", {op: "pref-feeds", method: "removeCat", ids: id}, () => { + xhr.post("backend.php", {op: "Pref_Feeds", method: "removeCat", ids: id}, () => { Notify.close(); this.reload(); }); @@ -215,7 +215,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b Notify.progress("Unsubscribing from selected feeds...", true); const query = { - op: "pref-feeds", method: "remove", + op: "Pref_Feeds", method: "remove", ids: sel_rows.toString() }; @@ -231,14 +231,14 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b return false; }, checkErrorFeeds: function() { - xhr.json("backend.php", {op: "pref-feeds", method: "feedsWithErrors"}, (reply) => { + xhr.json("backend.php", {op: "Pref_Feeds", method: "feedsWithErrors"}, (reply) => { if (reply.length > 0) { Element.show(dijit.byId("pref_feeds_errors_btn").domNode); } }); }, checkInactiveFeeds: function() { - xhr.json("backend.php", {op: "pref-feeds", method: "inactivefeeds"}, (reply) => { + xhr.json("backend.php", {op: "Pref_Feeds", method: "inactivefeeds"}, (reply) => { if (reply.length > 0) { Element.show(dijit.byId("pref_feeds_inactive_btn").domNode); } @@ -264,7 +264,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b Notify.progress("Removing selected categories..."); const query = { - op: "pref-feeds", method: "removeCat", + op: "Pref_Feeds", method: "removeCat", ids: sel_rows.toString() }; @@ -316,7 +316,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b Notify.progress("Loading, please wait..."); - xhr.post("backend.php", {op: "pref-feeds", method: "editfeeds", ids: rows.toString()}, (reply) => { + xhr.post("backend.php", {op: "Pref_Feeds", method: "editfeeds", ids: rows.toString()}, (reply) => { Notify.close(); try { @@ -393,7 +393,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b Notify.progress("Loading, please wait..."); - xhr.post("backend.php", { op: 'pref-feeds', method: 'renamecat', id: id, title: new_name }, () => { + xhr.post("backend.php", { op: 'Pref_Feeds', method: 'renamecat', id: id, title: new_name }, () => { this.reload(); }); } @@ -404,14 +404,14 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b if (title) { Notify.progress("Creating category..."); - xhr.post("backend.php", {op: "pref-feeds", method: "addCat", cat: title}, () => { + xhr.post("backend.php", {op: "Pref_Feeds", method: "addCat", cat: title}, () => { Notify.close(); this.reload(); }); } }, batchSubscribe: function() { - xhr.json("backend.php", {op: 'pref-feeds', method: 'batchSubscribe'}, (reply) => { + xhr.json("backend.php", {op: 'Pref_Feeds', method: 'batchSubscribe'}, (reply) => { const dialog = new fox.SingleUseDialog({ id: "batchSubDlg", title: __("Batch subscribe"), @@ -431,7 +431,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b }, content: ` - ${App.FormFields.hidden_tag("op", "pref-feeds")} + ${App.FormFields.hidden_tag("op", "Pref_Feeds")} ${App.FormFields.hidden_tag("method", "batchaddfeeds")}
@@ -484,7 +484,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b }); }, showInactiveFeeds: function() { - xhr.json("backend.php", {op: 'pref-feeds', method: 'inactivefeeds'}, function (reply) { + xhr.json("backend.php", {op: 'Pref_Feeds', method: 'inactivefeeds'}, function (reply) { const dialog = new fox.SingleUseDialog({ id: "inactiveFeedsDlg", @@ -500,7 +500,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dojo/_b Notify.progress("Removing selected feeds...", true); const query = { - op: "pref-feeds", method: "remove", + op: "Pref_Feeds", method: "remove", ids: sel_rows.toString() }; diff --git a/js/PrefFilterStore.js b/js/PrefFilterStore.js index a41d84129..f1192374a 100644 --- a/js/PrefFilterStore.js +++ b/js/PrefFilterStore.js @@ -9,7 +9,7 @@ define(["dojo/_base/declare", "dojo/data/ItemFileWriteStore"], function (declare dojo.xhrPost({ url: "backend.php", content: { - op: "pref-filters", method: "savefilterorder", + op: "Pref_Filters", method: "savefilterorder", payload: newFileContentString }, error: saveFailedCallback, diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js index 149261abd..eded7e383 100644 --- a/js/PrefFilterTree.js +++ b/js/PrefFilterTree.js @@ -107,7 +107,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio let search = ""; if (user_search) { search = user_search.value; } - xhr.post("backend.php", { op: "pref-filters", search: search }, (reply) => { + xhr.post("backend.php", { op: "Pref_Filters", search: search }, (reply) => { dijit.byId('filtersTab').attr('content', reply); Notify.close(); }); @@ -125,7 +125,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio resetFilterOrder: function() { Notify.progress("Loading, please wait..."); - xhr.post("backend.php", {op: "pref-filters", method: "filtersortreset"}, () => { + xhr.post("backend.php", {op: "Pref_Filters", method: "filtersortreset"}, () => { this.reload(); }); }, @@ -140,7 +140,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio if (confirm(__("Combine selected filters?"))) { Notify.progress("Joining filters..."); - xhr.post("backend.php", {op: "pref-filters", method: "join", ids: rows.toString()}, () => { + xhr.post("backend.php", {op: "Pref_Filters", method: "join", ids: rows.toString()}, () => { this.reload(); }); } @@ -153,7 +153,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio Notify.progress("Removing selected filters..."); const query = { - op: "pref-filters", method: "remove", + op: "Pref_Filters", method: "remove", ids: sel_rows.toString() }; diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js index c0fff66c9..7a4c99340 100644 --- a/js/PrefHelpers.js +++ b/js/PrefHelpers.js @@ -19,7 +19,7 @@ const Helpers = { alert("No passwords selected."); } else if (confirm(__("Remove selected app passwords?"))) { - xhr.post("backend.php", {op: "pref-prefs", method: "deleteAppPasswords", "ids[]": rows}, (reply) => { + xhr.post("backend.php", {op: "Pref_Prefs", method: "deleteAppPasswords", "ids[]": rows}, (reply) => { this.updateContent(reply); Notify.close(); }); @@ -31,7 +31,7 @@ const Helpers = { const title = prompt("Password description:") if (title) { - xhr.post("backend.php", {op: "pref-prefs", method: "generateAppPassword", title: title}, (reply) => { + xhr.post("backend.php", {op: "Pref_Prefs", method: "generateAppPassword", title: title}, (reply) => { this.updateContent(reply); Notify.close(); }); @@ -45,7 +45,7 @@ const Helpers = { if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) { Notify.progress("Clearing URLs..."); - xhr.post("backend.php", {op: "pref-feeds", method: "clearKeys"}, () => { + xhr.post("backend.php", {op: "Pref_Feeds", method: "clearKeys"}, () => { Notify.info("Generated URLs cleared."); }); } @@ -71,7 +71,7 @@ const Helpers = { const tmph = dojo.connect(dialog, 'onShow', function () { dojo.disconnect(tmph); - xhr.json("backend.php", {op: "pref-prefs", method: "previewDigest"}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "previewDigest"}, (reply) => { dialog.domNode.querySelector('.digest-preview').innerHTML = reply[0]; }); }); @@ -91,7 +91,7 @@ const Helpers = { }, update: function() { xhr.post("backend.php", { - op: "pref-system", + op: "Pref_System", severity: dijit.byId("severity").attr('value'), page: Helpers.EventLog.log_page }, (reply) => { @@ -114,7 +114,7 @@ const Helpers = { Notify.progress("Loading, please wait..."); - xhr.post("backend.php", {op: "pref-system", method: "clearLog"}, () => { + xhr.post("backend.php", {op: "Pref_System", method: "clearLog"}, () => { Helpers.EventLog.refresh(); }); } @@ -135,7 +135,7 @@ const Helpers = { const new_title = prompt(__("Name for cloned profile:")); if (new_title) { - xhr.post("backend.php", {op: "pref-prefs", method: "cloneprofile", "new_title": new_title, "old_profile": sel_rows[0]}, () => { + xhr.post("backend.php", {op: "Pref_Prefs", method: "cloneprofile", "new_title": new_title, "old_profile": sel_rows[0]}, () => { Notify.close(); dialog.refresh(); }); @@ -153,7 +153,7 @@ const Helpers = { if (confirm(__("Remove selected profiles? Active and default profiles will not be removed."))) { Notify.progress("Removing selected profiles...", true); - xhr.post("backend.php", {op: "pref-prefs", method: "remprofiles", "ids[]": sel_rows}, () => { + xhr.post("backend.php", {op: "Pref_Prefs", method: "remprofiles", "ids[]": sel_rows}, () => { Notify.close(); dialog.refresh(); }); @@ -167,7 +167,7 @@ const Helpers = { if (this.validate()) { Notify.progress("Creating profile...", true); - const query = {op: "pref-prefs", method: "addprofile", title: dialog.attr('value').newprofile}; + const query = {op: "Pref_Prefs", method: "addprofile", title: dialog.attr('value').newprofile}; xhr.post("backend.php", query, () => { Notify.close(); @@ -177,7 +177,7 @@ const Helpers = { } }, refresh: function() { - xhr.json("backend.php", {op: 'pref-prefs', method: 'getprofiles'}, (reply) => { + xhr.json("backend.php", {op: 'Pref_Prefs', method: 'getprofiles'}, (reply) => { dialog.attr('content', `
@@ -210,7 +210,7 @@ const Helpers = { profile-id='${profile.id}'>${profile.title} @@ -242,7 +242,7 @@ const Helpers = { if (confirm(__("Activate selected profile?"))) { Notify.progress("Loading, please wait..."); - xhr.post("backend.php", {op: "pref-prefs", method: "activateprofile", id: sel_rows.toString()}, () => { + xhr.post("backend.php", {op: "Pref_Prefs", method: "activateprofile", id: sel_rows.toString()}, () => { window.location.reload(); }); } @@ -312,7 +312,7 @@ const Helpers = { const tmph = dojo.connect(dialog, 'onShow', function () { dojo.disconnect(tmph); - xhr.json("backend.php", {op: "pref-prefs", method: "customizeCSS"}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "customizeCSS"}, (reply) => { const editor = dijit.getEnclosingWidget(dialog.domNode.querySelector(".user-css-editor")); @@ -327,14 +327,14 @@ const Helpers = { }, confirmReset: function() { if (confirm(__("Reset to defaults?"))) { - xhr.post("backend.php", {op: "pref-prefs", method: "resetconfig"}, (reply) => { + xhr.post("backend.php", {op: "Pref_Prefs", method: "resetconfig"}, (reply) => { Helpers.Prefs.refresh(); Notify.info(reply); }); } }, refresh: function() { - xhr.post("backend.php", { op: "pref-prefs" }, (reply) => { + xhr.post("backend.php", { op: "Pref_Prefs" }, (reply) => { dijit.byId('prefsTab').attr('content', reply); Notify.close(); }); @@ -360,7 +360,7 @@ const Helpers = { this.render_contents(); }, reload: function() { - xhr.json("backend.php", {op: "pref-prefs", method: "getPluginsList"}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "getPluginsList"}, (reply) => { this._list_of_plugins = reply; this.render_contents(); }, (e) => { @@ -444,7 +444,7 @@ const Helpers = { if (confirm(__("Clear stored data for %s?").replace("%s", name))) { Notify.progress("Loading, please wait..."); - xhr.post("backend.php", {op: "pref-prefs", method: "clearPluginData", name: name}, () => { + xhr.post("backend.php", {op: "Pref_Prefs", method: "clearPluginData", name: name}, () => { Helpers.Prefs.refresh(); }); } @@ -455,7 +455,7 @@ const Helpers = { if (confirm(msg)) { Notify.progress("Loading, please wait..."); - xhr.json("backend.php", {op: "pref-prefs", method: "uninstallPlugin", plugin: plugin}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "uninstallPlugin", plugin: plugin}, (reply) => { if (reply && reply.status == 1) Helpers.Plugins.reload(); else { @@ -504,7 +504,7 @@ const Helpers = { const container = install_dialog.domNode.querySelector(".contents"); - xhr.json("backend.php", {op: "pref-prefs", method: "installPlugin", plugin: plugin}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "installPlugin", plugin: plugin}, (reply) => { if (!reply) { container.innerHTML = `
  • ${__("Operation failed: check event log.")}
  • `; } else { @@ -603,7 +603,7 @@ const Helpers = { const container = dialog.domNode.querySelector(".contents"); container.innerHTML = `
  • ${__("Looking for plugins...")}
  • `; - xhr.json("backend.php", {op: "pref-prefs", method: "getAvailablePlugins"}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "getAvailablePlugins"}, (reply) => { dialog.entries = reply; dialog.render_contents(); }); @@ -656,7 +656,7 @@ const Helpers = { container.innerHTML = `
  • ${__("Updating, please wait...")}
  • `; let enable_update_btn = false; - xhr.json("backend.php", {op: "pref-prefs", method: "updateLocalPlugins", plugins: dialog.plugins_to_update.join(",")}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "updateLocalPlugins", plugins: dialog.plugins_to_update.join(",")}, (reply) => { if (!reply) { container.innerHTML = `
  • ${__("Operation failed: check event log.")}
  • `; @@ -717,7 +717,7 @@ const Helpers = { //container.innerHTML = `
  • ${__("Checking: %s...").replace("%s", name)}
  • `; - xhr.json("backend.php", {op: "pref-prefs", method: "checkForPluginUpdates", name: name}, (reply) => { + xhr.json("backend.php", {op: "Pref_Prefs", method: "checkForPluginUpdates", name: name}, (reply) => { if (!reply) { container.innerHTML += `
  • ${__("%s: Operation failed: check event log.").replace("%s", name)}
  • `; @@ -834,7 +834,7 @@ const Helpers = { }, export: function() { console.log("export"); - window.open("backend.php?op=opml&method=export&" + dojo.formToQuery("opmlExportForm")); + window.open("backend.php?op=OPML&method=export&" + dojo.formToQuery("opmlExportForm")); }, } }; diff --git a/js/PrefLabelTree.js b/js/PrefLabelTree.js index 39e3f8315..582e5a9b9 100644 --- a/js/PrefLabelTree.js +++ b/js/PrefLabelTree.js @@ -55,13 +55,13 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f return rv; }, reload: function() { - xhr.post("backend.php", { op: "pref-labels" }, (reply) => { + xhr.post("backend.php", { op: "Pref_Labels" }, (reply) => { dijit.byId('labelsTab').attr('content', reply); Notify.close(); }); }, editLabel: function(id) { - xhr.json("backend.php", {op: "pref-labels", method: "edit", id: id}, (reply) => { + xhr.json("backend.php", {op: "Pref_Labels", method: "edit", id: id}, (reply) => { const fg_color = reply['fg_color']; const bg_color = reply['bg_color'] ? reply['bg_color'] : '#fff7d5'; @@ -91,7 +91,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f } const query = { - op: "pref-labels", method: "colorset", kind: kind, + op: "Pref_Labels", method: "colorset", kind: kind, ids: id, fg: fg, bg: bg, color: color }; @@ -131,7 +131,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f
    ${App.FormFields.hidden_tag('id', id)} - ${App.FormFields.hidden_tag('op', 'pref-labels')} + ${App.FormFields.hidden_tag('op', 'Pref_Labels')} ${App.FormFields.hidden_tag('method', 'save')} ${App.FormFields.hidden_tag('fg_color', fg_color, {}, 'labelEdit_fgColor')} @@ -189,7 +189,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f if (confirm(__("Reset selected labels to default colors?"))) { const query = { - op: "pref-labels", method: "colorreset", + op: "Pref_Labels", method: "colorreset", ids: labels.toString() }; @@ -210,7 +210,7 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree", "dijit/f Notify.progress("Removing selected labels..."); const query = { - op: "pref-labels", method: "remove", + op: "Pref_Labels", method: "remove", ids: sel_rows.toString() }; diff --git a/js/PrefUsers.js b/js/PrefUsers.js index a6081f35f..e8f4a7489 100644 --- a/js/PrefUsers.js +++ b/js/PrefUsers.js @@ -8,7 +8,7 @@ const Users = { const user_search = App.byId("user_search"); const search = user_search ? user_search.value : ""; - xhr.post("backend.php", { op: "pref-users", sort: sort, search: search }, (reply) => { + xhr.post("backend.php", { op: "Pref_Users", sort: sort, search: search }, (reply) => { dijit.byId('usersTab').attr('content', reply); Notify.close(); resolve(); @@ -21,7 +21,7 @@ const Users = { if (login) { Notify.progress("Adding user..."); - xhr.post("backend.php", {op: "pref-users", method: "add", login: login}, (reply) => { + xhr.post("backend.php", {op: "Pref_Users", method: "add", login: login}, (reply) => { Users.reload().then(() => { Notify.info(reply); }) @@ -30,7 +30,7 @@ const Users = { } }, edit: function(id) { - xhr.json('backend.php', {op: 'pref-users', method: 'edit', id: id}, (reply) => { + xhr.json('backend.php', {op: 'Pref_Users', method: 'edit', id: id}, (reply) => { const user = reply.user; const admin_disabled = (user.id == 1); @@ -53,7 +53,7 @@ const Users = { ${App.FormFields.hidden_tag('id', user.id.toString())} - ${App.FormFields.hidden_tag('op', 'pref-users')} + ${App.FormFields.hidden_tag('op', 'Pref_Users')} ${App.FormFields.hidden_tag('method', 'editSave')}
    @@ -104,7 +104,7 @@ const Users = {