From 0a18d0b1edb208e5811c419a1119d131b7041173 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 2 Dec 2018 08:57:22 +0300 Subject: Feeds: shorten some method names finally rename "view as rss" --- js/feedlist.js | 122 ++++++++++++++++++++++++++++---------------------------- js/functions.js | 18 ++++----- js/tt-rss.js | 70 ++++++++++++++++---------------- js/viewfeed.js | 40 +++++++++---------- 4 files changed, 125 insertions(+), 125 deletions(-) (limited to 'js') diff --git a/js/feedlist.js b/js/feedlist.js index 400328317..eca068204 100644 --- a/js/feedlist.js +++ b/js/feedlist.js @@ -68,23 +68,23 @@ const Feeds = { continue; } - /*if (this.getFeedUnread(id, (kind == "cat")) != ctr || + /*if (this.getUnread(id, (kind == "cat")) != ctr || (kind == "cat")) { }*/ - this.setFeedUnread(id, (kind == "cat"), ctr); - this.setFeedValue(id, (kind == "cat"), 'auxcounter', auxctr); + this.setUnread(id, (kind == "cat"), ctr); + this.setValue(id, (kind == "cat"), 'auxcounter', auxctr); if (kind != "cat") { - this.setFeedValue(id, false, 'error', error); - this.setFeedValue(id, false, 'updated', updated); + this.setValue(id, false, 'error', error); + this.setValue(id, false, 'updated', updated); if (id > 0) { if (has_img) { - this.setFeedIcon(id, false, + this.setIcon(id, false, getInitParam("icons_url") + "/" + id + ".ico?" + has_img); } else { - this.setFeedIcon(id, false, 'images/blank_icon.gif'); + this.setIcon(id, false, 'images/blank_icon.gif'); } } } @@ -93,20 +93,20 @@ const Feeds = { this.hideOrShowFeeds(getInitParam("hide_read_feeds") == 1); this._counters_prev = elems; }, - viewCurrentFeed: function(method) { - console.log("viewCurrentFeed: " + method); + reloadCurrent: function(method) { + console.log("reloadCurrent: " + method); - if (this.getActiveFeedId() != undefined) { - this.viewfeed({feed: this.getActiveFeedId(), is_cat: this.activeFeedIsCat(), method: method}); + if (this.getActive() != undefined) { + this.open({feed: this.getActive(), is_cat: this.activeIsCat(), method: method}); } return false; // block unneeded form submits }, - openNextUnreadFeed: function() { - const is_cat = this.activeFeedIsCat(); - const nuf = this.getNextUnreadFeed(this.getActiveFeedId(), is_cat); - if (nuf) this.viewfeed({feed: nuf, is_cat: is_cat}); + openNextUnread: function() { + const is_cat = this.activeIsCat(); + const nuf = this.getNextUnread(this.getActive(), is_cat); + if (nuf) this.open({feed: nuf, is_cat: is_cat}); }, - collapseFeedlist: function() { + toggle: function() { Element.toggle("feeds-holder"); const splitter = $("feeds-holder_splitter"); @@ -117,7 +117,7 @@ const Feeds = { }, cancelSearch: function() { this._search_query = ""; - this.viewCurrentFeed(); + this.reloadCurrent(); }, requestCounters: function(force) { const date = new Date(); @@ -173,7 +173,7 @@ const Feeds = { const id = String(item.id); const is_cat = id.match("^CAT:"); const feed = id.substr(id.indexOf(":") + 1); - Feeds.viewfeed({feed: feed, is_cat: is_cat}); + Feeds.open({feed: feed, is_cat: is_cat}); return false; }, openOnClick: false, @@ -214,10 +214,10 @@ const Feeds = { document.onkeydown = () => { App.hotkeyHandler(event) }; window.setInterval(() => { Headlines.catchupBatched() }, 10 * 1000); - if (!this.getActiveFeedId()) { - this.viewfeed({feed: -3}); + if (!this.getActive()) { + this.open({feed: -3}); } else { - this.viewfeed({feed: this.getActiveFeedId(), is_cat: this.activeFeedIsCat()}); + this.open({feed: this.getActive(), is_cat: this.activeIsCat()}); } this.hideOrShowFeeds(getInitParam("hide_read_feeds") == 1); @@ -254,13 +254,13 @@ const Feeds = { }, 250); } }, - activeFeedIsCat: function() { + activeIsCat: function() { return !!this._active_feed_is_cat; }, - getActiveFeedId: function() { + getActive: function() { return this._active_feed_id; }, - setActiveFeedId: function(id, is_cat) { + setActive: function(id, is_cat) { hash_set('f', id); hash_set('c', is_cat ? 1 : 0); @@ -270,16 +270,16 @@ const Feeds = { $("headlines-frame").setAttribute("feed-id", id); $("headlines-frame").setAttribute("is-cat", is_cat ? 1 : 0); - this.selectFeed(id, is_cat); + this.select(id, is_cat); PluginHost.run(PluginHost.HOOK_FEED_SET_ACTIVE, [this._active_feed_id, this._active_feed_is_cat]); }, - selectFeed: function(feed, is_cat) { + select: function(feed, is_cat) { const tree = dijit.byId("feedTree"); if (tree) return tree.selectFeed(feed, is_cat); }, - toggleDispRead: function() { + toggleUnread: function() { const hide = !(getInitParam("hide_read_feeds") == "1"); xhrPost("backend.php", {op: "rpc", method: "setpref", key: "HIDE_READ_FEEDS", value: hide}, () => { @@ -293,7 +293,7 @@ const Feeds = { if (tree) return tree.hideRead(hide, getInitParam("hide_read_shows_special")); }, - viewfeed: function(params) { + open: function(params) { const feed = params.feed; const is_cat = !!params.is_cat || false; const offset = params.offset || 0; @@ -302,7 +302,7 @@ const Feeds = { // this is used to quickly switch between feeds, sets active but xhr is on a timeout const delayed = params.delayed || false; - if (feed != this.getActiveFeedId() || this.activeFeedIsCat() != is_cat) { + if (feed != this.getActive() || this.activeIsCat() != is_cat) { this._search_query = false; Article.setActive(0); } @@ -347,20 +347,20 @@ const Feeds = { if (Headlines.vgroup_last_feed != undefined) { query.vgrlf = Headlines.vgroup_last_feed; } - } else if (!is_cat && feed == this.getActiveFeedId() && !params.method) { + } else if (!is_cat && feed == this.getActive() && !params.method) { query.m = "ForceUpdate"; } Form.enable("main_toolbar_form"); if (!delayed) - if (!this.setFeedExpandoIcon(feed, is_cat, + if (!this.setExpando(feed, is_cat, (is_cat) ? 'images/indicator_tiny.gif' : 'images/indicator_white.gif')) notify_progress("Loading, please wait...", true); query.cat = is_cat; - this.setActiveFeedId(feed, is_cat); + this.setActive(feed, is_cat); if (viewfeed_debug) { window.open("backend.php?" + @@ -375,7 +375,7 @@ const Feeds = { xhrPost("backend.php", query, (transport) => { try { window.clearTimeout(this._infscroll_timeout); - this.setFeedExpandoIcon(feed, is_cat, 'images/blank_icon.gif'); + this.setExpando(feed, is_cat, 'images/blank_icon.gif'); Headlines.onLoaded(transport, offset); PluginHost.run(PluginHost.HOOK_FEED_LOADED, [feed, is_cat]); } catch (e) { @@ -385,7 +385,7 @@ const Feeds = { }); }, delayed ? 250 : 0); }, - catchupAllFeeds: function() { + catchupAll: function() { const str = __("Mark all articles as read?"); if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) { @@ -394,7 +394,7 @@ const Feeds = { xhrPost("backend.php", {op: "feeds", method: "catchupAll"}, () => { this.requestCounters(true); - this.viewCurrentFeed(); + this.reloadCurrent(); }); App.global_unread = 0; @@ -402,21 +402,21 @@ const Feeds = { } }, decrementFeedCounter: function(feed, is_cat) { - let ctr = this.getFeedUnread(feed, is_cat); + let ctr = this.getUnread(feed, is_cat); if (ctr > 0) { - this.setFeedUnread(feed, is_cat, ctr - 1); + this.setUnread(feed, is_cat, ctr - 1); App.global_unread -= 1; App.updateTitle(); if (!is_cat) { - const cat = parseInt(this.getFeedCategory(feed)); + const cat = parseInt(this.getCategory(feed)); if (!isNaN(cat)) { - ctr = this.getFeedUnread(cat, true); + ctr = this.getUnread(cat, true); if (ctr > 0) { - this.setFeedUnread(cat, true, ctr - 1); + this.setUnread(cat, true, ctr - 1); } } } @@ -442,7 +442,7 @@ const Feeds = { } const mark_what = this.last_search_query && this.last_search_query[0] ? __("search results") : __("all articles"); - const fn = this.getFeedName(feed, is_cat); + const fn = this.getName(feed, is_cat); str = str.replace("%s", fn) .replace("%w", mark_what); @@ -465,23 +465,23 @@ const Feeds = { const show_next_feed = getInitParam("on_catchup_show_next_feed") == "1"; if (show_next_feed) { - const nuf = this.getNextUnreadFeed(feed, is_cat); + const nuf = this.getNextUnread(feed, is_cat); if (nuf) { - this.viewfeed({feed: nuf, is_cat: is_cat}); + this.open({feed: nuf, is_cat: is_cat}); } - } else if (feed == this.getActiveFeedId() && is_cat == this.activeFeedIsCat()) { - this.viewCurrentFeed(); + } else if (feed == this.getActive() && is_cat == this.activeIsCat()) { + this.reloadCurrent(); } notify(""); }); }, - catchupCurrentFeed: function(mode) { - this.catchupFeed(this.getActiveFeedId(), this.activeFeedIsCat(), mode); + catchupCurrent: function(mode) { + this.catchupFeed(this.getActive(), this.activeIsCat(), mode); }, catchupFeedInGroup: function(id) { - const title = this.getFeedName(id); + const title = this.getName(id); const str = __("Mark all articles in %s as read?").replace("%s", title); @@ -523,7 +523,7 @@ const Feeds = { }); } }, - getFeedUnread: function(feed, is_cat) { + getUnread: function(feed, is_cat) { try { const tree = dijit.byId("feedTree"); @@ -536,7 +536,7 @@ const Feeds = { return -1; }, - getFeedCategory: function(feed) { + getCategory: function(feed) { try { const tree = dijit.byId("feedTree"); @@ -549,7 +549,7 @@ const Feeds = { return false; }, - getFeedName: function(feed, is_cat) { + getName: function(feed, is_cat) { if (isNaN(feed)) return feed; // it's a tag const tree = dijit.byId("feedTree"); @@ -557,13 +557,13 @@ const Feeds = { if (tree && tree.model) return tree.model.getFeedValue(feed, is_cat, 'name'); }, - setFeedUnread: function(feed, is_cat, unread) { + setUnread: function(feed, is_cat, unread) { const tree = dijit.byId("feedTree"); if (tree && tree.model) return tree.model.setFeedUnread(feed, is_cat, unread); }, - setFeedValue: function(feed, is_cat, key, value) { + setValue: function(feed, is_cat, key, value) { try { const tree = dijit.byId("feedTree"); @@ -574,7 +574,7 @@ const Feeds = { // } }, - getFeedValue: function(feed, is_cat, key) { + getValue: function(feed, is_cat, key) { try { const tree = dijit.byId("feedTree"); @@ -586,19 +586,19 @@ const Feeds = { } return ''; }, - setFeedIcon: function(feed, is_cat, src) { + setIcon: function(feed, is_cat, src) { const tree = dijit.byId("feedTree"); if (tree) return tree.setFeedIcon(feed, is_cat, src); }, - setFeedExpandoIcon: function(feed, is_cat, src) { + setExpando: function(feed, is_cat, src) { const tree = dijit.byId("feedTree"); if (tree) return tree.setFeedExpandoIcon(feed, is_cat, src); return false; }, - getNextUnreadFeed: function(feed, is_cat) { + getNextUnread: function(feed, is_cat) { const tree = dijit.byId("feedTree"); const nuf = tree.model.getNextUnreadFeed(feed, is_cat); @@ -607,7 +607,7 @@ const Feeds = { }, search: function() { const query = "backend.php?op=feeds&method=search¶m=" + - param_escape(Feeds.getActiveFeedId() + ":" + Feeds.activeFeedIsCat()); + param_escape(Feeds.getActive() + ":" + Feeds.activeIsCat()); if (dijit.byId("searchDlg")) dijit.byId("searchDlg").destroyRecursive(); @@ -620,7 +620,7 @@ const Feeds = { if (this.validate()) { Feeds._search_query = this.attr('value'); this.hide(); - Feeds.viewCurrentFeed(); + Feeds.reloadCurrent(); } }, href: query @@ -628,10 +628,10 @@ const Feeds = { dialog.show(); }, - updateRandomFeed: function() { + updateRandom: function() { console.log("in update_random_feed"); - xhrPost("backend.php", {op: "rpc", method: "updateRandomFeed"}, (transport) => { + xhrPost("backend.php", {op: "rpc", method: "updateRandom"}, (transport) => { Utils.handleRpcJson(transport, true); }); }, diff --git a/js/functions.js b/js/functions.js index a3b257979..df7a33831 100755 --- a/js/functions.js +++ b/js/functions.js @@ -699,9 +699,9 @@ const CommonDialogs = { if (App.isPrefs()) { Feeds.reload(); } else { - if (feed_id == Feeds.getActiveFeedId()) + if (feed_id == Feeds.getActive()) setTimeout(() => { - Feeds.viewfeed({feed: -5}) + Feeds.open({feed: -5}) }, 100); @@ -1351,7 +1351,7 @@ const Filters = { if (!App.isPrefs()) { query = { op: "pref-filters", method: "newfilter", - feed: Feeds.getActiveFeedId(), is_cat: Feeds.activeFeedIsCat() + feed: Feeds.getActive(), is_cat: Feeds.activeIsCat() }; } else { query = {op: "pref-filters", method: "newfilter"}; @@ -1445,8 +1445,8 @@ const Filters = { if (selectedText != "") { - const feed_id = Feeds.activeFeedIsCat() ? 'CAT:' + parseInt(Feeds.getActiveFeedId()) : - Feeds.getActiveFeedId(); + const feed_id = Feeds.activeIsCat() ? 'CAT:' + parseInt(Feeds.getActive()) : + Feeds.getActive(); const rule = {reg_exp: selectedText, feed_id: [feed_id], filter_type: 1}; @@ -1463,12 +1463,12 @@ const Filters = { if (reply && reply.title) title = reply.title; - if (title || Feeds.getActiveFeedId() || Feeds.activeFeedIsCat()) { + if (title || Feeds.getActive() || Feeds.activeIsCat()) { - console.log(title + " " + Feeds.getActiveFeedId()); + console.log(title + " " + Feeds.getActive()); - const feed_id = Feeds.activeFeedIsCat() ? 'CAT:' + parseInt(Feeds.getActiveFeedId()) : - Feeds.getActiveFeedId(); + const feed_id = Feeds.activeIsCat() ? 'CAT:' + parseInt(Feeds.getActive()) : + Feeds.getActive(); const rule = {reg_exp: title, feed_id: [feed_id], filter_type: 1}; diff --git a/js/tt-rss.js b/js/tt-rss.js index b787ae17d..b337e0ae5 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -128,7 +128,7 @@ const App = { const hash_feed_is_cat = hash_get('c') == "1"; if (hash_feed_id != undefined) { - Feeds.setActiveFeedId(hash_feed_id, hash_feed_is_cat); + Feeds.setActive(hash_feed_id, hash_feed_is_cat); } Utils.setLoadingProgress(50); @@ -142,7 +142,7 @@ const App = { if (getInitParam("simple_update")) { console.log("scheduling simple feed updater..."); - window.setInterval(() => { Feeds.updateRandomFeed() }, 30 * 1000); + window.setInterval(() => { Feeds.updateRandom() }, 30 * 1000); } console.log("second stage ok"); @@ -167,7 +167,7 @@ const App = { }, onViewModeChanged: function() { ArticleCache.clear(); - return Feeds.viewCurrentFeed(''); + return Feeds.reloadCurrent(''); }, isCombinedMode: function() { return getInitParam("combined_display_mode"); @@ -235,15 +235,15 @@ const App = { initHotkeyActions: function() { this.hotkey_actions["next_feed"] = function () { const rv = dijit.byId("feedTree").getNextFeed( - Feeds.getActiveFeedId(), Feeds.activeFeedIsCat()); + Feeds.getActive(), Feeds.activeIsCat()); - if (rv) Feeds.viewfeed({feed: rv[0], is_cat: rv[1], delayed: true}) + if (rv) Feeds.open({feed: rv[0], is_cat: rv[1], delayed: true}) }; this.hotkey_actions["prev_feed"] = function () { const rv = dijit.byId("feedTree").getPreviousFeed( - Feeds.getActiveFeedId(), Feeds.activeFeedIsCat()); + Feeds.getActive(), Feeds.activeIsCat()); - if (rv) Feeds.viewfeed({feed: rv[0], is_cat: rv[1], delayed: true}) + if (rv) Feeds.open({feed: rv[0], is_cat: rv[1], delayed: true}) }; this.hotkey_actions["next_article"] = function () { Headlines.move('next'); @@ -333,19 +333,19 @@ const App = { Headlines.select('none'); }; this.hotkey_actions["feed_refresh"] = function () { - if (Feeds.getActiveFeedId() != undefined) { - Feeds.viewfeed({feed: Feeds.getActiveFeedId(), is_cat: Feeds.activeFeedIsCat()}); + if (Feeds.getActive() != undefined) { + Feeds.open({feed: Feeds.getActive(), is_cat: Feeds.activeIsCat()}); } }; this.hotkey_actions["feed_unhide_read"] = function () { - Feeds.toggleDispRead(); + Feeds.toggleUnread(); }; this.hotkey_actions["feed_subscribe"] = function () { CommonDialogs.quickAddFeed(); }; this.hotkey_actions["feed_debug_update"] = function () { - if (!Feeds.activeFeedIsCat() && parseInt(Feeds.getActiveFeedId()) > 0) { - window.open("backend.php?op=feeds&method=update_debugger&feed_id=" + Feeds.getActiveFeedId() + + if (!Feeds.activeIsCat() && parseInt(Feeds.getActive()) > 0) { + window.open("backend.php?op=feeds&method=update_debugger&feed_id=" + Feeds.getActive() + "&csrf_token=" + getInitParam("csrf_token")); } else { alert("You can't debug this kind of feed."); @@ -353,18 +353,18 @@ const App = { }; this.hotkey_actions["feed_debug_viewfeed"] = function () { - Feeds.viewfeed({feed: Feeds.getActiveFeedId(), is_cat: Feeds.activeFeedIsCat(), viewfeed_debug: true}); + Feeds.open({feed: Feeds.getActive(), is_cat: Feeds.activeIsCat(), viewfeed_debug: true}); }; this.hotkey_actions["feed_edit"] = function () { - if (Feeds.activeFeedIsCat()) + if (Feeds.activeIsCat()) alert(__("You can't edit this kind of feed.")); else - CommonDialogs.editFeed(Feeds.getActiveFeedId()); + CommonDialogs.editFeed(Feeds.getActive()); }; this.hotkey_actions["feed_catchup"] = function () { - if (Feeds.getActiveFeedId() != undefined) { - Feeds.catchupCurrentFeed(); + if (Feeds.getActive() != undefined) { + Feeds.catchupCurrent(); } }; this.hotkey_actions["feed_reverse"] = function () { @@ -372,28 +372,28 @@ const App = { }; this.hotkey_actions["feed_toggle_vgroup"] = function () { xhrPost("backend.php", {op: "rpc", method: "togglepref", key: "VFEED_GROUP_BY_FEED"}, () => { - Feeds.viewCurrentFeed(); + Feeds.reloadCurrent(); }) }; this.hotkey_actions["catchup_all"] = function () { - Feeds.catchupAllFeeds(); + Feeds.catchupAll(); }; this.hotkey_actions["cat_toggle_collapse"] = function () { - if (Feeds.activeFeedIsCat()) { - dijit.byId("feedTree").collapseCat(Feeds.getActiveFeedId()); + if (Feeds.activeIsCat()) { + dijit.byId("feedTree").collapseCat(Feeds.getActive()); } }; this.hotkey_actions["goto_all"] = function () { - Feeds.viewfeed({feed: -4}); + Feeds.open({feed: -4}); }; this.hotkey_actions["goto_fresh"] = function () { - Feeds.viewfeed({feed: -3}); + Feeds.open({feed: -3}); }; this.hotkey_actions["goto_marked"] = function () { - Feeds.viewfeed({feed: -1}); + Feeds.open({feed: -1}); }; this.hotkey_actions["goto_published"] = function () { - Feeds.viewfeed({feed: -2}); + Feeds.open({feed: -2}); }; this.hotkey_actions["goto_tagcloud"] = function () { Utils.displayDlg(__("Tag cloud"), "printTagCloud"); @@ -427,7 +427,7 @@ const App = { Filters.quickAddFilter(); }; this.hotkey_actions["collapse_sidebar"] = function () { - Feeds.viewCurrentFeed(); + Feeds.reloadCurrent(); }; this.hotkey_actions["toggle_embed_original"] = function () { if (typeof embedOriginalArticle != "undefined") { @@ -463,7 +463,7 @@ const App = { !getInitParam("combined_display_mode")); Article.close(); - Feeds.viewCurrentFeed(); + Feeds.reloadCurrent(); }) }; this.hotkey_actions["toggle_cdm_expanded"] = function () { @@ -473,7 +473,7 @@ const App = { xhrPost("backend.php", {op: "rpc", method: "setpref", key: "CDM_EXPANDED", value: value}, () => { setInitParam("cdm_expanded", !getInitParam("cdm_expanded")); - Feeds.viewCurrentFeed(); + Feeds.reloadCurrent(); }); }; }, @@ -498,35 +498,35 @@ const App = { window.location.href = "backend.php?op=digest"; break; case "qmcEditFeed": - if (Feeds.activeFeedIsCat()) + if (Feeds.activeIsCat()) alert(__("You can't edit this kind of feed.")); else - CommonDialogs.editFeed(Feeds.getActiveFeedId()); + CommonDialogs.editFeed(Feeds.getActive()); break; case "qmcRemoveFeed": - const actid = Feeds.getActiveFeedId(); + const actid = Feeds.getActive(); if (!actid) { alert(__("Please select some feed first.")); return; } - if (Feeds.activeFeedIsCat()) { + if (Feeds.activeIsCat()) { alert(__("You can't unsubscribe from the category.")); return; } - const fn = Feeds.getFeedName(actid); + const fn = Feeds.getName(actid); if (confirm(__("Unsubscribe from %s?").replace("%s", fn))) { CommonDialogs.unsubscribeFeed(actid); } break; case "qmcCatchupAll": - Feeds.catchupAllFeeds(); + Feeds.catchupAll(); break; case "qmcShowOnlyUnread": - Feeds.toggleDispRead(); + Feeds.toggleUnread(); break; case "qmcToggleWidescreen": if (!App.isCombinedMode()) { diff --git a/js/viewfeed.js b/js/viewfeed.js index 0b82c3476..93bc56c9d 100755 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -291,7 +291,7 @@ const Article = { if (row.hasClassName("Unread")) { Headlines.catchupBatched(() => { - Feeds.decrementFeedCounter(Feeds.getActiveFeedId(), Feeds.activeFeedIsCat()); + Feeds.decrementFeedCounter(Feeds.getActive(), Feeds.activeIsCat()); Headlines.toggleUnread(id, 0); Headlines.updateFloatingTitle(true); }); @@ -404,7 +404,7 @@ const Headlines = { const view_mode = document.forms["main_toolbar_form"].view_mode.value; const unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length; const num_all = $$("#headlines-frame > div[id*=RROW]").length; - const num_unread = Feeds.getFeedUnread(Feeds.getActiveFeedId(), Feeds.activeFeedIsCat()); + const num_unread = Feeds.getUnread(Feeds.getActive(), Feeds.activeIsCat()); // TODO implement marked & published @@ -419,14 +419,14 @@ const Headlines = { offset = unread_in_buffer; break; case "adaptive": - if (!(Feeds.getActiveFeedId() == -1 && !Feeds.activeFeedIsCat())) + if (!(Feeds.getActive() == -1 && !Feeds.activeIsCat())) offset = num_unread > 0 ? unread_in_buffer : num_all; break; } console.log("loadMore, offset=", offset); - Feeds.viewfeed({feed: Feeds.getActiveFeedId(), is_cat: Feeds.activeFeedIsCat(), offset: offset}); + Feeds.open({feed: Feeds.getActive(), is_cat: Feeds.activeIsCat(), offset: offset}); }, scrollHandler: function() { try { @@ -497,7 +497,7 @@ const Headlines = { console.log("we seem to be at an end"); if (getInitParam("on_catchup_show_next_feed") == "1") { - Feeds.openNextUnreadFeed(); + Feeds.openNextUnread(); } } } @@ -592,7 +592,7 @@ const Headlines = { feed_id = reply['headlines']['id']; Feeds.last_search_query = reply['headlines']['search_query']; - if (feed_id != -7 && (feed_id != Feeds.getActiveFeedId() || is_cat != Feeds.activeFeedIsCat())) + if (feed_id != -7 && (feed_id != Feeds.getActive() || is_cat != Feeds.activeIsCat())) return; try { @@ -654,7 +654,7 @@ const Headlines = { this.initHeadlinesMenu(); if (Feeds.infscroll_disabled) - hsp.innerHTML = "" + + hsp.innerHTML = "" + __("Click to open next unread feed.") + ""; if (Feeds._search_query) { @@ -663,7 +663,7 @@ const Headlines = { ""; } - } else if (headlines_count > 0 && feed_id == Feeds.getActiveFeedId() && is_cat == Feeds.activeFeedIsCat()) { + } else if (headlines_count > 0 && feed_id == Feeds.getActive() && is_cat == Feeds.activeIsCat()) { const c = dijit.byId("headlines-frame"); //const ids = Headlines.getSelected(); @@ -702,7 +702,7 @@ const Headlines = { this.initHeadlinesMenu(); if (Feeds.infscroll_disabled) { - hsp.innerHTML = "" + + hsp.innerHTML = "" + __("Click to open next unread feed.") + ""; } @@ -716,10 +716,10 @@ const Headlines = { if (hsp) { if (first_id_changed) { - hsp.innerHTML = "" + + hsp.innerHTML = "" + __("New articles found, reload feed to continue.") + ""; } else { - hsp.innerHTML = "" + + hsp.innerHTML = "" + __("Click to open next unread feed.") + ""; } } @@ -753,7 +753,7 @@ const Headlines = { order_by.attr('value', value); - Feeds.viewCurrentFeed(); + Feeds.reloadCurrent(); }, selectionToggleUnread: function(params) { params = params || {}; @@ -1059,10 +1059,10 @@ const Headlines = { return; } - const fn = Feeds.getFeedName(Feeds.getActiveFeedId(), Feeds.activeFeedIsCat()); + const fn = Feeds.getName(Feeds.getActive(), Feeds.activeIsCat()); let str; - if (Feeds.getActiveFeedId() != 0) { + if (Feeds.getActive() != 0) { str = ngettext("Delete %d selected article in %s?", "Delete %d selected articles in %s?", rows.length); } else { str = ngettext("Delete %d selected article?", "Delete %d selected articles?", rows.length); @@ -1079,7 +1079,7 @@ const Headlines = { xhrPost("backend.php", query, (transport) => { Utils.handleRpcJson(transport); - Feeds.viewCurrentFeed(); + Feeds.reloadCurrent(); }); }, getSelected: function() { @@ -1171,11 +1171,11 @@ const Headlines = { return; } - const fn = Feeds.getFeedName(Feeds.getActiveFeedId(), Feeds.activeFeedIsCat()); + const fn = Feeds.getName(Feeds.getActive(), Feeds.activeIsCat()); let str; let op; - if (Feeds.getActiveFeedId() != 0) { + if (Feeds.getActive() != 0) { str = ngettext("Archive %d selected article in %s?", "Archive %d selected articles in %s?", rows.length); op = "archive"; } else { @@ -1200,7 +1200,7 @@ const Headlines = { xhrPost("backend.php", query, (transport) => { Utils.handleRpcJson(transport); - Feeds.viewCurrentFeed(); + Feeds.reloadCurrent(); }); }, catchupSelection: function() { @@ -1211,7 +1211,7 @@ const Headlines = { return; } - const fn = Feeds.getFeedName(Feeds.getActiveFeedId(), Feeds.activeFeedIsCat()); + const fn = Feeds.getName(Feeds.getActive(), Feeds.activeIsCat()); let str = ngettext("Mark %d selected article in %s as read?", "Mark %d selected articles in %s as read?", rows.length); @@ -1222,7 +1222,7 @@ const Headlines = { return; } - Headlines.selectionToggleUnread({callback: Feeds.viewCurrentFeed, no_error: 1}); + Headlines.selectionToggleUnread({callback: Feeds.reloadCurrent, no_error: 1}); }, catchupBatched: function(callback) { console.log("catchupBatched, size=", this.catchup_id_batch.length); -- cgit v1.2.3