]> git.wh0rd.org Git - tt-rss.git/commitdiff
loading progress bar for main window
authorAndrew Dolgov <fox@madoka.spb.ru>
Mon, 19 May 2008 07:37:44 +0000 (08:37 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Mon, 19 May 2008 07:37:44 +0000 (08:37 +0100)
feedlist.js
functions.js
tt-rss.css
tt-rss.js
tt-rss.php
viewfeed.js

index 3f82993d4aa3add3fdf44ce74a49ec7754cb925d..b222c9bdb93590cda3ea0e92bc76a6b8e03dc017 100644 (file)
@@ -321,20 +321,22 @@ function feedlist_init() {
 //             if (arguments.callee.done) return;
 //             arguments.callee.done = true;           
                
+               loading_set_progress(80);
+
                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();
@@ -345,7 +347,10 @@ function feedlist_init() {
                        setTimeout("viewCurrentFeed()", 100);
                } else {
                        if (getInitParam("cdm_auto_catchup") != 1) {                            
+                               notify_silent_next();
                                setTimeout("viewfeed(-3)", 100);
+                       } else {
+                               remove_splash();
                        }
                }
 
@@ -361,6 +366,8 @@ function feedlist_init() {
 
                init_collapsable_feedlist(getInitParam("theme"));
 
+               loading_set_progress(80);
+
        } catch (e) {
                exception_error("feedlist/init", e);
        }
@@ -453,3 +460,14 @@ function init_collapsable_feedlist(theme) {
        }
 
 }
+
+function remove_splash() {
+       debug("about to remove splash, OMG!");
+
+       var o = document.getElementById("overlay");
+
+       if (o) {
+               o.style.display = "none";
+               debug("removed splash!");
+       } 
+}
index f716f350ec319cb79a08610efc3de3b8120b4e5c..c37a7812c60e87c284ca09911370be31b0335e76 100644 (file)
@@ -1,6 +1,7 @@
 var hotkeys_enabled = true;
 var debug_mode_enabled = false;
 var xmlhttp_rpc = Ajax.getTransport();
+var notify_silent = false;
 
 /* add method to remove element from array */
 
@@ -134,8 +135,17 @@ function hide_notify() {
        }
 } 
 
+function notify_silent_next() {
+       notify_silent = true;
+}
+
 function notify_real(msg, no_hide, n_type) {
 
+       if (notify_silent) {
+               notify_silent = false;
+               return;
+       }
+
        var n = document.getElementById("notify");
        var nb = document.getElementById("notify_body");
 
@@ -1661,3 +1671,12 @@ function focus_element(id) {
        return false;
 }
 
+function loading_set_progress(v) {
+       try {
+               var o = document.getElementById("l_progress_i");
+               o.style.width = (v*2) + "px";
+
+       } catch (e) {
+               exception_error("loading_set_progress", e);
+       }
+}
index f0ed5d6f5b2bfc2d0e7eb7a21dbfaf43b3c4cd6f..dafb9db4f051cf9188da08d82256975cf69cae9b 100644 (file)
@@ -1245,7 +1245,6 @@ a.cdmToggleLink:hover {
 
 #overlay_inner {
        font-weight : bold;
-       text-align : center;
        margin : 10px;
 }
 
@@ -1930,3 +1929,16 @@ div.prefKbdHelp {
 div.prefKbdHelp img {
        vertical-align : middle;
 }
+
+div#l_progress_o {
+       width : 200px;
+       border : 1px solid black;
+       background-color : white;
+       margin-top : 10px;
+}
+
+div#l_progress_i {
+       width : 10px;
+       background-color : #88b0f0;
+       padding : 5px;
+}
index 57315b4e58cc42884b88e80a8bfe5ecca887f054..538a318d9cdcfffa3601a45673fc280b2b6d655a 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -325,6 +325,8 @@ function init() {
 
        try {
 
+               loading_set_progress(30);
+
                // this whole shebang is based on http://www.birnamdesigns.com/misc/busted2.html
 
                if (arguments.callee.done) return;
@@ -423,6 +425,8 @@ function init_second_stage() {
 
                debug("second stage ok");
        
+               loading_set_progress(60);
+
        } catch (e) {
                exception_error("init_second_stage", e);
        }
index 226117ff73d1492a2b6a8531f9374ab997991a1f..d5fd39fe4dab1d3f4324286fb2e68c837ca55742 100644 (file)
 
 <div id="overlay">
        <div id="overlay_inner">
-       <p><?php echo __("Loading, please wait...") ?></p>
+               <?php echo __("Loading, please wait...") ?>
+
+               <div id="l_progress_o">
+                       <div id="l_progress_i"> </div>
+               </div>
+
        <noscript>
                <div class="error"><?php echo
                __("Your browser doesn't support Javascript, which is required
index da03a6a2de074d2518e2be785ed0bf8f84bb310f..24f3636fb4080a4c88468f5bda5feeecab82b282 100644 (file)
@@ -65,6 +65,8 @@ function clean_feed_selections() {
 function headlines_callback2(transport, active_feed_id, is_cat, feed_cur_page) {
        try {
 
+               loading_set_progress(100);
+
                debug("headlines_callback2 [page=" + feed_cur_page + "]");
 
                clean_feed_selections();
@@ -168,7 +170,7 @@ function headlines_callback2(transport, active_feed_id, is_cat, feed_cur_page) {
                                        debug("headlines_callback: returned no data");
                                        notify_error("Error while trying to load more headlines");      
                                }
-       
+
                        }
        
                        if (articles) {
@@ -228,6 +230,9 @@ function headlines_callback2(transport, active_feed_id, is_cat, feed_cur_page) {
                _infscroll_request_sent = 0;
 
                notify("");
+
+               remove_splash();
+
        } catch (e) {
                exception_error("headlines_callback2", e);
        }