From 37e93d6ccae51c283f3b480195016d749ecab1a5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 13 Oct 2009 19:05:36 +0400 Subject: [PATCH] display special dialog when new articles are available in the current feed instead of reloading it --- feedlist.js | 2 +- functions.js | 23 ++++++++++++++++++++++- tt-rss.css | 18 ++++++++++++++++++ tt-rss.php | 1 + 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/feedlist.js b/feedlist.js index 860122bd..bfd14376 100644 --- a/feedlist.js +++ b/feedlist.js @@ -157,7 +157,7 @@ function viewfeed(feed, subop, is_cat, subop_param, skip_history, offset) { } enableHotkeys(); - + hideAuxDlg(); closeInfoBox(); Form.enable("main_toolbar_form"); diff --git a/functions.js b/functions.js index 22490fd1..fcfddaa5 100644 --- a/functions.js +++ b/functions.js @@ -532,7 +532,7 @@ function parse_counters(reply, scheduled_call) { if (feedctr && feedu && feedr) { if (feedu.innerHTML != ctr && id == getActiveFeedId() && scheduled_call) { - viewCurrentFeed(); + displayNewContentPrompt(id); } var row_needs_hl = (ctr > 0 && ctr > parseInt(feedu.innerHTML)); @@ -2194,4 +2194,25 @@ function hotkey_prefix_timeout() { } } +function hideAuxDlg() { + try { + Element.hide('auxDlg'); + } catch (e) { + exception_error("hideAuxDlg", e); + } +} + +function displayNewContentPrompt(id) { + try { + var msg = __("New articles in «%s». Click to view."); + msg = msg.replace("%s", getFeedName(id)); + + $('auxDlg').innerHTML = msg; + + Element.show('auxDlg'); + + } catch (e) { + exception_error("displayNewContentPrompt", e); + } +} diff --git a/tt-rss.css b/tt-rss.css index 4510ad70..a41d49d7 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -2238,3 +2238,21 @@ div#cmdline { height : 18px; width : 18px; } + +div#auxDlg { + position : absolute; + z-index : 3; + bottom : 10px; + right : 10px; + padding : 5px; + border-width : 1px; + border-style : solid; + border-color : #d7c47a; + background-color : #fff7d5; + color : black; + text-align : center; +} + +div#auxDlg a { + color : #4684ff; +} diff --git a/tt-rss.php b/tt-rss.php index 1dcee23a..7b87c320 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -105,6 +105,7 @@ window.onload = init; +