]> git.wh0rd.org Git - tt-rss.git/commitdiff
more piggies! I demand MORE piggies!!!
authorAndrew Dolgov <fox@madoka.spb.ru>
Thu, 25 Aug 2005 06:57:51 +0000 (07:57 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Thu, 25 Aug 2005 06:57:51 +0000 (07:57 +0100)
backend.php
functions.js
prefs.js
tt-rss.js

index fc973edb8fa0af6f19c00002b07c4c9b82b52f41..2f88e815e440ea41ff8799f6384590084a6de097 100644 (file)
@@ -40,6 +40,8 @@
                
                        $feed = $line["title"];
                        $feed_id = $line["id"];   
+
+                       $subop = $_GET["subop"];
                        
                        $total = $line["total"];
                        $unread = $line["unread"];
                        print "<tr class=\"$class\" id=\"FEEDR-$feed_id\">";
 
                        $icon_file = ICONS_DIR . "/$feed_id.ico";
-       
-                       if (file_exists($icon_file) && filesize($icon_file) > 0) {
-                               $feed_icon = "<img width=\"16\" height=\"16\"
-                                       src=\"" . ICONS_URL . "/$feed_id.ico\">";
+
+                       if ($subop != "piggie") {
+
+                               if (file_exists($icon_file) && filesize($icon_file) > 0) {
+                                               $feed_icon = "<img width=\"16\" height=\"16\"
+                                                       src=\"" . ICONS_URL . "/$feed_id.ico\">";
+                               } else {
+                                       $feed_icon = "&nbsp;";
+                               }
                        } else {
-                               $feed_icon = "&nbsp;";
+                               $feed_icon = "<img width=\"16\" height=\"16\"
+                                       src=\"http://madoka.spb.ru/stuff/fox/tiny_piggie.png\">";
                        }
-                       
+               
                        $feed = "<a href=\"javascript:viewfeed($feed_id, 0);\">$feed</a>";
                        if (ENABLE_FEED_ICONS) {
                                print "<td>$feed_icon</td>";
index b634974abf2475a12eb3d3b151d345eba60c8541..8cd5b47cae976467f3e3dc9ec21a29509332060d 100644 (file)
@@ -39,4 +39,32 @@ function printLockingError() {
        notify("Please wait until operation finishes");
 }
 
+var seq = "";
+
+function hotkey_handler(e) {
+       var keycode;
+
+       if (window.event) {
+               keycode = window.event.keyCode;
+       } else if (e) {
+               keycode = e.which;
+       }
+
+       if (keycode == 13 || keycode == 27) {
+               seq = "";
+       } else {
+               seq = seq + "" + keycode;
+       }
+
+       var piggie = document.getElementById("piggie");
+
+       if (seq.match("807371717369")) {
+               localPiggieFunction(true);
+       } else {
+               localPiggieFunction(false);
+       }
+
+}
+
+
 
index c01ba4ebbd85b50ec5aebfeabcc9403031ec4185..a9701dd32818f0ba30fbcab0cfefa5bfb80406b8 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -263,26 +263,8 @@ function editSelectedFeed() {
 
 }
 
-var seq = "";
-
-function hotkey_handler(e) {
-       var keycode;
-
-       if (window.event) {
-               keycode = window.event.keyCode;
-       } else if (e) {
-               keycode = e.which;
-       }
-
-       if (keycode == 13 || keycode == 27) {
-               seq = "";
-       } else {
-               seq = seq + "" + keycode;
-       }
-
-       var piggie = document.getElementById("piggie");
-
-       if (seq.match("807371717369")) {
+function localPiggieFunction(enable) {
+       if (enable) {
                piggie.style.display = "block";
                seq = "";
                notify("I loveded it!!!");
@@ -290,7 +272,6 @@ function hotkey_handler(e) {
                piggie.style.display = "none";
                notify("");
        }
-
 }
 
 function init() {
index 1776c1c3314fd67e845ce48e2136191969f297c6..455a202c931b53608eb5bab20fd9579196067feb 100644 (file)
--- a/tt-rss.js
+++ b/tt-rss.js
@@ -307,7 +307,22 @@ function update_title() {
        //document.title = "Tiny Tiny RSS (" + total_unread + " unread)";
 }
 
+function localPiggieFunction(enable) {
+       if (enable) {
+               var query_str = "backend.php?op=feeds&subop=piggie";
+
+               if (xmlhttp.readyState == 4 || xmlhttp.readyState == 0) {
+
+                       xmlhttp.open("GET", query_str, true);
+                       xmlhttp.onreadystatechange=feedlist_callback;
+                       xmlhttp.send(null);
+               }
+       }
+}
+
+
 function init() {
        updateFeedList(false, false);
+       document.onkeydown = hotkey_handler;
        setTimeout("timeout()", 1800*1000);
 }