]> git.wh0rd.org - tt-rss.git/commitdiff
remove ACTFEEDID container, keep information in a cookie instead (getActiveFeedId...
authorAndrew Dolgov <fox@bah.spb.su>
Thu, 8 Sep 2005 05:29:45 +0000 (06:29 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Thu, 8 Sep 2005 05:29:45 +0000 (06:29 +0100)
backend.php
feedlist.js
functions.js
tt-rss.js
viewfeed.js

index 27ccf4c3b2e29ac021de2ed47f83b1382a8a3a1f..e9be94504646b6b251a0bd2a6004f14522f12a41 100644 (file)
                print "</table>";
 
                print "<div class=\"invisible\" id=\"FEEDTU\">$total_unread</div>";
-               print "<div class=\"invisible\" id=\"ACTFEEDID\">$actid</div>";
+//             print "<div class=\"invisible\" id=\"ACTFEEDID\">$actid</div>";
 
        }
 
index b5b34bfccb7389ee5cc5f68b2ff98eeadc139d48..2e6497a1aac81b1353f57882a9b49a43f445bb09 100644 (file)
@@ -1,5 +1,3 @@
-var active_feed_id = 666;
-var active_offset;
 
 function viewfeed(feed, skip, subop, doc) {
 
@@ -40,12 +38,9 @@ function viewfeed(feed, skip, subop, doc) {
                limit = "All";
        }
 
-       active_feed_id = feed;
-       active_offset = skip;
+//     document.getElementById("ACTFEEDID").innerHTML = feed;
 
-       document.getElementById("ACTFEEDID").innerHTML = feed;
-
-       setCookie("ttrss_vf_actfeed", feed);
+       setActiveFeedId(feed);
 
        if (subop == "MarkAllRead") {
 
index 5f8b2425f9fe31053c05c0b7317c090ac804a122..4e758a7d08dd5d5adf840b456cb555237ca93593 100644 (file)
@@ -270,3 +270,11 @@ function gotoMain() {
 function gotoExportOpml() {
        document.location.href = "opml.php?op=Export";
 }
+
+function getActiveFeedId() {
+       return getCookie("ttrss_vf_actfeed");
+}
+
+function setActiveFeedId(id) {
+       return setCookie("ttrss_vf_actfeed", id);
+}
index 234fb363443901cefa475ce38951b17f8403a341..edfd10693d76c9a0ff1ff2012007f850f732344d 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -8,8 +8,6 @@ var xmlhttp = false;
 var total_unread = 0;
 var first_run = true;
 
-var active_feed_id = false;
-
 var search_query = "";
 
 /*@cc_on @*/
@@ -50,15 +48,6 @@ function feedlist_callback() {
 }
 */
 
-function checkActiveFeedId() {
-
-       var actfeedid = frames["feeds-frame"].document.getElementById("ACTFEEDID");
-
-       if (actfeedid) {
-               active_feed_id = actfeedid.innerHTML;
-       }
-}
-
 function refetch_callback() {
 
        if (xmlhttp.readyState == 4) {
@@ -117,8 +106,8 @@ function updateFeedList(silent, fetch) {
 
        var query_str = "backend.php?op=feeds";
 
-       if (active_feed_id) {
-               query_str = query_str + "&actid=" + active_feed_id;
+       if (getActiveFeedId()) {
+               query_str = query_str + "&actid=" + getActiveFeedId();
        }
 
        if (fetch) query_str = query_str + "&fetch=yes";
@@ -142,10 +131,8 @@ function catchupAllFeeds() {
 
 function viewCurrentFeed(skip, subop) {
 
-       active_feed_id = frames["feeds-frame"].document.getElementById("ACTFEEDID").innerHTML;
-
-       if (active_feed_id) {
-               viewfeed(active_feed_id, skip, subop);
+       if (getActiveFeedId()) {
+               viewfeed(getActiveFeedId(), skip, subop);
        }
 }
 
@@ -186,13 +173,11 @@ function viewfeed(feed, skip, subop) {
                limit = "All";
        }
 
-       active_feed_id = feed;
+       setActiveFeedId(feed);
 
        var f_doc = frames["feeds-frame"].document;
 
-       f_doc.getElementById("ACTFEEDID").innerHTML = feed;
-
-       setCookie("ttrss_vf_actfeed", feed);
+//     f_doc.getElementById("ACTFEEDID").innerHTML = feed;
 
        if (subop == "MarkAllRead") {
 
@@ -239,16 +224,16 @@ function timeout() {
 function resetSearch() {
        var searchbox = document.getElementById("searchbox")
 
-       if (searchbox.value != "" && active_feed_id) {  
+       if (searchbox.value != "" && getActiveFeedId()) {       
                searchbox.value = "";
-               viewfeed(active_feed_id, 0, "");
+               viewfeed(getActiveFeedId(), 0, "");
        }
 }
 
 function search() {
        checkActiveFeedId();
-       if (active_feed_id) {
-               viewfeed(active_feed_id, 0, "");
+       if (getActiveFeedId()) {
+               viewfeed(getActiveFeedId(), 0, "");
        } else {
                notify("Please select some feed first.");
        }
@@ -282,7 +267,7 @@ function localHotkeyHandler(keycode) {
        }
 
        if (keycode == 85) {
-               return viewfeed(active_feed_id, active_offset, "ForceUpdate");
+               return viewfeed(getActiveFeedId(), 0, "ForceUpdate");
        }
 
 //     notify("KC: " + keycode);
@@ -317,6 +302,13 @@ function init() {
                var limitbox = document.getElementById("limitbox");
                limitbox.value = getCookie("ttrss_vf_limit");
        }
+
+//     if (getCookie("ttrss_vf_actfeed")) {
+//             viewfeed(getCookie("ttrss_vf_actfeed"), 0, '');
+//     }
+
+       setCookie("ttrss_vf_actfeed", "");
+
 }
 
 
index b45bce98e088ea75d2ac52ad9a819c8b5f946782..35bef67b7488cc115fc7c690d495da1c9fbd4cc7 100644 (file)
@@ -1,4 +1,3 @@
-var active_feed_id = false;
 var active_post_id = false;
 var total_unread = 0;
 
@@ -73,7 +72,7 @@ function view(id, feed_id) {
        }
 
        active_post_id = id; 
-       active_feed_id = feed_id;
+       setActiveFeedId(feed_id);
 
        var content = parent.document.getElementById("content-frame");
 
@@ -134,13 +133,13 @@ function moveToPost(mode) {
 
        if (mode == "next") {
                if (next_id != undefined) {
-                       view(next_id, active_feed_id);
+                       view(next_id, getActiveFeedId());
                }
        }
 
        if (mode == "prev") {
                if ( prev_id != undefined) {
-                       view(prev_id, active_feed_id);
+                       view(prev_id, getActiveFeedId());
                }
        } 
 }