]> git.wh0rd.org - tt-rss.git/commitdiff
toggle no daemon warning @ runtime on refetch
authorAndrew Dolgov <fox@madoka.spb.ru>
Tue, 23 May 2006 09:08:16 +0000 (10:08 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Tue, 23 May 2006 09:08:16 +0000 (10:08 +0100)
functions.php
tt-rss.css
tt-rss.js
tt-rss.php

index fbce56b5ed9e4cb3e4fc3eb8968f956425ca3df5..e4dc5e10bbccf49e2ccd8cb9074055b0e1ea7f5a 100644 (file)
 
        function print_runtime_info($link) {
                print "<runtime-info>";
-               print "<param key=\"daemon_is_running\" value=\"".
-                       sprintf("%d", file_is_locked("update_daemon.lock")) . "\"/>";
+               if (ENABLE_UPDATE_DAEMON) {
+                       print "<param key=\"daemon_is_running\" value=\"".
+                               sprintf("%d", file_is_locked("update_daemon.lock")) . "\"/>";
+               }
                print "</runtime-info>";
        }
 ?>
index e7cd687022b0814eac4e326798785d72052bee0e..5cdab4f0c77a176bc0d4526ab715758027e90509 100644 (file)
@@ -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 {
index 7157d3292ef8f03ca625816d53e4922b49f12adf..0b00737af290645d30b095b92b6a69b70dab218e 100644 (file)
--- 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;
+       }
+}
index c405215639114a3c5bf2b1d95118c02de6128373..2bfd505dea3d60a3f847d879591841dce6a6769b 100644 (file)
@@ -79,13 +79,11 @@ if (document.addEventListener) {
 window.onload = init;
 </script>
 
-<? if (ENABLE_UPDATE_DAEMON && !file_is_locked("update_daemon.lock")) { ?>
-       <div class="noDaemonWarning">
-               <b>Warning:</b> 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.
-       </div>
-<? } ?>
+<div id="noDaemonWarning">
+       <b>Warning:</b> 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.
+</div>
 
 <ul id="debug_output"></ul>