From fcc3674439275d62fd007d34e61bf0cbaa7c910b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 19 Nov 2010 16:08:02 +0300 Subject: [PATCH] rework loading progressbar --- feedlist.js | 3 --- functions.js | 21 +++++++-------------- prefs.js | 11 +++-------- prefs.php | 8 +++----- tt-rss.css | 4 ++-- tt-rss.js | 6 ++++-- tt-rss.php | 8 +++----- viewfeed.js | 4 +--- 8 files changed, 23 insertions(+), 42 deletions(-) diff --git a/feedlist.js b/feedlist.js index 734fddaee..1f4819a35 100644 --- a/feedlist.js +++ b/feedlist.js @@ -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(); } } diff --git a/functions.js b/functions.js index 527a6f817..48a9ef230 100644 --- a/functions.js +++ b/functions.js @@ -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"); diff --git a/prefs.js b/prefs.js index 0c627b219..5d9107f97 100644 --- 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"; diff --git a/prefs.php b/prefs.php index 0e48665b3..972e577ca 100644 --- a/prefs.php +++ b/prefs.php @@ -65,12 +65,10 @@
- - -
-
+
+
-