summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2008-05-19 08:37:44 +0100
committerAndrew Dolgov <[email protected]>2008-05-19 08:37:44 +0100
commit730dbf19107d42e1a6568ac7057375b9a2e58e9e (patch)
treef924daca27e77bcaf79ba1052ed3b5cda0411584
parent36cebe0f8da738414e0256f433e9422f25b79605 (diff)
loading progress bar for main window
-rw-r--r--feedlist.js22
-rw-r--r--functions.js19
-rw-r--r--tt-rss.css14
-rw-r--r--tt-rss.js4
-rw-r--r--tt-rss.php7
-rw-r--r--viewfeed.js7
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 @@
<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
diff --git a/viewfeed.js b/viewfeed.js
index da03a6a2d..24f3636fb 100644
--- a/viewfeed.js
+++ b/viewfeed.js
@@ -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);
}