summaryrefslogtreecommitdiff
path: root/tt-rss.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2005-10-23 16:40:55 +0100
committerAndrew Dolgov <[email protected]>2005-10-23 16:40:55 +0100
commitfc69e64169acac42622be2fcf3fba14711b11768 (patch)
treec881dfaf846c9bbefce55fe2f35703d02096973e /tt-rss.js
parentbdd01d3f31b2ab7529bd8d7365a3b0e15b95cb9b (diff)
start work on showing number of unread articles in title
Diffstat (limited to 'tt-rss.js')
-rw-r--r--tt-rss.js36
1 files changed, 33 insertions, 3 deletions
diff --git a/tt-rss.js b/tt-rss.js
index a760c4c12..a27e8dee5 100644
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -13,6 +13,8 @@ var search_mode = "";
var display_tags = false;
+var global_unread = 0;
+
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
@@ -68,8 +70,7 @@ function feedlist_callback() {
function refetch_callback() {
if (xmlhttp.readyState == 4) {
- document.title = "Tiny Tiny RSS";
- notify("All feeds updated.");
+// document.title = "Tiny Tiny RSS";
if (!xmlhttp.responseXML) {
notify("refetch_callback: backend did not return valid XML");
@@ -93,6 +94,13 @@ function refetch_callback() {
var feedu = f_document.getElementById("FEEDU-" + id);
var feedr = f_document.getElementById("FEEDR-" + id);
+/* TODO figure out how to update this from viewfeed.js->view()
+ disabled for now...
+
+ if (id == "global-unread") {
+ global_unread = ctr;
+ } */
+
if (feedctr && feedu && feedr) {
feedu.innerHTML = ctr;
@@ -108,6 +116,10 @@ function refetch_callback() {
}
}
}
+
+ updateTitle("");
+ notify("All feeds updated.");
+
}
}
@@ -129,7 +141,9 @@ function scheduleFeedUpdate(force) {
notify("Updating feeds in background...");
- document.title = "Tiny Tiny RSS - Updating...";
+// document.title = "Tiny Tiny RSS - Updating...";
+
+ updateTitle("Updating...");
var query_str = "backend.php?op=rpc&subop=";
@@ -181,6 +195,9 @@ function catchupAllFeeds() {
feeds_frame.src = query_str;
+ global_unread = 0;
+ updateTitle();
+
}
function viewCurrentFeed(skip, subop) {
@@ -341,6 +358,19 @@ function localHotkeyHandler(keycode) {
}
+function updateTitle(s) {
+ var tmp = "Tiny Tiny RSS";
+
+ if (global_unread > 0) {
+ tmp = tmp + " (" + global_unread + ")";
+ }
+
+ if (s) {
+ tmp = tmp + " - " + s;
+ }
+ document.title = tmp;
+}
+
function genericSanityCheck() {
if (!xmlhttp) {