summaryrefslogtreecommitdiff
path: root/js/Feeds.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2021-02-19 13:44:56 +0300
committerAndrew Dolgov <[email protected]>2021-02-19 13:44:56 +0300
commit660a1bbe011fef5f0fa6bb0af43521fed7598cc7 (patch)
treef31ee123db91e479b93a6d086fd78de2ecfae014 /js/Feeds.js
parentbb4e4282f46824308aebc2eaeac29fa29f8687ad (diff)
* switch to xhr.post() almost everywhere
* call App.handlerpcjson() automatically on json request (if possible) * show net/log indicators in prefs
Diffstat (limited to 'js/Feeds.js')
-rw-r--r--js/Feeds.js20
1 files changed, 8 insertions, 12 deletions
diff --git a/js/Feeds.js b/js/Feeds.js
index e9681953e..01d31f3c1 100644
--- a/js/Feeds.js
+++ b/js/Feeds.js
@@ -130,8 +130,8 @@ const Feeds = {
this.reloadCurrent();
},
requestCounters: function() {
- xhrPost("backend.php", {op: "rpc", method: "getAllCounters", seq: App.next_seq()}, (transport) => {
- App.handleRpcJson(transport);
+ xhr.json("backend.php", {op: "rpc", method: "getAllCounters", seq: App.next_seq()}, () => {
+ //
});
},
reload: function() {
@@ -260,7 +260,7 @@ const Feeds = {
// bw_limit disables timeout() so we request initial counters separately
if (App.getInitParam("bw_limit")) {
- this.requestCounters(true);
+ App.requestCounters(true);
} else {
setTimeout(() => {
this.requestCounters(true);
@@ -361,8 +361,6 @@ const Feeds = {
query.m = "ForceUpdate";
}
- //Form.enable("toolbar-main");
-
if (!delayed)
if (!this.setExpando(feed, is_cat,
(is_cat) ? 'images/indicator_tiny.gif' : 'images/indicator_white.gif'))
@@ -374,11 +372,11 @@ const Feeds = {
window.clearTimeout(this._viewfeed_wait_timeout);
this._viewfeed_wait_timeout = window.setTimeout(() => {
- xhrPost("backend.php", query, (transport) => {
+ xhr.json("backend.php", query, (reply) => {
try {
window.clearTimeout(this._infscroll_timeout);
this.setExpando(feed, is_cat, 'images/blank_icon.gif');
- Headlines.onLoaded(transport, offset, append);
+ Headlines.onLoaded(reply, offset, append);
PluginHost.run(PluginHost.HOOK_FEED_LOADED, [feed, is_cat]);
} catch (e) {
App.Error.report(e);
@@ -439,9 +437,7 @@ const Feeds = {
Notify.progress("Loading, please wait...", true);
- xhrPost("backend.php", catchup_query, (transport) => {
- App.handleRpcJson(transport);
-
+ xhr.json("backend.php", catchup_query, () => {
const show_next_feed = App.getInitParam("on_catchup_show_next_feed");
// only select next unread feed if catching up entirely (as opposed to last week etc)
@@ -633,8 +629,8 @@ const Feeds = {
updateRandom: function() {
console.log("in update_random_feed");
- xhrPost("backend.php", {op: "rpc", method: "updaterandomfeed"}, (transport) => {
- App.handleRpcJson(transport, true);
+ xhr.json("backend.php", {op: "rpc", method: "updaterandomfeed"}, () => {
+ //
});
},
};