summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2009-01-17 11:14:45 +0100
committerAndrew Dolgov <[email protected]>2009-01-17 11:14:45 +0100
commit3d72bbdb4f4cb35c40aa61199dc6b3265cc5c9b6 (patch)
treea030024f7127b0b3ac488ad75e61be0aef7d734d /tt-rss.js
parent617698d71010d43161b968811f50e0edce25dc1a (diff)
active_feed_is_cat, active_feed_id handling changes
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js42
1 files changed, 34 insertions, 8 deletions
diff --git a/tt-rss.js b/tt-rss.js
index 658c696d2..304c87ec6 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -8,8 +8,8 @@ var daemon_enabled = false;
var daemon_refresh_only = false;
//var _qfd_deleted_feed = 0;
var firsttime_update = true;
-var active_feed_id = 0;
-var active_feed_is_cat = false;
+var _active_feed_id = 0;
+var _active_feed_is_cat = false;
var number_of_feeds = 0;
var sanity_check_done = false;
var _hfd_scrolltop = 0;
@@ -20,6 +20,36 @@ var hor_offset = 0;
var feeds_sort_by_unread = false;
var feedlist_sortable_enabled = false;
+function activeFeedIsCat() {
+ return _active_feed_is_cat;
+}
+
+function getActiveFeedId() {
+// return getCookie("ttrss_vf_actfeed");
+ try {
+ debug("gAFID: " + _active_feed_id);
+ return _active_feed_id;
+ } catch (e) {
+ exception_error("getActiveFeedId", e);
+ }
+}
+
+function setActiveFeedId(id, is_cat) {
+// return setCookie("ttrss_vf_actfeed", id);
+ try {
+ debug("sAFID(" + id + ", " + is_cat + ")");
+ _active_feed_id = id;
+
+ if (is_cat != undefined) {
+ _active_feed_is_cat = is_cat;
+ }
+
+ } catch (e) {
+ exception_error("setActiveFeedId", e);
+ }
+}
+
+
function isFeedlistSortable() {
return feedlist_sortable_enabled;
}
@@ -250,7 +280,7 @@ function viewCurrentFeed(subop) {
// if (getActiveFeedId()) {
if (getActiveFeedId() != undefined) {
- viewfeed(getActiveFeedId(), subop, active_feed_is_cat);
+ viewfeed(getActiveFeedId(), subop, activeFeedIsCat());
} else {
disableContainerChildren("headlinesToolbar", false, document);
// viewfeed(-1, subop); // FIXME
@@ -728,14 +758,10 @@ function parse_runtime_info(elem) {
function catchupCurrentFeed() {
- var fn = getFeedName(getActiveFeedId(), active_feed_is_cat);
+ var fn = getFeedName(getActiveFeedId(), activeFeedIsCat());
var str = __("Mark all articles in %s as read?").replace("%s", fn);
-/* if (active_feed_is_cat) {
- str = "Mark all articles in this category as read?";
- } */
-
if (getInitParam("confirm_feed_catchup") != 1 || confirm(str)) {
return viewCurrentFeed('MarkAllRead')
}