From 71ad883b287330de0ce2fa67b63141c56fad8930 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 23 May 2006 10:08:16 +0100 Subject: [PATCH] toggle no daemon warning @ runtime on refetch --- functions.php | 6 ++++-- tt-rss.css | 3 ++- tt-rss.js | 22 ++++++++++++++++++++++ tt-rss.php | 12 +++++------- 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/functions.php b/functions.php index fbce56b5..e4dc5e10 100644 --- a/functions.php +++ b/functions.php @@ -1721,8 +1721,10 @@ function print_runtime_info($link) { print ""; - print ""; + if (ENABLE_UPDATE_DAEMON) { + print ""; + } print ""; } ?> diff --git a/tt-rss.css b/tt-rss.css index e7cd6870..5cdab4f0 100644 --- a/tt-rss.css +++ b/tt-rss.css @@ -1090,13 +1090,14 @@ a.cdmToggleLink:hover { font-weight : normal; } -div.noDaemonWarning { +#noDaemonWarning { position : absolute; background-color : #ecf4ff; border : 1px solid #88b0f0; padding : 10px; margin : 5px; z-index : 2; + display : none; } #qafInput { diff --git a/tt-rss.js b/tt-rss.js index 7157d329..0b00737a 100644 --- a/tt-rss.js +++ b/tt-rss.js @@ -75,6 +75,10 @@ function refetch_callback() { parse_counters(counters, true); + var runtime_info = counters.nextSibling; + + parse_runtime_info(runtime_info); + debug("refetch_callback: done"); if (!daemon_enabled) { @@ -513,4 +517,22 @@ function toggleDispRead() { } } +function parse_runtime_info(elem) { + var param = elem.firstChild; + + while (param) { + var k = param.getAttribute("key"); + var v = param.getAttribute("value"); + var w = document.getElementById("noDaemonWarning"); + + if (w) { + if (k == "daemon_is_running" && v != 1) { + w.style.display = "block"; + } else { + w.style.display = "none"; + } + } + param = param.nextSibling; + } +} diff --git a/tt-rss.php b/tt-rss.php index c4052156..2bfd505d 100644 --- a/tt-rss.php +++ b/tt-rss.php @@ -79,13 +79,11 @@ if (document.addEventListener) { window.onload = init; - -
- Warning: Update daemon is enabled in configuration, but daemon - process is not running, which prevents all feeds from updating. Please - start the daemon process or contact instance owner. -
- +
+ Warning: Update daemon is enabled in configuration, but daemon + process is not running, which prevents all feeds from updating. Please + start the daemon process or contact instance owner. +
-- 2.39.5