]> git.wh0rd.org - tt-rss.git/blobdiff - tt-rss.js
fix feedlist layout bug (take two) - remove unneeded CRs
[tt-rss.git] / tt-rss.js
index 961c6df495b0c96855e779ff2f9c24dd3150c207..7b96bf3854c5962227a5a8fae74a9beb6a268f2e 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -7,6 +7,7 @@ var active_title_text = "";
 var current_subtitle = "";
 var daemon_enabled = false;
 var _qfd_deleted_feed = 0;
+var firsttime_update = true;
 
 /*@cc_on @*/
 /*@if (@_jscript_version >= 5)
@@ -126,10 +127,8 @@ function refetch_callback() {
 
                        if (!daemon_enabled) {
                                notify("All feeds updated.");
-                       } else {
-                               global_unread = 0;
+                               updateTitle("");
                        }
-                       updateTitle("");
                } catch (e) {
                        exception_error("refetch_callback", e);
                        updateTitle("");
@@ -186,15 +185,21 @@ function scheduleFeedUpdate(force) {
 
        var omode;
 
-       if (display_tags) {
-               omode = "t";
+       if (firsttime_update) {
+               firsttime_update = false;
+               omode = "T";
        } else {
-               omode = "fl";
+               if (display_tags) {
+                       omode = "t";
+               } else {
+                       omode = "flc";
+               }
        }
-
+       
        query_str = query_str + "&omode=" + omode;
        query_str = query_str + "&uctr=" + global_unread;
 
+
        if (xmlhttp_ready(xmlhttp)) {
                xmlhttp.open("GET", query_str, true);
                xmlhttp.onreadystatechange=refetch_callback;
@@ -296,14 +301,6 @@ function localPiggieFunction(enable) {
 
 function localHotkeyHandler(keycode) {
 
-/*     if (keycode == 78) {
-               return moveToPost('next');
-       }
-
-       if (keycode == 80) {
-               return moveToPost('prev');
-       } */
-
        if (keycode == 82) { // r
                return scheduleFeedUpdate(true);
        }
@@ -342,7 +339,7 @@ function localHotkeyHandler(keycode) {
 function updateTitle(s) {
        var tmp = "Tiny Tiny RSS";
 
-       if (s && s.length > 0) {
+       if (s != undefined) {
                current_subtitle = s;
        }
 
@@ -350,7 +347,7 @@ function updateTitle(s) {
                tmp = tmp + " (" + global_unread + ")";
        }
 
-       if (s) {
+       if (current_subtitle) {
                tmp = tmp + " - " + current_subtitle;
        }
 
@@ -378,6 +375,11 @@ function init() {
 
        try {
 
+               // this whole shebang is based on http://www.birnamdesigns.com/misc/busted2.html
+
+               if (arguments.callee.done) return;
+               arguments.callee.done = true;           
+
                disableContainerChildren("headlinesToolbar", true);
 
                if (!genericSanityCheck())