Feeds: shorten some method names
finally rename "view as rss"
This commit is contained in:
parent
6e625555c9
commit
0a18d0b1ed
|
@ -877,7 +877,7 @@ class Article extends Handler_Protected {
|
||||||
$tags_str = "";
|
$tags_str = "";
|
||||||
|
|
||||||
for ($i = 0; $i < $maxtags; $i++) {
|
for ($i = 0; $i < $maxtags; $i++) {
|
||||||
$tags_str .= "<a class=\"tag\" href=\"#\" onclick=\"Feeds.viewfeed({feed:'".$tags[$i]."'})\">" . $tags[$i] . "</a>, ";
|
$tags_str .= "<a class=\"tag\" href=\"#\" onclick=\"Feeds.open({feed:'".$tags[$i]."'})\">" . $tags[$i] . "</a>, ";
|
||||||
}
|
}
|
||||||
|
|
||||||
$tags_str = mb_substr($tags_str, 0, mb_strlen($tags_str)-2);
|
$tags_str = mb_substr($tags_str, 0, mb_strlen($tags_str)-2);
|
||||||
|
|
|
@ -139,7 +139,7 @@ class Dlg extends Handler_Protected {
|
||||||
|
|
||||||
$key_escaped = str_replace("'", "\\'", $key);
|
$key_escaped = str_replace("'", "\\'", $key);
|
||||||
|
|
||||||
echo "<a href=\"#\" onclick=\"Feeds.viewfeed({feed:'$key_escaped'}) \" style=\"font-size: " .
|
echo "<a href=\"#\" onclick=\"Feeds.open({feed:'$key_escaped'}) \" style=\"font-size: " .
|
||||||
$size . "px\" title=\"$value articles tagged with " .
|
$size . "px\" title=\"$value articles tagged with " .
|
||||||
$key . '">' . $key . '</a> ';
|
$key . '">' . $key . '</a> ';
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,8 +50,8 @@ class Feeds extends Handler_Protected {
|
||||||
|
|
||||||
$reply .= "<span class='r'>
|
$reply .= "<span class='r'>
|
||||||
<a href=\"#\"
|
<a href=\"#\"
|
||||||
title=\"".__("View as RSS feed")."\"
|
title=\"".__("Show as feed")."\"
|
||||||
onclick=\"Utils.displayDlg('".__("View as RSS")."','generatedFeed', '$feed_id:$is_cat:$rss_link')\">
|
onclick=\"Utils.displayDlg('".__("Show as feed")."','generatedFeed', '$feed_id:$is_cat:$rss_link')\">
|
||||||
<img class=\"noborder\" src=\"images/pub_set.png\"></a>";
|
<img class=\"noborder\" src=\"images/pub_set.png\"></a>";
|
||||||
|
|
||||||
|
|
||||||
|
@ -137,7 +137,8 @@ class Feeds extends Handler_Protected {
|
||||||
|
|
||||||
//$reply .= "<option value=\"catchupPage()\">".__('Mark as read')."</option>";
|
//$reply .= "<option value=\"catchupPage()\">".__('Mark as read')."</option>";
|
||||||
|
|
||||||
$reply .= "<option value=\"Utils.displayDlg('".__("View as RSS")."','generatedFeed', '$feed_id:$is_cat:$rss_link')\">".__('View as RSS')."</option>";
|
$reply .= "<option value=\"Utils.displayDlg('".__("Show as feed")."','generatedFeed', '$feed_id:$is_cat:$rss_link')\">".
|
||||||
|
__('Show as feed')."</option>";
|
||||||
|
|
||||||
$reply .= "</select>";
|
$reply .= "</select>";
|
||||||
|
|
||||||
|
@ -392,7 +393,7 @@ class Feeds extends Handler_Protected {
|
||||||
|
|
||||||
$reply['content'] .= "<div data-feed-id='$feed_id' class='feed-title'>".
|
$reply['content'] .= "<div data-feed-id='$feed_id' class='feed-title'>".
|
||||||
"<div style='float : right'>$feed_icon_img</div>".
|
"<div style='float : right'>$feed_icon_img</div>".
|
||||||
"<a class='title' href=\"#\" onclick=\"Feeds.viewfeed({feed:$feed_id})\">".
|
"<a class='title' href=\"#\" onclick=\"Feeds.open({feed:$feed_id})\">".
|
||||||
$line["feed_title"]."</a>
|
$line["feed_title"]."</a>
|
||||||
$vf_catchup_link</div>";
|
$vf_catchup_link</div>";
|
||||||
|
|
||||||
|
@ -434,7 +435,7 @@ class Feeds extends Handler_Protected {
|
||||||
if (@$line["feed_title"]) {
|
if (@$line["feed_title"]) {
|
||||||
$rgba = @$rgba_cache[$feed_id];
|
$rgba = @$rgba_cache[$feed_id];
|
||||||
|
|
||||||
$reply['content'] .= "<span class=\"feed\"><a style=\"background : rgba($rgba, 0.3)\" href=\"#\" onclick=\"Feeds.viewfeed({feed:$feed_id})\">".
|
$reply['content'] .= "<span class=\"feed\"><a style=\"background : rgba($rgba, 0.3)\" href=\"#\" onclick=\"Feeds.open({feed:$feed_id})\">".
|
||||||
truncate_string($line["feed_title"],30)."</a></span>";
|
truncate_string($line["feed_title"],30)."</a></span>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -451,7 +452,7 @@ class Feeds extends Handler_Protected {
|
||||||
|
|
||||||
if ($line["feed_title"] && !$vfeed_group_enabled) {
|
if ($line["feed_title"] && !$vfeed_group_enabled) {
|
||||||
|
|
||||||
$reply['content'] .= "<span onclick=\"Feeds.viewfeed({feed:$feed_id})\"
|
$reply['content'] .= "<span onclick=\"Feeds.open({feed:$feed_id})\"
|
||||||
style=\"cursor : pointer\"
|
style=\"cursor : pointer\"
|
||||||
title=\"".htmlspecialchars($line['feed_title'])."\">
|
title=\"".htmlspecialchars($line['feed_title'])."\">
|
||||||
$feed_icon_img</span>";
|
$feed_icon_img</span>";
|
||||||
|
@ -488,7 +489,7 @@ class Feeds extends Handler_Protected {
|
||||||
|
|
||||||
$reply['content'] .= "<div data-feed-id='$feed_id' class='feed-title'>".
|
$reply['content'] .= "<div data-feed-id='$feed_id' class='feed-title'>".
|
||||||
"<div style=\"float : right\">$feed_icon_img</div>".
|
"<div style=\"float : right\">$feed_icon_img</div>".
|
||||||
"<a href=\"#\" class='title' onclick=\"Feeds.viewfeed({feed:$feed_id})\">".
|
"<a href=\"#\" class='title' onclick=\"Feeds.open({feed:$feed_id})\">".
|
||||||
$line["feed_title"]."</a> $vf_catchup_link</div>";
|
$line["feed_title"]."</a> $vf_catchup_link</div>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -547,7 +548,7 @@ class Feeds extends Handler_Protected {
|
||||||
|
|
||||||
$tmp_content .= "<div class=\"feed\">
|
$tmp_content .= "<div class=\"feed\">
|
||||||
<a href=\"#\" style=\"background-color: rgba($rgba,0.3)\"
|
<a href=\"#\" style=\"background-color: rgba($rgba,0.3)\"
|
||||||
onclick=\"Feeds.viewfeed({feed:$feed_id})\">".
|
onclick=\"Feeds.open({feed:$feed_id})\">".
|
||||||
truncate_string($line["feed_title"],30)."</a>
|
truncate_string($line["feed_title"],30)."</a>
|
||||||
</div>";
|
</div>";
|
||||||
}
|
}
|
||||||
|
@ -561,7 +562,7 @@ class Feeds extends Handler_Protected {
|
||||||
if (!get_pref("VFEED_GROUP_BY_FEED") && $line["feed_title"]) {
|
if (!get_pref("VFEED_GROUP_BY_FEED") && $line["feed_title"]) {
|
||||||
$tmp_content .= "<span style=\"cursor : pointer\"
|
$tmp_content .= "<span style=\"cursor : pointer\"
|
||||||
title=\"".htmlspecialchars($line["feed_title"])."\"
|
title=\"".htmlspecialchars($line["feed_title"])."\"
|
||||||
onclick=\"Feeds.viewfeed({feed:$feed_id})\">$feed_icon_img</span>";
|
onclick=\"Feeds.open({feed:$feed_id})\">$feed_icon_img</span>";
|
||||||
}
|
}
|
||||||
$tmp_content .= "</div>"; //score wrapper2
|
$tmp_content .= "</div>"; //score wrapper2
|
||||||
|
|
||||||
|
|
|
@ -1323,7 +1323,7 @@ class Pref_Feeds extends Handler_Protected {
|
||||||
|
|
||||||
print "<p>";
|
print "<p>";
|
||||||
|
|
||||||
print "<button dojoType=\"dijit.form.Button\" onclick=\"return Utils.displayDlg('".__("View as RSS")."','generatedFeed', '$rss_url')\">".
|
print "<button dojoType=\"dijit.form.Button\" onclick=\"return Utils.displayDlg('".__("Show as feed")."','generatedFeed', '$rss_url')\">".
|
||||||
__('Display URL')."</button> ";
|
__('Display URL')."</button> ";
|
||||||
|
|
||||||
print "<button class=\"warning\" dojoType=\"dijit.form.Button\" onclick=\"return clearFeedAccessKeys()\">".
|
print "<button class=\"warning\" dojoType=\"dijit.form.Button\" onclick=\"return clearFeedAccessKeys()\">".
|
||||||
|
|
|
@ -207,16 +207,16 @@
|
||||||
<option value="title"><?php echo __('Title') ?></option>
|
<option value="title"><?php echo __('Title') ?></option>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<div dojoType="dijit.form.ComboButton" onclick="Feeds.catchupCurrentFeed()">
|
<div dojoType="dijit.form.ComboButton" onclick="Feeds.catchupCurrent()">
|
||||||
<span><?php echo __('Mark as read') ?></span>
|
<span><?php echo __('Mark as read') ?></span>
|
||||||
<div dojoType="dijit.DropDownMenu">
|
<div dojoType="dijit.DropDownMenu">
|
||||||
<div dojoType="dijit.MenuItem" onclick="Feeds.catchupCurrentFeed('1day')">
|
<div dojoType="dijit.MenuItem" onclick="Feeds.catchupCurrent('1day')">
|
||||||
<?php echo __('Older than one day') ?>
|
<?php echo __('Older than one day') ?>
|
||||||
</div>
|
</div>
|
||||||
<div dojoType="dijit.MenuItem" onclick="Feeds.catchupCurrentFeed('1week')">
|
<div dojoType="dijit.MenuItem" onclick="Feeds.catchupCurrent('1week')">
|
||||||
<?php echo __('Older than one week') ?>
|
<?php echo __('Older than one week') ?>
|
||||||
</div>
|
</div>
|
||||||
<div dojoType="dijit.MenuItem" onclick="Feeds.catchupCurrentFeed('2week')">
|
<div dojoType="dijit.MenuItem" onclick="Feeds.catchupCurrent('2week')">
|
||||||
<?php echo __('Older than two weeks') ?>
|
<?php echo __('Older than two weeks') ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
122
js/feedlist.js
122
js/feedlist.js
|
@ -68,23 +68,23 @@ const Feeds = {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (this.getFeedUnread(id, (kind == "cat")) != ctr ||
|
/*if (this.getUnread(id, (kind == "cat")) != ctr ||
|
||||||
(kind == "cat")) {
|
(kind == "cat")) {
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
this.setFeedUnread(id, (kind == "cat"), ctr);
|
this.setUnread(id, (kind == "cat"), ctr);
|
||||||
this.setFeedValue(id, (kind == "cat"), 'auxcounter', auxctr);
|
this.setValue(id, (kind == "cat"), 'auxcounter', auxctr);
|
||||||
|
|
||||||
if (kind != "cat") {
|
if (kind != "cat") {
|
||||||
this.setFeedValue(id, false, 'error', error);
|
this.setValue(id, false, 'error', error);
|
||||||
this.setFeedValue(id, false, 'updated', updated);
|
this.setValue(id, false, 'updated', updated);
|
||||||
|
|
||||||
if (id > 0) {
|
if (id > 0) {
|
||||||
if (has_img) {
|
if (has_img) {
|
||||||
this.setFeedIcon(id, false,
|
this.setIcon(id, false,
|
||||||
getInitParam("icons_url") + "/" + id + ".ico?" + has_img);
|
getInitParam("icons_url") + "/" + id + ".ico?" + has_img);
|
||||||
} else {
|
} 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.hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
|
||||||
this._counters_prev = elems;
|
this._counters_prev = elems;
|
||||||
},
|
},
|
||||||
viewCurrentFeed: function(method) {
|
reloadCurrent: function(method) {
|
||||||
console.log("viewCurrentFeed: " + method);
|
console.log("reloadCurrent: " + method);
|
||||||
|
|
||||||
if (this.getActiveFeedId() != undefined) {
|
if (this.getActive() != undefined) {
|
||||||
this.viewfeed({feed: this.getActiveFeedId(), is_cat: this.activeFeedIsCat(), method: method});
|
this.open({feed: this.getActive(), is_cat: this.activeIsCat(), method: method});
|
||||||
}
|
}
|
||||||
return false; // block unneeded form submits
|
return false; // block unneeded form submits
|
||||||
},
|
},
|
||||||
openNextUnreadFeed: function() {
|
openNextUnread: function() {
|
||||||
const is_cat = this.activeFeedIsCat();
|
const is_cat = this.activeIsCat();
|
||||||
const nuf = this.getNextUnreadFeed(this.getActiveFeedId(), is_cat);
|
const nuf = this.getNextUnread(this.getActive(), is_cat);
|
||||||
if (nuf) this.viewfeed({feed: nuf, is_cat: is_cat});
|
if (nuf) this.open({feed: nuf, is_cat: is_cat});
|
||||||
},
|
},
|
||||||
collapseFeedlist: function() {
|
toggle: function() {
|
||||||
Element.toggle("feeds-holder");
|
Element.toggle("feeds-holder");
|
||||||
|
|
||||||
const splitter = $("feeds-holder_splitter");
|
const splitter = $("feeds-holder_splitter");
|
||||||
|
@ -117,7 +117,7 @@ const Feeds = {
|
||||||
},
|
},
|
||||||
cancelSearch: function() {
|
cancelSearch: function() {
|
||||||
this._search_query = "";
|
this._search_query = "";
|
||||||
this.viewCurrentFeed();
|
this.reloadCurrent();
|
||||||
},
|
},
|
||||||
requestCounters: function(force) {
|
requestCounters: function(force) {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
|
@ -173,7 +173,7 @@ const Feeds = {
|
||||||
const id = String(item.id);
|
const id = String(item.id);
|
||||||
const is_cat = id.match("^CAT:");
|
const is_cat = id.match("^CAT:");
|
||||||
const feed = id.substr(id.indexOf(":") + 1);
|
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;
|
return false;
|
||||||
},
|
},
|
||||||
openOnClick: false,
|
openOnClick: false,
|
||||||
|
@ -214,10 +214,10 @@ const Feeds = {
|
||||||
document.onkeydown = () => { App.hotkeyHandler(event) };
|
document.onkeydown = () => { App.hotkeyHandler(event) };
|
||||||
window.setInterval(() => { Headlines.catchupBatched() }, 10 * 1000);
|
window.setInterval(() => { Headlines.catchupBatched() }, 10 * 1000);
|
||||||
|
|
||||||
if (!this.getActiveFeedId()) {
|
if (!this.getActive()) {
|
||||||
this.viewfeed({feed: -3});
|
this.open({feed: -3});
|
||||||
} else {
|
} 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);
|
this.hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
|
||||||
|
@ -254,13 +254,13 @@ const Feeds = {
|
||||||
}, 250);
|
}, 250);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
activeFeedIsCat: function() {
|
activeIsCat: function() {
|
||||||
return !!this._active_feed_is_cat;
|
return !!this._active_feed_is_cat;
|
||||||
},
|
},
|
||||||
getActiveFeedId: function() {
|
getActive: function() {
|
||||||
return this._active_feed_id;
|
return this._active_feed_id;
|
||||||
},
|
},
|
||||||
setActiveFeedId: function(id, is_cat) {
|
setActive: function(id, is_cat) {
|
||||||
hash_set('f', id);
|
hash_set('f', id);
|
||||||
hash_set('c', is_cat ? 1 : 0);
|
hash_set('c', is_cat ? 1 : 0);
|
||||||
|
|
||||||
|
@ -270,16 +270,16 @@ const Feeds = {
|
||||||
$("headlines-frame").setAttribute("feed-id", id);
|
$("headlines-frame").setAttribute("feed-id", id);
|
||||||
$("headlines-frame").setAttribute("is-cat", is_cat ? 1 : 0);
|
$("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]);
|
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");
|
const tree = dijit.byId("feedTree");
|
||||||
|
|
||||||
if (tree) return tree.selectFeed(feed, is_cat);
|
if (tree) return tree.selectFeed(feed, is_cat);
|
||||||
},
|
},
|
||||||
toggleDispRead: function() {
|
toggleUnread: function() {
|
||||||
const hide = !(getInitParam("hide_read_feeds") == "1");
|
const hide = !(getInitParam("hide_read_feeds") == "1");
|
||||||
|
|
||||||
xhrPost("backend.php", {op: "rpc", method: "setpref", key: "HIDE_READ_FEEDS", value: hide}, () => {
|
xhrPost("backend.php", {op: "rpc", method: "setpref", key: "HIDE_READ_FEEDS", value: hide}, () => {
|
||||||
|
@ -293,7 +293,7 @@ const Feeds = {
|
||||||
if (tree)
|
if (tree)
|
||||||
return tree.hideRead(hide, getInitParam("hide_read_shows_special"));
|
return tree.hideRead(hide, getInitParam("hide_read_shows_special"));
|
||||||
},
|
},
|
||||||
viewfeed: function(params) {
|
open: function(params) {
|
||||||
const feed = params.feed;
|
const feed = params.feed;
|
||||||
const is_cat = !!params.is_cat || false;
|
const is_cat = !!params.is_cat || false;
|
||||||
const offset = params.offset || 0;
|
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
|
// this is used to quickly switch between feeds, sets active but xhr is on a timeout
|
||||||
const delayed = params.delayed || false;
|
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;
|
this._search_query = false;
|
||||||
Article.setActive(0);
|
Article.setActive(0);
|
||||||
}
|
}
|
||||||
|
@ -347,20 +347,20 @@ const Feeds = {
|
||||||
if (Headlines.vgroup_last_feed != undefined) {
|
if (Headlines.vgroup_last_feed != undefined) {
|
||||||
query.vgrlf = Headlines.vgroup_last_feed;
|
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";
|
query.m = "ForceUpdate";
|
||||||
}
|
}
|
||||||
|
|
||||||
Form.enable("main_toolbar_form");
|
Form.enable("main_toolbar_form");
|
||||||
|
|
||||||
if (!delayed)
|
if (!delayed)
|
||||||
if (!this.setFeedExpandoIcon(feed, is_cat,
|
if (!this.setExpando(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);
|
||||||
|
|
||||||
query.cat = is_cat;
|
query.cat = is_cat;
|
||||||
|
|
||||||
this.setActiveFeedId(feed, is_cat);
|
this.setActive(feed, is_cat);
|
||||||
|
|
||||||
if (viewfeed_debug) {
|
if (viewfeed_debug) {
|
||||||
window.open("backend.php?" +
|
window.open("backend.php?" +
|
||||||
|
@ -375,7 +375,7 @@ const Feeds = {
|
||||||
xhrPost("backend.php", query, (transport) => {
|
xhrPost("backend.php", query, (transport) => {
|
||||||
try {
|
try {
|
||||||
window.clearTimeout(this._infscroll_timeout);
|
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);
|
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) {
|
||||||
|
@ -385,7 +385,7 @@ const Feeds = {
|
||||||
});
|
});
|
||||||
}, delayed ? 250 : 0);
|
}, delayed ? 250 : 0);
|
||||||
},
|
},
|
||||||
catchupAllFeeds: function() {
|
catchupAll: function() {
|
||||||
const str = __("Mark all articles as read?");
|
const str = __("Mark all articles as read?");
|
||||||
|
|
||||||
if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
|
if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
|
||||||
|
@ -394,7 +394,7 @@ const Feeds = {
|
||||||
|
|
||||||
xhrPost("backend.php", {op: "feeds", method: "catchupAll"}, () => {
|
xhrPost("backend.php", {op: "feeds", method: "catchupAll"}, () => {
|
||||||
this.requestCounters(true);
|
this.requestCounters(true);
|
||||||
this.viewCurrentFeed();
|
this.reloadCurrent();
|
||||||
});
|
});
|
||||||
|
|
||||||
App.global_unread = 0;
|
App.global_unread = 0;
|
||||||
|
@ -402,21 +402,21 @@ const Feeds = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
decrementFeedCounter: function(feed, is_cat) {
|
decrementFeedCounter: function(feed, is_cat) {
|
||||||
let ctr = this.getFeedUnread(feed, is_cat);
|
let ctr = this.getUnread(feed, is_cat);
|
||||||
|
|
||||||
if (ctr > 0) {
|
if (ctr > 0) {
|
||||||
this.setFeedUnread(feed, is_cat, ctr - 1);
|
this.setUnread(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(this.getFeedCategory(feed));
|
const cat = parseInt(this.getCategory(feed));
|
||||||
|
|
||||||
if (!isNaN(cat)) {
|
if (!isNaN(cat)) {
|
||||||
ctr = this.getFeedUnread(cat, true);
|
ctr = this.getUnread(cat, true);
|
||||||
|
|
||||||
if (ctr > 0) {
|
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 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)
|
str = str.replace("%s", fn)
|
||||||
.replace("%w", mark_what);
|
.replace("%w", mark_what);
|
||||||
|
@ -465,23 +465,23 @@ const Feeds = {
|
||||||
const show_next_feed = getInitParam("on_catchup_show_next_feed") == "1";
|
const show_next_feed = getInitParam("on_catchup_show_next_feed") == "1";
|
||||||
|
|
||||||
if (show_next_feed) {
|
if (show_next_feed) {
|
||||||
const nuf = this.getNextUnreadFeed(feed, is_cat);
|
const nuf = this.getNextUnread(feed, is_cat);
|
||||||
|
|
||||||
if (nuf) {
|
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()) {
|
} else if (feed == this.getActive() && is_cat == this.activeIsCat()) {
|
||||||
this.viewCurrentFeed();
|
this.reloadCurrent();
|
||||||
}
|
}
|
||||||
|
|
||||||
notify("");
|
notify("");
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
catchupCurrentFeed: function(mode) {
|
catchupCurrent: function(mode) {
|
||||||
this.catchupFeed(this.getActiveFeedId(), this.activeFeedIsCat(), mode);
|
this.catchupFeed(this.getActive(), this.activeIsCat(), mode);
|
||||||
},
|
},
|
||||||
catchupFeedInGroup: function(id) {
|
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);
|
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 {
|
try {
|
||||||
const tree = dijit.byId("feedTree");
|
const tree = dijit.byId("feedTree");
|
||||||
|
|
||||||
|
@ -536,7 +536,7 @@ const Feeds = {
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
},
|
},
|
||||||
getFeedCategory: function(feed) {
|
getCategory: function(feed) {
|
||||||
try {
|
try {
|
||||||
const tree = dijit.byId("feedTree");
|
const tree = dijit.byId("feedTree");
|
||||||
|
|
||||||
|
@ -549,7 +549,7 @@ const Feeds = {
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
getFeedName: function(feed, is_cat) {
|
getName: function(feed, is_cat) {
|
||||||
if (isNaN(feed)) return feed; // it's a tag
|
if (isNaN(feed)) return feed; // it's a tag
|
||||||
|
|
||||||
const tree = dijit.byId("feedTree");
|
const tree = dijit.byId("feedTree");
|
||||||
|
@ -557,13 +557,13 @@ const Feeds = {
|
||||||
if (tree && tree.model)
|
if (tree && tree.model)
|
||||||
return tree.model.getFeedValue(feed, is_cat, 'name');
|
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");
|
const tree = dijit.byId("feedTree");
|
||||||
|
|
||||||
if (tree && tree.model)
|
if (tree && tree.model)
|
||||||
return tree.model.setFeedUnread(feed, is_cat, unread);
|
return tree.model.setFeedUnread(feed, is_cat, unread);
|
||||||
},
|
},
|
||||||
setFeedValue: function(feed, is_cat, key, value) {
|
setValue: function(feed, is_cat, key, value) {
|
||||||
try {
|
try {
|
||||||
const tree = dijit.byId("feedTree");
|
const tree = dijit.byId("feedTree");
|
||||||
|
|
||||||
|
@ -574,7 +574,7 @@ const Feeds = {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
getFeedValue: function(feed, is_cat, key) {
|
getValue: function(feed, is_cat, key) {
|
||||||
try {
|
try {
|
||||||
const tree = dijit.byId("feedTree");
|
const tree = dijit.byId("feedTree");
|
||||||
|
|
||||||
|
@ -586,19 +586,19 @@ const Feeds = {
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
},
|
},
|
||||||
setFeedIcon: function(feed, is_cat, src) {
|
setIcon: function(feed, is_cat, src) {
|
||||||
const tree = dijit.byId("feedTree");
|
const tree = dijit.byId("feedTree");
|
||||||
|
|
||||||
if (tree) return tree.setFeedIcon(feed, is_cat, src);
|
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");
|
const tree = dijit.byId("feedTree");
|
||||||
|
|
||||||
if (tree) return tree.setFeedExpandoIcon(feed, is_cat, src);
|
if (tree) return tree.setFeedExpandoIcon(feed, is_cat, src);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
getNextUnreadFeed: function(feed, is_cat) {
|
getNextUnread: function(feed, is_cat) {
|
||||||
const tree = dijit.byId("feedTree");
|
const tree = dijit.byId("feedTree");
|
||||||
const nuf = tree.model.getNextUnreadFeed(feed, is_cat);
|
const nuf = tree.model.getNextUnreadFeed(feed, is_cat);
|
||||||
|
|
||||||
|
@ -607,7 +607,7 @@ const Feeds = {
|
||||||
},
|
},
|
||||||
search: function() {
|
search: function() {
|
||||||
const query = "backend.php?op=feeds&method=search¶m=" +
|
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"))
|
if (dijit.byId("searchDlg"))
|
||||||
dijit.byId("searchDlg").destroyRecursive();
|
dijit.byId("searchDlg").destroyRecursive();
|
||||||
|
@ -620,7 +620,7 @@ const Feeds = {
|
||||||
if (this.validate()) {
|
if (this.validate()) {
|
||||||
Feeds._search_query = this.attr('value');
|
Feeds._search_query = this.attr('value');
|
||||||
this.hide();
|
this.hide();
|
||||||
Feeds.viewCurrentFeed();
|
Feeds.reloadCurrent();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
href: query
|
href: query
|
||||||
|
@ -628,10 +628,10 @@ const Feeds = {
|
||||||
|
|
||||||
dialog.show();
|
dialog.show();
|
||||||
},
|
},
|
||||||
updateRandomFeed: function() {
|
updateRandom: function() {
|
||||||
console.log("in update_random_feed");
|
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);
|
Utils.handleRpcJson(transport, true);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -699,9 +699,9 @@ const CommonDialogs = {
|
||||||
if (App.isPrefs()) {
|
if (App.isPrefs()) {
|
||||||
Feeds.reload();
|
Feeds.reload();
|
||||||
} else {
|
} else {
|
||||||
if (feed_id == Feeds.getActiveFeedId())
|
if (feed_id == Feeds.getActive())
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Feeds.viewfeed({feed: -5})
|
Feeds.open({feed: -5})
|
||||||
},
|
},
|
||||||
100);
|
100);
|
||||||
|
|
||||||
|
@ -1351,7 +1351,7 @@ const Filters = {
|
||||||
if (!App.isPrefs()) {
|
if (!App.isPrefs()) {
|
||||||
query = {
|
query = {
|
||||||
op: "pref-filters", method: "newfilter",
|
op: "pref-filters", method: "newfilter",
|
||||||
feed: Feeds.getActiveFeedId(), is_cat: Feeds.activeFeedIsCat()
|
feed: Feeds.getActive(), is_cat: Feeds.activeIsCat()
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
query = {op: "pref-filters", method: "newfilter"};
|
query = {op: "pref-filters", method: "newfilter"};
|
||||||
|
@ -1445,8 +1445,8 @@ const Filters = {
|
||||||
|
|
||||||
if (selectedText != "") {
|
if (selectedText != "") {
|
||||||
|
|
||||||
const feed_id = Feeds.activeFeedIsCat() ? 'CAT:' + parseInt(Feeds.getActiveFeedId()) :
|
const feed_id = Feeds.activeIsCat() ? 'CAT:' + parseInt(Feeds.getActive()) :
|
||||||
Feeds.getActiveFeedId();
|
Feeds.getActive();
|
||||||
|
|
||||||
const rule = {reg_exp: selectedText, feed_id: [feed_id], filter_type: 1};
|
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 (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()) :
|
const feed_id = Feeds.activeIsCat() ? 'CAT:' + parseInt(Feeds.getActive()) :
|
||||||
Feeds.getActiveFeedId();
|
Feeds.getActive();
|
||||||
|
|
||||||
const rule = {reg_exp: title, feed_id: [feed_id], filter_type: 1};
|
const rule = {reg_exp: title, feed_id: [feed_id], filter_type: 1};
|
||||||
|
|
||||||
|
|
70
js/tt-rss.js
70
js/tt-rss.js
|
@ -128,7 +128,7 @@ const App = {
|
||||||
const hash_feed_is_cat = hash_get('c') == "1";
|
const hash_feed_is_cat = hash_get('c') == "1";
|
||||||
|
|
||||||
if (hash_feed_id != undefined) {
|
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);
|
Utils.setLoadingProgress(50);
|
||||||
|
@ -142,7 +142,7 @@ const App = {
|
||||||
|
|
||||||
if (getInitParam("simple_update")) {
|
if (getInitParam("simple_update")) {
|
||||||
console.log("scheduling simple feed updater...");
|
console.log("scheduling simple feed updater...");
|
||||||
window.setInterval(() => { Feeds.updateRandomFeed() }, 30 * 1000);
|
window.setInterval(() => { Feeds.updateRandom() }, 30 * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("second stage ok");
|
console.log("second stage ok");
|
||||||
|
@ -167,7 +167,7 @@ const App = {
|
||||||
},
|
},
|
||||||
onViewModeChanged: function() {
|
onViewModeChanged: function() {
|
||||||
ArticleCache.clear();
|
ArticleCache.clear();
|
||||||
return Feeds.viewCurrentFeed('');
|
return Feeds.reloadCurrent('');
|
||||||
},
|
},
|
||||||
isCombinedMode: function() {
|
isCombinedMode: function() {
|
||||||
return getInitParam("combined_display_mode");
|
return getInitParam("combined_display_mode");
|
||||||
|
@ -235,15 +235,15 @@ const App = {
|
||||||
initHotkeyActions: function() {
|
initHotkeyActions: function() {
|
||||||
this.hotkey_actions["next_feed"] = function () {
|
this.hotkey_actions["next_feed"] = function () {
|
||||||
const rv = dijit.byId("feedTree").getNextFeed(
|
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 () {
|
this.hotkey_actions["prev_feed"] = function () {
|
||||||
const rv = dijit.byId("feedTree").getPreviousFeed(
|
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 () {
|
this.hotkey_actions["next_article"] = function () {
|
||||||
Headlines.move('next');
|
Headlines.move('next');
|
||||||
|
@ -333,19 +333,19 @@ const App = {
|
||||||
Headlines.select('none');
|
Headlines.select('none');
|
||||||
};
|
};
|
||||||
this.hotkey_actions["feed_refresh"] = function () {
|
this.hotkey_actions["feed_refresh"] = function () {
|
||||||
if (Feeds.getActiveFeedId() != undefined) {
|
if (Feeds.getActive() != undefined) {
|
||||||
Feeds.viewfeed({feed: Feeds.getActiveFeedId(), is_cat: Feeds.activeFeedIsCat()});
|
Feeds.open({feed: Feeds.getActive(), is_cat: Feeds.activeIsCat()});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.hotkey_actions["feed_unhide_read"] = function () {
|
this.hotkey_actions["feed_unhide_read"] = function () {
|
||||||
Feeds.toggleDispRead();
|
Feeds.toggleUnread();
|
||||||
};
|
};
|
||||||
this.hotkey_actions["feed_subscribe"] = function () {
|
this.hotkey_actions["feed_subscribe"] = function () {
|
||||||
CommonDialogs.quickAddFeed();
|
CommonDialogs.quickAddFeed();
|
||||||
};
|
};
|
||||||
this.hotkey_actions["feed_debug_update"] = function () {
|
this.hotkey_actions["feed_debug_update"] = function () {
|
||||||
if (!Feeds.activeFeedIsCat() && parseInt(Feeds.getActiveFeedId()) > 0) {
|
if (!Feeds.activeIsCat() && parseInt(Feeds.getActive()) > 0) {
|
||||||
window.open("backend.php?op=feeds&method=update_debugger&feed_id=" + Feeds.getActiveFeedId() +
|
window.open("backend.php?op=feeds&method=update_debugger&feed_id=" + Feeds.getActive() +
|
||||||
"&csrf_token=" + getInitParam("csrf_token"));
|
"&csrf_token=" + getInitParam("csrf_token"));
|
||||||
} else {
|
} else {
|
||||||
alert("You can't debug this kind of feed.");
|
alert("You can't debug this kind of feed.");
|
||||||
|
@ -353,18 +353,18 @@ const App = {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.hotkey_actions["feed_debug_viewfeed"] = function () {
|
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 () {
|
this.hotkey_actions["feed_edit"] = function () {
|
||||||
if (Feeds.activeFeedIsCat())
|
if (Feeds.activeIsCat())
|
||||||
alert(__("You can't edit this kind of feed."));
|
alert(__("You can't edit this kind of feed."));
|
||||||
else
|
else
|
||||||
CommonDialogs.editFeed(Feeds.getActiveFeedId());
|
CommonDialogs.editFeed(Feeds.getActive());
|
||||||
};
|
};
|
||||||
this.hotkey_actions["feed_catchup"] = function () {
|
this.hotkey_actions["feed_catchup"] = function () {
|
||||||
if (Feeds.getActiveFeedId() != undefined) {
|
if (Feeds.getActive() != undefined) {
|
||||||
Feeds.catchupCurrentFeed();
|
Feeds.catchupCurrent();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.hotkey_actions["feed_reverse"] = function () {
|
this.hotkey_actions["feed_reverse"] = function () {
|
||||||
|
@ -372,28 +372,28 @@ const App = {
|
||||||
};
|
};
|
||||||
this.hotkey_actions["feed_toggle_vgroup"] = function () {
|
this.hotkey_actions["feed_toggle_vgroup"] = function () {
|
||||||
xhrPost("backend.php", {op: "rpc", method: "togglepref", key: "VFEED_GROUP_BY_FEED"}, () => {
|
xhrPost("backend.php", {op: "rpc", method: "togglepref", key: "VFEED_GROUP_BY_FEED"}, () => {
|
||||||
Feeds.viewCurrentFeed();
|
Feeds.reloadCurrent();
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
this.hotkey_actions["catchup_all"] = function () {
|
this.hotkey_actions["catchup_all"] = function () {
|
||||||
Feeds.catchupAllFeeds();
|
Feeds.catchupAll();
|
||||||
};
|
};
|
||||||
this.hotkey_actions["cat_toggle_collapse"] = function () {
|
this.hotkey_actions["cat_toggle_collapse"] = function () {
|
||||||
if (Feeds.activeFeedIsCat()) {
|
if (Feeds.activeIsCat()) {
|
||||||
dijit.byId("feedTree").collapseCat(Feeds.getActiveFeedId());
|
dijit.byId("feedTree").collapseCat(Feeds.getActive());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.hotkey_actions["goto_all"] = function () {
|
this.hotkey_actions["goto_all"] = function () {
|
||||||
Feeds.viewfeed({feed: -4});
|
Feeds.open({feed: -4});
|
||||||
};
|
};
|
||||||
this.hotkey_actions["goto_fresh"] = function () {
|
this.hotkey_actions["goto_fresh"] = function () {
|
||||||
Feeds.viewfeed({feed: -3});
|
Feeds.open({feed: -3});
|
||||||
};
|
};
|
||||||
this.hotkey_actions["goto_marked"] = function () {
|
this.hotkey_actions["goto_marked"] = function () {
|
||||||
Feeds.viewfeed({feed: -1});
|
Feeds.open({feed: -1});
|
||||||
};
|
};
|
||||||
this.hotkey_actions["goto_published"] = function () {
|
this.hotkey_actions["goto_published"] = function () {
|
||||||
Feeds.viewfeed({feed: -2});
|
Feeds.open({feed: -2});
|
||||||
};
|
};
|
||||||
this.hotkey_actions["goto_tagcloud"] = function () {
|
this.hotkey_actions["goto_tagcloud"] = function () {
|
||||||
Utils.displayDlg(__("Tag cloud"), "printTagCloud");
|
Utils.displayDlg(__("Tag cloud"), "printTagCloud");
|
||||||
|
@ -427,7 +427,7 @@ const App = {
|
||||||
Filters.quickAddFilter();
|
Filters.quickAddFilter();
|
||||||
};
|
};
|
||||||
this.hotkey_actions["collapse_sidebar"] = function () {
|
this.hotkey_actions["collapse_sidebar"] = function () {
|
||||||
Feeds.viewCurrentFeed();
|
Feeds.reloadCurrent();
|
||||||
};
|
};
|
||||||
this.hotkey_actions["toggle_embed_original"] = function () {
|
this.hotkey_actions["toggle_embed_original"] = function () {
|
||||||
if (typeof embedOriginalArticle != "undefined") {
|
if (typeof embedOriginalArticle != "undefined") {
|
||||||
|
@ -463,7 +463,7 @@ const App = {
|
||||||
!getInitParam("combined_display_mode"));
|
!getInitParam("combined_display_mode"));
|
||||||
|
|
||||||
Article.close();
|
Article.close();
|
||||||
Feeds.viewCurrentFeed();
|
Feeds.reloadCurrent();
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
this.hotkey_actions["toggle_cdm_expanded"] = function () {
|
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}, () => {
|
xhrPost("backend.php", {op: "rpc", method: "setpref", key: "CDM_EXPANDED", value: value}, () => {
|
||||||
setInitParam("cdm_expanded", !getInitParam("cdm_expanded"));
|
setInitParam("cdm_expanded", !getInitParam("cdm_expanded"));
|
||||||
Feeds.viewCurrentFeed();
|
Feeds.reloadCurrent();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -498,35 +498,35 @@ const App = {
|
||||||
window.location.href = "backend.php?op=digest";
|
window.location.href = "backend.php?op=digest";
|
||||||
break;
|
break;
|
||||||
case "qmcEditFeed":
|
case "qmcEditFeed":
|
||||||
if (Feeds.activeFeedIsCat())
|
if (Feeds.activeIsCat())
|
||||||
alert(__("You can't edit this kind of feed."));
|
alert(__("You can't edit this kind of feed."));
|
||||||
else
|
else
|
||||||
CommonDialogs.editFeed(Feeds.getActiveFeedId());
|
CommonDialogs.editFeed(Feeds.getActive());
|
||||||
break;
|
break;
|
||||||
case "qmcRemoveFeed":
|
case "qmcRemoveFeed":
|
||||||
const actid = Feeds.getActiveFeedId();
|
const actid = Feeds.getActive();
|
||||||
|
|
||||||
if (!actid) {
|
if (!actid) {
|
||||||
alert(__("Please select some feed first."));
|
alert(__("Please select some feed first."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Feeds.activeFeedIsCat()) {
|
if (Feeds.activeIsCat()) {
|
||||||
alert(__("You can't unsubscribe from the category."));
|
alert(__("You can't unsubscribe from the category."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fn = Feeds.getFeedName(actid);
|
const fn = Feeds.getName(actid);
|
||||||
|
|
||||||
if (confirm(__("Unsubscribe from %s?").replace("%s", fn))) {
|
if (confirm(__("Unsubscribe from %s?").replace("%s", fn))) {
|
||||||
CommonDialogs.unsubscribeFeed(actid);
|
CommonDialogs.unsubscribeFeed(actid);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "qmcCatchupAll":
|
case "qmcCatchupAll":
|
||||||
Feeds.catchupAllFeeds();
|
Feeds.catchupAll();
|
||||||
break;
|
break;
|
||||||
case "qmcShowOnlyUnread":
|
case "qmcShowOnlyUnread":
|
||||||
Feeds.toggleDispRead();
|
Feeds.toggleUnread();
|
||||||
break;
|
break;
|
||||||
case "qmcToggleWidescreen":
|
case "qmcToggleWidescreen":
|
||||||
if (!App.isCombinedMode()) {
|
if (!App.isCombinedMode()) {
|
||||||
|
|
|
@ -291,7 +291,7 @@ const Article = {
|
||||||
if (row.hasClassName("Unread")) {
|
if (row.hasClassName("Unread")) {
|
||||||
|
|
||||||
Headlines.catchupBatched(() => {
|
Headlines.catchupBatched(() => {
|
||||||
Feeds.decrementFeedCounter(Feeds.getActiveFeedId(), Feeds.activeFeedIsCat());
|
Feeds.decrementFeedCounter(Feeds.getActive(), Feeds.activeIsCat());
|
||||||
Headlines.toggleUnread(id, 0);
|
Headlines.toggleUnread(id, 0);
|
||||||
Headlines.updateFloatingTitle(true);
|
Headlines.updateFloatingTitle(true);
|
||||||
});
|
});
|
||||||
|
@ -404,7 +404,7 @@ const Headlines = {
|
||||||
const view_mode = document.forms["main_toolbar_form"].view_mode.value;
|
const view_mode = document.forms["main_toolbar_form"].view_mode.value;
|
||||||
const unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length;
|
const unread_in_buffer = $$("#headlines-frame > div[id*=RROW][class*=Unread]").length;
|
||||||
const num_all = $$("#headlines-frame > div[id*=RROW]").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
|
// TODO implement marked & published
|
||||||
|
|
||||||
|
@ -419,14 +419,14 @@ const Headlines = {
|
||||||
offset = unread_in_buffer;
|
offset = unread_in_buffer;
|
||||||
break;
|
break;
|
||||||
case "adaptive":
|
case "adaptive":
|
||||||
if (!(Feeds.getActiveFeedId() == -1 && !Feeds.activeFeedIsCat()))
|
if (!(Feeds.getActive() == -1 && !Feeds.activeIsCat()))
|
||||||
offset = num_unread > 0 ? unread_in_buffer : num_all;
|
offset = num_unread > 0 ? unread_in_buffer : num_all;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("loadMore, offset=", offset);
|
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() {
|
scrollHandler: function() {
|
||||||
try {
|
try {
|
||||||
|
@ -497,7 +497,7 @@ const Headlines = {
|
||||||
console.log("we seem to be at an end");
|
console.log("we seem to be at an end");
|
||||||
|
|
||||||
if (getInitParam("on_catchup_show_next_feed") == "1") {
|
if (getInitParam("on_catchup_show_next_feed") == "1") {
|
||||||
Feeds.openNextUnreadFeed();
|
Feeds.openNextUnread();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -592,7 +592,7 @@ const Headlines = {
|
||||||
feed_id = reply['headlines']['id'];
|
feed_id = reply['headlines']['id'];
|
||||||
Feeds.last_search_query = reply['headlines']['search_query'];
|
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;
|
return;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -654,7 +654,7 @@ const Headlines = {
|
||||||
this.initHeadlinesMenu();
|
this.initHeadlinesMenu();
|
||||||
|
|
||||||
if (Feeds.infscroll_disabled)
|
if (Feeds.infscroll_disabled)
|
||||||
hsp.innerHTML = "<a href='#' onclick='Feeds.openNextUnreadFeed()'>" +
|
hsp.innerHTML = "<a href='#' onclick='Feeds.openNextUnread()'>" +
|
||||||
__("Click to open next unread feed.") + "</a>";
|
__("Click to open next unread feed.") + "</a>";
|
||||||
|
|
||||||
if (Feeds._search_query) {
|
if (Feeds._search_query) {
|
||||||
|
@ -663,7 +663,7 @@ const Headlines = {
|
||||||
"</span>";
|
"</span>";
|
||||||
}
|
}
|
||||||
|
|
||||||
} 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 c = dijit.byId("headlines-frame");
|
||||||
//const ids = Headlines.getSelected();
|
//const ids = Headlines.getSelected();
|
||||||
|
|
||||||
|
@ -702,7 +702,7 @@ const Headlines = {
|
||||||
this.initHeadlinesMenu();
|
this.initHeadlinesMenu();
|
||||||
|
|
||||||
if (Feeds.infscroll_disabled) {
|
if (Feeds.infscroll_disabled) {
|
||||||
hsp.innerHTML = "<a href='#' onclick='Feeds.openNextUnreadFeed()'>" +
|
hsp.innerHTML = "<a href='#' onclick='Feeds.openNextUnread()'>" +
|
||||||
__("Click to open next unread feed.") + "</a>";
|
__("Click to open next unread feed.") + "</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -716,10 +716,10 @@ const Headlines = {
|
||||||
|
|
||||||
if (hsp) {
|
if (hsp) {
|
||||||
if (first_id_changed) {
|
if (first_id_changed) {
|
||||||
hsp.innerHTML = "<a href='#' onclick='Feeds.viewCurrentFeed()'>" +
|
hsp.innerHTML = "<a href='#' onclick='Feeds.reloadCurrent()'>" +
|
||||||
__("New articles found, reload feed to continue.") + "</a>";
|
__("New articles found, reload feed to continue.") + "</a>";
|
||||||
} else {
|
} else {
|
||||||
hsp.innerHTML = "<a href='#' onclick='Feeds.openNextUnreadFeed()'>" +
|
hsp.innerHTML = "<a href='#' onclick='Feeds.openNextUnread()'>" +
|
||||||
__("Click to open next unread feed.") + "</a>";
|
__("Click to open next unread feed.") + "</a>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -753,7 +753,7 @@ const Headlines = {
|
||||||
|
|
||||||
order_by.attr('value', value);
|
order_by.attr('value', value);
|
||||||
|
|
||||||
Feeds.viewCurrentFeed();
|
Feeds.reloadCurrent();
|
||||||
},
|
},
|
||||||
selectionToggleUnread: function(params) {
|
selectionToggleUnread: function(params) {
|
||||||
params = params || {};
|
params = params || {};
|
||||||
|
@ -1059,10 +1059,10 @@ const Headlines = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fn = Feeds.getFeedName(Feeds.getActiveFeedId(), Feeds.activeFeedIsCat());
|
const fn = Feeds.getName(Feeds.getActive(), Feeds.activeIsCat());
|
||||||
let str;
|
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);
|
str = ngettext("Delete %d selected article in %s?", "Delete %d selected articles in %s?", rows.length);
|
||||||
} else {
|
} else {
|
||||||
str = ngettext("Delete %d selected article?", "Delete %d selected articles?", rows.length);
|
str = ngettext("Delete %d selected article?", "Delete %d selected articles?", rows.length);
|
||||||
|
@ -1079,7 +1079,7 @@ const Headlines = {
|
||||||
|
|
||||||
xhrPost("backend.php", query, (transport) => {
|
xhrPost("backend.php", query, (transport) => {
|
||||||
Utils.handleRpcJson(transport);
|
Utils.handleRpcJson(transport);
|
||||||
Feeds.viewCurrentFeed();
|
Feeds.reloadCurrent();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getSelected: function() {
|
getSelected: function() {
|
||||||
|
@ -1171,11 +1171,11 @@ const Headlines = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fn = Feeds.getFeedName(Feeds.getActiveFeedId(), Feeds.activeFeedIsCat());
|
const fn = Feeds.getName(Feeds.getActive(), Feeds.activeIsCat());
|
||||||
let str;
|
let str;
|
||||||
let op;
|
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);
|
str = ngettext("Archive %d selected article in %s?", "Archive %d selected articles in %s?", rows.length);
|
||||||
op = "archive";
|
op = "archive";
|
||||||
} else {
|
} else {
|
||||||
|
@ -1200,7 +1200,7 @@ const Headlines = {
|
||||||
|
|
||||||
xhrPost("backend.php", query, (transport) => {
|
xhrPost("backend.php", query, (transport) => {
|
||||||
Utils.handleRpcJson(transport);
|
Utils.handleRpcJson(transport);
|
||||||
Feeds.viewCurrentFeed();
|
Feeds.reloadCurrent();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
catchupSelection: function() {
|
catchupSelection: function() {
|
||||||
|
@ -1211,7 +1211,7 @@ const Headlines = {
|
||||||
return;
|
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);
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Headlines.selectionToggleUnread({callback: Feeds.viewCurrentFeed, no_error: 1});
|
Headlines.selectionToggleUnread({callback: Feeds.reloadCurrent, no_error: 1});
|
||||||
},
|
},
|
||||||
catchupBatched: function(callback) {
|
catchupBatched: function(callback) {
|
||||||
console.log("catchupBatched, size=", this.catchup_id_batch.length);
|
console.log("catchupBatched, size=", this.catchup_id_batch.length);
|
||||||
|
|
|
@ -93,7 +93,7 @@ class Af_Psql_Trgm extends Plugin {
|
||||||
print " <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"$article_link\">".
|
print " <a target=\"_blank\" rel=\"noopener noreferrer\" href=\"$article_link\">".
|
||||||
$line["title"]."</a>";
|
$line["title"]."</a>";
|
||||||
|
|
||||||
print " (<a href=\"#\" onclick=\"Feeds.viewfeed({feed:".$line["feed_id"]."})\">".
|
print " (<a href=\"#\" onclick=\"Feeds.open({feed:".$line["feed_id"]."})\">".
|
||||||
htmlspecialchars($line["feed_title"])."</a>)";
|
htmlspecialchars($line["feed_title"])."</a>)";
|
||||||
|
|
||||||
print " <span class='insensitive'>($sm)</span>";
|
print " <span class='insensitive'>($sm)</span>";
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Toggle_Sidebar extends Plugin {
|
||||||
function hook_main_toolbar_button() {
|
function hook_main_toolbar_button() {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<button dojoType="dijit.form.Button" onclick="Feeds.collapseFeedlist()">
|
<button dojoType="dijit.form.Button" onclick="Feeds.toggle()">
|
||||||
<img src="plugins/toggle_sidebar/application_side_list.png"
|
<img src="plugins/toggle_sidebar/application_side_list.png"
|
||||||
title="<?php echo __('Collapse feedlist') ?>">
|
title="<?php echo __('Collapse feedlist') ?>">
|
||||||
</button>
|
</button>
|
||||||
|
|
Loading…
Reference in New Issue