]> git.wh0rd.org - tt-rss.git/commitdiff
add toplink images to restart in offline or online mode
authorAndrew Dolgov <fox@bah.org.ru>
Wed, 4 Feb 2009 19:47:26 +0000 (22:47 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Wed, 4 Feb 2009 19:47:26 +0000 (22:47 +0300)
images/offline.png [new file with mode: 0755]
images/online.png [new file with mode: 0755]
offline.js
tt-rss.css
tt-rss.php

diff --git a/images/offline.png b/images/offline.png
new file mode 100755 (executable)
index 0000000..7a82917
Binary files /dev/null and b/images/offline.png differ
diff --git a/images/online.png b/images/online.png
new file mode 100755 (executable)
index 0000000..749a416
Binary files /dev/null and b/images/online.png differ
index 73d70f39b922caf744a076a810f644e744aebf3f..8290a2fc44f086612bc6be1ff4377d92b9092dfa 100644 (file)
@@ -453,12 +453,12 @@ function init_offline() {
                Element.hide("dispSwitchPrompt");
                Element.hide("feedBrowserPrompt");
 
+               Element.hide("topLinksOnline");
+               Element.show("topLinksOffline");
+
                var tb_form = document.getElementById("main_toolbar_form");
                Element.hide(tb_form.update);
 
-               var top_links = document.getElementById("topLinks");
-               top_links.innerHTML = __("Offline mode");
-
                var chooser = document.getElementById("quickMenuChooser");
                chooser.disabled = true;
 
@@ -728,8 +728,10 @@ function init_gears() {
                        db.execute("CREATE TABLE IF NOT EXISTS feeds (id integer, title text, has_icon integer)");
                        db.execute("CREATE TABLE IF NOT EXISTS articles (id integer, feed_id integer, title text, link text, guid text, updated text, content text, tags text, unread text, marked text, added text, comments text)");
 
-
                        db.execute("DELETE FROM cache WHERE id LIKE 'F:%' OR id LIKE 'C:%'");
+
+                       Element.show("restartOfflinePic");
+
                }       
        
                cache_expire();
@@ -739,4 +741,11 @@ function init_gears() {
        }
 }
 
+function gotoOffline() {
+       window.location.href = "tt-rss.php?offline=1";
+}
+
+function gotoOnline() {
+       window.location.href = "tt-rss.php";
+}
 
index 95938bc910cb02a89e5f4725b8593526f83c9847..bf087b8dd25340ccf41a2fe5a907e8c4f46e2d65 100644 (file)
@@ -1698,10 +1698,13 @@ a.feedUpdErrLink {
        display : none;
 }
 
-#newVersionIcon {
+div.topLinks img {
        vertical-align : middle;
        cursor : pointer;
-       margin-left : 10px;
+}
+
+#restartOfflinePic {
+       margin-left : 5px;
 }
 
 a.helpLinkPic {
index 38a2c32f9ff1473f8e2d29922d03bb03025aa3f7..f4cb835495b8f3f98fd31b5283b0e385eec2b91e 100644 (file)
@@ -115,6 +115,8 @@ window.onload = init;
 <div id="header">
        <div class="topLinks" id="topLinks">
 
+       <span id="topLinksOnline">
+
        <?php if (!SINGLE_USER_MODE) { ?>
                        <?php echo __('Hello,') ?> <b><?php echo $_SESSION["name"] ?></b> |
        <?php } ?>
@@ -129,11 +131,24 @@ window.onload = init;
                        | <a href="logout.php"><?php echo __('Logout') ?></a>
        <?php } ?>
 
+       <img id="restartOfflinePic" src="images/offline.png" style="display:none"
+               onclick="gotoOffline()"
+               title="<?php echo __('Restart in offline mode') ?>"/>
+
        <img id="newVersionIcon" style="display:none;" onclick="javascript:explainError(2)" 
                src="images/new_version.png" title="<?php echo __('New version of Tiny Tiny RSS is available!') ?>" 
                alt="new_version_icon"/>
 
+       </span>
+
+       <span id="topLinksOffline" style="display : none">
+               <img id="restartOnlinePic" src="images/online.png" 
+                       onclick="gotoOnline()"
+                       title="<?php echo __('Restart in online mode') ?>"/>
+       </span>
+
        </div>
+
        <img src="<?php echo $theme_image_path ?>images/ttrss_logo.png" alt="Tiny Tiny RSS"/>   
 </div>