]> git.wh0rd.org - tt-rss.git/blobdiff - feedlist.js
loading progress bar for main window (2)
[tt-rss.git] / feedlist.js
index 8bbc24626ff533101f238b3495d4d9c74a8386de..d16a56e064ee99be6a2ff450724f0c589337e30d 100644 (file)
@@ -21,13 +21,15 @@ function feedlist_callback2(transport) {
 
 function viewNextFeedPage() {
        try {
-               if (!getActiveFeedId()) return;
+               //if (!getActiveFeedId()) return;
 
-               viewfeed(getActiveFeedId(), undefined, undefined, undefined,
+               debug("viewNextFeedPage: calling viewfeed(), p: " + _feed_cur_page+1);
+
+               viewfeed(getActiveFeedId(), undefined, activeFeedIsCat(), undefined,
                        undefined, _feed_cur_page+1);
 
        } catch (e) {
-               exception_error(e, "viewFeedGoPage");
+               exception_error("viewNextFeedPage", e);
        }
 }
 
@@ -36,6 +38,16 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
 
 //             if (!offset) page_offset = 0;
 
+               if (feed == getActiveFeedId()) {
+                       cache_invalidate("F:" + feed);
+               }
+
+/*             if (getInitParam("theme") == "" || getInitParam("theme") == "compact") {
+                       if (getInitParam("hide_feedlist") == 1) {
+                               Element.hide("feeds-holder");
+                       }               
+               } */
+
                var force_nocache = false;
 
                var page_offset = 0;
@@ -123,6 +135,11 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
 
                if (page_offset != 0) {
                        query = query + "&skip=" + page_offset;
+
+                       // to prevent duplicate feed titles when showing grouped vfeeds
+                       if (vgroup_last_feed) {
+                               query = query + "&vgrlf=" + param_escape(vgroup_last_feed);
+                       }
                }
 
                var date = new Date();
@@ -132,8 +149,6 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
                disableContainerChildren("headlinesToolbar", false);
                Form.enable("main_toolbar_form");
 
-               debug(query);
-
                // for piggybacked counters
 
                if (tagsAreDisplayed()) {
@@ -142,6 +157,8 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) {
                        query = query + "&omode=flc";
                }
 
+               debug(query);
+
                var container = document.getElementById("headlinesInnerContainer");
 
                if (container && page_offset == 0 && !isCdmMode()) {
@@ -304,20 +321,22 @@ function feedlist_init() {
 //             if (arguments.callee.done) return;
 //             arguments.callee.done = true;           
                
+               loading_set_progress(90);
+
                debug("in feedlist init");
                
                hideOrShowFeeds(document, getInitParam("hide_read_feeds") == 1);
                document.onkeydown = hotkey_handler;
                setTimeout("timeout()", 0);
 
-               debug("about to remove splash, OMG!");
+/*             debug("about to remove splash, OMG!");
 
                var o = document.getElementById("overlay");
 
                if (o) {
                        o.style.display = "none";
                        debug("removed splash!");
-               }
+               } */
 
                if (typeof correctPNG != 'undefined') {
                        correctPNG();
@@ -327,8 +346,11 @@ function feedlist_init() {
                        debug("some feed is open on feedlist refresh, reloading");
                        setTimeout("viewCurrentFeed()", 100);
                } else {
-                       if (getInitParam("cdm_auto_catchup") != 1) {                            
+                       if (getInitParam("cdm_auto_catchup") != 1 && get_feed_unread(-3) > 0) {
+                               notify_silent_next();
                                setTimeout("viewfeed(-3)", 100);
+                       } else {
+                               remove_splash();
                        }
                }
 
@@ -336,6 +358,14 @@ function feedlist_init() {
                        setTimeout("hide_footer()", 5000);
                }
 
+/*             if (getInitParam("hide_feedlist") == 1) {
+                       init_hidden_feedlist(getInitParam("theme"));
+               } else {
+                       init_collapsable_feedlist(getInitParam("theme"));
+               } */
+
+               init_collapsable_feedlist(getInitParam("theme"));
+
        } catch (e) {
                exception_error("feedlist/init", e);
        }
@@ -369,3 +399,68 @@ function hide_footer() {
                exception_error("hide_footer", e);
        }
 }
+
+/*
+function init_hidden_feedlist(theme) {
+       try {
+               debug("init_hidden_feedlist");
+
+               if (theme != "" && theme != "compact") return;
+
+               var fl = document.getElementById("feeds-holder");
+               var fh = document.getElementById("headlines-frame");
+               var fc = document.getElementById("content-frame");
+               var ft = document.getElementById("toolbar");
+               var ff = document.getElementById("footer");
+               var fhdr = document.getElementById("header");
+
+               var fbtn = document.getElementById("toggle_feeds_btn");
+
+               if (fbtn) Element.show(fbtn);
+
+               fl.style.top = fh.offsetTop + "px";
+               fl.style.backgroundColor = "white"; //FIXME
+
+               Element.hide(fl);
+               
+               fh.style.left = "0px";
+               ft.style.left = "0px";
+               if (fc) fc.style.left = "0px";
+               if (ff) ff.style.left = "0px";
+
+               if (theme == "compact") {
+                       fhdr.style.left = "10px";
+                       fl.style.top = (fh.offsetTop + 1) + "px";
+               }
+
+       } catch (e) {
+               exception_error("init_hidden_feedlist", e);
+       }
+} */
+
+function init_collapsable_feedlist(theme) {
+       try {
+               debug("init_collapsable_feedlist");
+
+               if (theme != "" && theme != "compact" && theme != "graycube" &&
+                               theme != "compat") return;
+
+               var fbtn = document.getElementById("collapse_feeds_btn");
+
+               if (fbtn) Element.show(fbtn);
+
+               if (getCookie("ttrss_vf_fclps") == 1) {
+                       collapse_feedlist();
+               }
+
+       } catch (e) {
+               exception_error("init_hidden_feedlist", e);
+       }
+
+}
+
+function remove_splash() {
+       debug("about to remove splash, OMG!");
+       Element.hide("overlay");
+       debug("removed splash!");
+}