|
|
@ -69,23 +69,23 @@ const Feeds = {
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*if (getFeedUnread(id, (kind == "cat")) != ctr ||
|
|
|
|
/*if (Feeds.getFeedUnread(id, (kind == "cat")) != ctr ||
|
|
|
|
(kind == "cat")) {
|
|
|
|
(kind == "cat")) {
|
|
|
|
}*/
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
setFeedUnread(id, (kind == "cat"), ctr);
|
|
|
|
Feeds.setFeedUnread(id, (kind == "cat"), ctr);
|
|
|
|
setFeedValue(id, (kind == "cat"), 'auxcounter', auxctr);
|
|
|
|
Feeds.setFeedValue(id, (kind == "cat"), 'auxcounter', auxctr);
|
|
|
|
|
|
|
|
|
|
|
|
if (kind != "cat") {
|
|
|
|
if (kind != "cat") {
|
|
|
|
setFeedValue(id, false, 'error', error);
|
|
|
|
Feeds.setFeedValue(id, false, 'error', error);
|
|
|
|
setFeedValue(id, false, 'updated', updated);
|
|
|
|
Feeds.setFeedValue(id, false, 'updated', updated);
|
|
|
|
|
|
|
|
|
|
|
|
if (id > 0) {
|
|
|
|
if (id > 0) {
|
|
|
|
if (has_img) {
|
|
|
|
if (has_img) {
|
|
|
|
setFeedIcon(id, false,
|
|
|
|
Feeds.setFeedIcon(id, false,
|
|
|
|
getInitParam("icons_url") + "/" + id + ".ico?" + has_img);
|
|
|
|
getInitParam("icons_url") + "/" + id + ".ico?" + has_img);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
setFeedIcon(id, false, 'images/blank_icon.gif');
|
|
|
|
Feeds.setFeedIcon(id, false, 'images/blank_icon.gif');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -104,7 +104,7 @@ const Feeds = {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
openNextUnreadFeed: function() {
|
|
|
|
openNextUnreadFeed: function() {
|
|
|
|
const is_cat = Feeds.activeFeedIsCat();
|
|
|
|
const is_cat = Feeds.activeFeedIsCat();
|
|
|
|
const nuf = getNextUnreadFeed(Feeds.getActiveFeedId(), is_cat);
|
|
|
|
const nuf = Feeds.getNextUnreadFeed(Feeds.getActiveFeedId(), is_cat);
|
|
|
|
if (nuf) this.viewfeed({feed: nuf, is_cat: is_cat});
|
|
|
|
if (nuf) this.viewfeed({feed: nuf, is_cat: is_cat});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
collapseFeedlist: function() {
|
|
|
|
collapseFeedlist: function() {
|
|
|
@ -129,13 +129,13 @@ const Feeds = {
|
|
|
|
|
|
|
|
|
|
|
|
counters_last_request = timestamp;
|
|
|
|
counters_last_request = timestamp;
|
|
|
|
|
|
|
|
|
|
|
|
let query = {op: "rpc", method: "getAllCounters", seq: App.next_seq()};
|
|
|
|
let query = {op: "rpc", method: "getAllCounters", seq: Utils.next_seq()};
|
|
|
|
|
|
|
|
|
|
|
|
if (!force)
|
|
|
|
if (!force)
|
|
|
|
query.last_article_id = getInitParam("last_article_id");
|
|
|
|
query.last_article_id = getInitParam("last_article_id");
|
|
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", query, (transport) => {
|
|
|
|
xhrPost("backend.php", query, (transport) => {
|
|
|
|
App.handleRpcJson(transport);
|
|
|
|
Utils.handleRpcJson(transport);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -357,7 +357,7 @@ const Feeds = {
|
|
|
|
Form.enable("main_toolbar_form");
|
|
|
|
Form.enable("main_toolbar_form");
|
|
|
|
|
|
|
|
|
|
|
|
if (!delayed)
|
|
|
|
if (!delayed)
|
|
|
|
if (!setFeedExpandoIcon(feed, is_cat,
|
|
|
|
if (!Feeds.setFeedExpandoIcon(feed, is_cat,
|
|
|
|
(is_cat) ? 'images/indicator_tiny.gif' : 'images/indicator_white.gif'))
|
|
|
|
(is_cat) ? 'images/indicator_tiny.gif' : 'images/indicator_white.gif'))
|
|
|
|
notify_progress("Loading, please wait...", true);
|
|
|
|
notify_progress("Loading, please wait...", true);
|
|
|
|
|
|
|
|
|
|
|
@ -377,7 +377,7 @@ const Feeds = {
|
|
|
|
catchupBatchedArticles(() => {
|
|
|
|
catchupBatchedArticles(() => {
|
|
|
|
xhrPost("backend.php", query, (transport) => {
|
|
|
|
xhrPost("backend.php", query, (transport) => {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
setFeedExpandoIcon(feed, is_cat, 'images/blank_icon.gif');
|
|
|
|
Feeds.setFeedExpandoIcon(feed, is_cat, 'images/blank_icon.gif');
|
|
|
|
Headlines.onLoaded(transport, offset);
|
|
|
|
Headlines.onLoaded(transport, offset);
|
|
|
|
PluginHost.run(PluginHost.HOOK_FEED_LOADED, [feed, is_cat]);
|
|
|
|
PluginHost.run(PluginHost.HOOK_FEED_LOADED, [feed, is_cat]);
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
@ -404,221 +404,207 @@ const Feeds = {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
decrementFeedCounter: function(feed, is_cat) {
|
|
|
|
decrementFeedCounter: function(feed, is_cat) {
|
|
|
|
let ctr = getFeedUnread(feed, is_cat);
|
|
|
|
let ctr = Feeds.getFeedUnread(feed, is_cat);
|
|
|
|
|
|
|
|
|
|
|
|
if (ctr > 0) {
|
|
|
|
if (ctr > 0) {
|
|
|
|
setFeedUnread(feed, is_cat, ctr - 1);
|
|
|
|
Feeds.setFeedUnread(feed, is_cat, ctr - 1);
|
|
|
|
App.global_unread -= 1;
|
|
|
|
App.global_unread -= 1;
|
|
|
|
App.updateTitle();
|
|
|
|
App.updateTitle();
|
|
|
|
|
|
|
|
|
|
|
|
if (!is_cat) {
|
|
|
|
if (!is_cat) {
|
|
|
|
const cat = parseInt(getFeedCategory(feed));
|
|
|
|
const cat = parseInt(Feeds.getFeedCategory(feed));
|
|
|
|
|
|
|
|
|
|
|
|
if (!isNaN(cat)) {
|
|
|
|
if (!isNaN(cat)) {
|
|
|
|
ctr = getFeedUnread(cat, true);
|
|
|
|
ctr = Feeds.getFeedUnread(cat, true);
|
|
|
|
|
|
|
|
|
|
|
|
if (ctr > 0) {
|
|
|
|
if (ctr > 0) {
|
|
|
|
setFeedUnread(cat, true, ctr - 1);
|
|
|
|
Feeds.setFeedUnread(cat, true, ctr - 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
};
|
|
|
|
catchupFeed: function(feed, is_cat, mode) {
|
|
|
|
|
|
|
|
if (is_cat == undefined) is_cat = false;
|
|
|
|
function getFeedUnread(feed, is_cat) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
let str = false;
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
|
|
|
|
|
|
|
|
switch (mode) {
|
|
|
|
if (tree && tree.model)
|
|
|
|
case "1day":
|
|
|
|
return tree.model.getFeedUnread(feed, is_cat);
|
|
|
|
str = __("Mark %w in %s older than 1 day as read?");
|
|
|
|
|
|
|
|
break;
|
|
|
|
} catch (e) {
|
|
|
|
case "1week":
|
|
|
|
//
|
|
|
|
str = __("Mark %w in %s older than 1 week as read?");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "2week":
|
|
|
|
return -1;
|
|
|
|
str = __("Mark %w in %s older than 2 weeks as read?");
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
function getFeedCategory(feed) {
|
|
|
|
str = __("Mark %w in %s as read?");
|
|
|
|
try {
|
|
|
|
}
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tree && tree.model)
|
|
|
|
|
|
|
|
return tree.getFeedCategory(feed);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getFeedName(feed, is_cat) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isNaN(feed)) return feed; // it's a tag
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tree && tree.model)
|
|
|
|
|
|
|
|
return tree.model.getFeedValue(feed, is_cat, 'name');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* function getFeedValue(feed, is_cat, key) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tree && tree.model)
|
|
|
|
|
|
|
|
return tree.model.getFeedValue(feed, is_cat, key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
const mark_what = last_search_query && last_search_query[0] ? __("search results") : __("all articles");
|
|
|
|
//
|
|
|
|
const fn = Feeds.getFeedName(feed, is_cat);
|
|
|
|
}
|
|
|
|
|
|
|
|
return '';
|
|
|
|
|
|
|
|
} */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setFeedUnread(feed, is_cat, unread) {
|
|
|
|
str = str.replace("%s", fn)
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
.replace("%w", mark_what);
|
|
|
|
|
|
|
|
|
|
|
|
if (tree && tree.model)
|
|
|
|
if (getInitParam("confirm_feed_catchup") == 1 && !confirm(str)) {
|
|
|
|
return tree.model.setFeedUnread(feed, is_cat, unread);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function setFeedValue(feed, is_cat, key, value) {
|
|
|
|
const catchup_query = {
|
|
|
|
try {
|
|
|
|
op: 'rpc', method: 'catchupFeed', feed_id: feed,
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
is_cat: is_cat, mode: mode, search_query: last_search_query[0],
|
|
|
|
|
|
|
|
search_lang: last_search_query[1]
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (tree && tree.model)
|
|
|
|
notify_progress("Loading, please wait...", true);
|
|
|
|
return tree.model.setFeedValue(feed, is_cat, key, value);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
xhrPost("backend.php", catchup_query, (transport) => {
|
|
|
|
//
|
|
|
|
Utils.handleRpcJson(transport);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setFeedIcon(feed, is_cat, src) {
|
|
|
|
const show_next_feed = getInitParam("on_catchup_show_next_feed") == "1";
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (tree) return tree.setFeedIcon(feed, is_cat, src);
|
|
|
|
if (show_next_feed) {
|
|
|
|
}
|
|
|
|
const nuf = Feeds.getNextUnreadFeed(feed, is_cat);
|
|
|
|
|
|
|
|
|
|
|
|
function setFeedExpandoIcon(feed, is_cat, src) {
|
|
|
|
if (nuf) {
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
this.viewfeed({feed: nuf, is_cat: is_cat});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (feed == Feeds.getActiveFeedId() && is_cat == Feeds.activeFeedIsCat()) {
|
|
|
|
|
|
|
|
this.viewCurrentFeed();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (tree) return tree.setFeedExpandoIcon(feed, is_cat, src);
|
|
|
|
notify("");
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
catchupCurrentFeed: function(mode) {
|
|
|
|
|
|
|
|
Feeds.catchupFeed(Feeds.getActiveFeedId(), Feeds.activeFeedIsCat(), mode);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
catchupFeedInGroup: function(id) {
|
|
|
|
|
|
|
|
const title = Feeds.getFeedName(id);
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
const str = __("Mark all articles in %s as read?").replace("%s", title);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getNextUnreadFeed(feed, is_cat) {
|
|
|
|
if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
|
|
|
|
const nuf = tree.model.getNextUnreadFeed(feed, is_cat);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (nuf)
|
|
|
|
const rows = $$("#headlines-frame > div[id*=RROW][data-orig-feed-id='" + id + "']");
|
|
|
|
return tree.model.store.getValue(nuf, 'bare_id');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function catchupCurrentFeed(mode) {
|
|
|
|
if (rows.length > 0) {
|
|
|
|
catchupFeed(Feeds.getActiveFeedId(), Feeds.activeFeedIsCat(), mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function catchupFeedInGroup(id) {
|
|
|
|
rows.each(function (row) {
|
|
|
|
const title = getFeedName(id);
|
|
|
|
row.removeClassName("Unread");
|
|
|
|
|
|
|
|
|
|
|
|
const str = __("Mark all articles in %s as read?").replace("%s", title);
|
|
|
|
if (row.getAttribute("data-article-id") != getActiveArticleId()) {
|
|
|
|
|
|
|
|
new Effect.Fade(row, {duration: 0.5});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const rows = $$("#headlines-frame > div[id*=RROW][data-orig-feed-id='"+id+"']");
|
|
|
|
const feedTitles = $$("#headlines-frame > div[class='feed-title']");
|
|
|
|
|
|
|
|
|
|
|
|
if (rows.length > 0) {
|
|
|
|
for (let i = 0; i < feedTitles.length; i++) {
|
|
|
|
|
|
|
|
if (feedTitles[i].getAttribute("data-feed-id") == id) {
|
|
|
|
|
|
|
|
|
|
|
|
rows.each(function (row) {
|
|
|
|
if (i < feedTitles.length - 1) {
|
|
|
|
row.removeClassName("Unread");
|
|
|
|
new Effect.Fade(feedTitles[i], {duration: 0.5});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (row.getAttribute("data-article-id") != getActiveArticleId()) {
|
|
|
|
break;
|
|
|
|
new Effect.Fade(row, {duration: 0.5});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
Headlines.updateFloatingTitle(true);
|
|
|
|
|
|
|
|
}
|
|
|
|
const feedTitles = $$("#headlines-frame > div[class='feed-title']");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < feedTitles.length; i++) {
|
|
|
|
notify_progress("Loading, please wait...", true);
|
|
|
|
if (feedTitles[i].getAttribute("data-feed-id") == id) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (i < feedTitles.length - 1) {
|
|
|
|
xhrPost("backend.php", {op: "rpc", method: "catchupFeed", feed_id: id, is_cat: false}, (transport) => {
|
|
|
|
new Effect.Fade(feedTitles[i], {duration: 0.5});
|
|
|
|
Utils.handleRpcJson(transport);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
getFeedUnread: function(feed, is_cat) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
if (tree && tree.model)
|
|
|
|
}
|
|
|
|
return tree.model.getFeedUnread(feed, is_cat);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Headlines.updateFloatingTitle(true);
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
//
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
notify_progress("Loading, please wait...", true);
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
getFeedCategory: function(feed) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", { op: "rpc", method: "catchupFeed", feed_id: id, is_cat: false}, (transport) => {
|
|
|
|
if (tree && tree.model)
|
|
|
|
App.handleRpcJson(transport);
|
|
|
|
return tree.getFeedCategory(feed);
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function catchupFeed(feed, is_cat, mode) {
|
|
|
|
|
|
|
|
if (is_cat == undefined) is_cat = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let str = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (mode) {
|
|
|
|
|
|
|
|
case "1day":
|
|
|
|
|
|
|
|
str = __("Mark %w in %s older than 1 day as read?");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "1week":
|
|
|
|
|
|
|
|
str = __("Mark %w in %s older than 1 week as read?");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "2week":
|
|
|
|
|
|
|
|
str = __("Mark %w in %s older than 2 weeks as read?");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
str = __("Mark %w in %s as read?");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const mark_what = last_search_query && last_search_query[0] ? __("search results") : __("all articles");
|
|
|
|
} catch (e) {
|
|
|
|
const fn = getFeedName(feed, is_cat);
|
|
|
|
//
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
str = str.replace("%s", fn)
|
|
|
|
return false;
|
|
|
|
.replace("%w", mark_what);
|
|
|
|
},
|
|
|
|
|
|
|
|
getFeedName: function(feed, is_cat) {
|
|
|
|
|
|
|
|
if (isNaN(feed)) return feed; // it's a tag
|
|
|
|
|
|
|
|
|
|
|
|
if (getInitParam("confirm_feed_catchup") == 1 && !confirm(str)) {
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const catchup_query = {op: 'rpc', method: 'catchupFeed', feed_id: feed,
|
|
|
|
if (tree && tree.model)
|
|
|
|
is_cat: is_cat, mode: mode, search_query: last_search_query[0],
|
|
|
|
return tree.model.getFeedValue(feed, is_cat, 'name');
|
|
|
|
search_lang: last_search_query[1]};
|
|
|
|
},
|
|
|
|
|
|
|
|
setFeedUnread: function(feed, is_cat, unread) {
|
|
|
|
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
|
|
|
|
|
|
|
|
notify_progress("Loading, please wait...", true);
|
|
|
|
if (tree && tree.model)
|
|
|
|
|
|
|
|
return tree.model.setFeedUnread(feed, is_cat, unread);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
setFeedValue: function(feed, is_cat, key, value) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
|
|
|
|
|
|
|
|
xhrPost("backend.php", catchup_query, (transport) => {
|
|
|
|
if (tree && tree.model)
|
|
|
|
App.handleRpcJson(transport);
|
|
|
|
return tree.model.setFeedValue(feed, is_cat, key, value);
|
|
|
|
|
|
|
|
|
|
|
|
const show_next_feed = getInitParam("on_catchup_show_next_feed") == "1";
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
getFeedValue: function(feed, is_cat, key) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
|
|
|
|
|
|
|
|
if (show_next_feed) {
|
|
|
|
if (tree && tree.model)
|
|
|
|
const nuf = getNextUnreadFeed(feed, is_cat);
|
|
|
|
return tree.model.getFeedValue(feed, is_cat, key);
|
|
|
|
|
|
|
|
|
|
|
|
if (nuf) {
|
|
|
|
} catch (e) {
|
|
|
|
Feeds.viewfeed({feed: nuf, is_cat: is_cat});
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (feed == Feeds.getActiveFeedId() && is_cat == Feeds.activeFeedIsCat()) {
|
|
|
|
|
|
|
|
Feeds.viewCurrentFeed();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return '';
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
setFeedIcon: function(feed, is_cat, src) {
|
|
|
|
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
|
|
|
|
|
|
|
|
notify("");
|
|
|
|
if (tree) return tree.setFeedIcon(feed, is_cat, src);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
}
|
|
|
|
setFeedExpandoIcon: 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) {
|
|
|
|
|
|
|
|
const tree = dijit.byId("feedTree");
|
|
|
|
|
|
|
|
const nuf = tree.model.getNextUnreadFeed(feed, is_cat);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (nuf)
|
|
|
|
|
|
|
|
return tree.model.store.getValue(nuf, 'bare_id');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|