]> git.wh0rd.org Git - tt-rss.git/commitdiff
rework loading progressbar
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 19 Nov 2010 13:08:02 +0000 (16:08 +0300)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Fri, 19 Nov 2010 13:08:02 +0000 (16:08 +0300)
feedlist.js
functions.js
prefs.js
prefs.php
tt-rss.css
tt-rss.js
tt-rss.php
viewfeed.js

index 734fddaeecc335ac7022ace4649434f9dfcd762e..1f4819a35a5d94030d0696e3cbb1a521b4699f1d 100644 (file)
@@ -191,8 +191,6 @@ function viewfeed(feed, subop, is_cat, offset) {
 
 function feedlist_init() {
        try {
-               loading_set_progress(90);
-
                console.log("in feedlist init");
                
                hideOrShowFeeds(getInitParam("hide_read_feeds") == 1);
@@ -204,7 +202,6 @@ function feedlist_init() {
                                setTimeout("viewfeed(-3)", 100);
                        } else {
                                setTimeout("viewfeed(-5)", 100);
-                               remove_splash();
                        }
                } 
 
index 527a6f81701eafff3a36dc29e97748139185316a..48a9ef230fed360a1fd0a13ad28d2b76cbd44e66 100644 (file)
@@ -1,6 +1,6 @@
 var hotkeys_enabled = true;
 var notify_silent = false;
-var last_progress_point = 0;
+var loading_progress = 0;
 var sanity_check_done = false;
 
 /* add method to remove element from array */
@@ -879,21 +879,13 @@ function displayHelpInfobox(topic_id) {
 
 function loading_set_progress(p) {
        try {
-               if (p < last_progress_point || !Element.visible("overlay")) return;
+               loading_progress += p;
 
-               console.log("loading_set_progress : " + p + " (" + last_progress_point + ")");
+               if (dijit.byId("loading_bar"))
+                       dijit.byId("loading_bar").update({progress: loading_progress});
 
-               var o = $("l_progress_i");
-
-//             o.style.width = (p * 2) + "px";
-
-               new Effect.Scale(o, p, { 
-                       scaleY : false,
-                       scaleFrom : last_progress_point,
-                       scaleMode: { originalWidth : 200 },
-                       queue: { position: 'end', scope: 'LSP-Q', limit: 3 } }); 
-
-               last_progress_point = p;
+               if (loading_progress >= 90)
+                       remove_splash();
 
        } catch (e) {
                exception_error("loading_set_progress", e);
@@ -901,6 +893,7 @@ function loading_set_progress(p) {
 }
 
 function remove_splash() {
+
        if (Element.visible("overlay")) {
                console.log("about to remove splash, OMG!");
                Element.hide("overlay");
index 0c627b21931ce03ee8e1aad187ad7997b0201108..5d9107f97fc08c56a39fc10e81bec87a1e724b1c 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -25,7 +25,6 @@ function feedlist_callback2(transport) {
                        caller_subop = false;
                }
                notify("");
-               remove_splash();
 
        } catch (e) {
                exception_error("feedlist_callback2", e);
@@ -35,7 +34,6 @@ function feedlist_callback2(transport) {
 function filterlist_callback2(transport) {
        dijit.byId('filterConfigTab').attr('content', transport.responseText); 
        notify("");
-       remove_splash();
 }
 
 function labellist_callback2(transport) {
@@ -46,7 +44,6 @@ function labellist_callback2(transport) {
                closeInfoBox();
 
                notify("");
-               remove_splash();
 
        } catch (e) {
                exception_error("labellist_callback2", e);
@@ -58,7 +55,6 @@ function userlist_callback2(transport) {
                dijit.byId('userConfigTab').attr('content', transport.responseText); 
 
                notify("");
-               remove_splash();
        } catch (e) {
                exception_error("userlist_callback2", e);
        }
@@ -69,7 +65,6 @@ function prefslist_callback2(transport) {
                dijit.byId('genConfigTab').attr('content', transport.responseText); 
 
                notify("");
-               remove_splash();
        } catch (e) {
                exception_error("prefslist_callback2", e);
        }
@@ -1072,7 +1067,7 @@ function init_second_stage() {
                        caller_subop = caller_subop + ":" + getURLParam("subopparam");
                }
 
-               loading_set_progress(60);
+               loading_set_progress(50);
 
                notify("");
 
@@ -1088,7 +1083,6 @@ function init_second_stage() {
                        });
 
                setTimeout("hotkey_prefix_timeout()", 5*1000);
-               remove_splash();
 
        } catch (e) {
                exception_error("init_second_stage", e);
@@ -1117,6 +1111,7 @@ function init() {
                dojo.require("dijit.tree.dndSource");
                dojo.require("dijit.InlineEditBox");
                dojo.require("dijit.ColorPalette");
+               dojo.require("dijit.ProgressBar");
 
                dojo.registerModulePath("lib", "..");
                dojo.registerModulePath("fox", "../..");
@@ -1126,7 +1121,7 @@ function init() {
                dojo.require("fox.PrefFilterTree");
                dojo.require("fox.PrefLabelTree");
 
-               loading_set_progress(30);
+               loading_set_progress(50);
 
                var query = "?op=rpc&subop=sanityCheck";
 
index 0e48665b31bc66ba9cc4bb0da75f6ea91edd07fb..972e577ca6840ee6225dda5ed9e63fb839560330 100644 (file)
--- a/prefs.php
+++ b/prefs.php
 
 <div id="overlay">
        <div id="overlay_inner">
-               <?php echo __("Loading, please wait...") ?>
-
-               <div id="l_progress_o">
-                       <div id="l_progress_i"></div>
+               <div class="insensitive"><?php echo __("Loading, please wait...") ?></div>
+               <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
+            progress="0" maximum="100">
                </div>
-
        <noscript>
                <p><?php print_error(__("Your browser doesn't support Javascript, which is required
                for this application to function properly. Please check your
index 9edd15c331002909d33fcace492bef85024cf508..98040440de9bee41bb014554c9fa0d0e82e5c6eb 100644 (file)
@@ -185,7 +185,7 @@ input.editbox {
        display : none;
        float : right;
        font-size : 12px;
-       z-index : 998;
+       z-index : 99;
        padding : 5px 5px 5px 5px;
 }
 
@@ -807,7 +807,7 @@ div.browserFeedInfo div.detailsPart {
 
 #overlay_inner {
        font-weight : bold;
-       margin : 10px;
+       margin : 1em;
 }
 
 #noDaemonWarning {     
index 4ad6ca2f4d8f1065730238ef94b1dfa0aecc0d9f..674623112913131b5eca0056759ab22255955c9e 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -120,6 +120,7 @@ function updateFeedList() {
                var tmph = dojo.connect(tree, 'onLoad', function() {
                dojo.disconnect(tmph);
                        Element.hide("feedlistLoading");
+                       loading_set_progress(25);
                });
 
                tree.startup();
@@ -254,6 +255,7 @@ function init() {
                dojo.require("dijit.Tree");
                dojo.require("dijit.form.Select");
                dojo.require("dijit.Toolbar");
+               dojo.require("dijit.ProgressBar");
                dojo.require("dojo.parser");
 
                dojo.registerModulePath("fox", "../..");
@@ -279,7 +281,7 @@ function init() {
 
                var params = "&ua=" + param_escape(navigator.userAgent);
 
-               loading_set_progress(30);
+               loading_set_progress(20);
 
                new Ajax.Request("backend.php", {
                        parameters: "backend.php?op=rpc&subop=sanityCheck" + params,
@@ -305,7 +307,7 @@ function init_second_stage() {
 
                feeds_sort_by_unread = getInitParam("feeds_sort_by_unread") == 1;
 
-               loading_set_progress(60);
+               loading_set_progress(30);
 
                if (has_local_storage())
                        localStorage.clear();
index 286ebf9d970812c284268e53f4380ae08fdbb1a9..8ee817f9051e03762a841702410b4a57886a0681 100644 (file)
 
 <div id="overlay" style="display : block">
        <div id="overlay_inner">
-               <?php echo __("Loading, please wait...") ?>
-
-               <div id="l_progress_o">
-                       <div id="l_progress_i"></div>
+               <div class="insensitive"><?php echo __("Loading, please wait...") ?></div>
+               <div dojoType="dijit.ProgressBar" places="0" style="width : 300px" id="loading_bar"
+            progress="0" maximum="100">
                </div>
-
        <noscript>
                <p>
                <?php print_error(__("Your browser doesn't support Javascript, which is required
index d8448afc70407601d8a7d88ff8b2e63f4b6b2b2b..37a068234eafd1c83bfd3262550ff40a220cbe30 100644 (file)
@@ -35,7 +35,7 @@ function headlines_callback2(transport, feed_cur_page) {
 
                if (!handle_rpc_reply(transport)) return;
 
-               loading_set_progress(100);
+               loading_set_progress(25);
 
                console.log("headlines_callback2 [page=" + feed_cur_page + "]");
 
@@ -193,8 +193,6 @@ function headlines_callback2(transport, feed_cur_page) {
 
                notify("");
 
-               remove_splash();
-
        } catch (e) {
                exception_error("headlines_callback2", e, transport);
        }