From 730dbf19107d42e1a6568ac7057375b9a2e58e9e Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 19 May 2008 08:37:44 +0100 Subject: [PATCH] loading progress bar for main window --- feedlist.js | 22 ++++++++++++++++++++-- functions.js | 19 +++++++++++++++++++ tt-rss.css | 14 +++++++++++++- tt-rss.js | 4 ++++ tt-rss.php | 7 ++++++- viewfeed.js | 7 ++++++- 6 files changed, 68 insertions(+), 5 deletions(-) diff --git a/feedlist.js b/feedlist.js index 3f82993d4..b222c9bdb 100644 --- a/feedlist.js +++ b/feedlist.js @@ -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!"); + } +} diff --git a/functions.js b/functions.js index f716f350e..c37a7812c 100644 --- a/functions.js +++ b/functions.js @@ -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); + } +} diff --git a/tt-rss.css b/tt-rss.css index f0ed5d6f5..dafb9db4f 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -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; +} diff --git a/tt-rss.js b/tt-rss.js index 57315b4e5..538a318d9 100644 --- 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); } diff --git a/tt-rss.php b/tt-rss.php index 226117ff7..d5fd39fe4 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -72,7 +72,12 @@
-

+ + +
+
+
+