]> git.wh0rd.org Git - tt-rss.git/commitdiff
fix broken piggie
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 12 Aug 2006 14:57:13 +0000 (15:57 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 12 Aug 2006 14:57:13 +0000 (15:57 +0100)
functions.js
images/piggie.png [new file with mode: 0644]
prefs.js
prefs.php
tt-rss.css

index 495bcd6464cf2bbe9c997e529361dc99e150410d..9e941ad3bd98b7554bc92d3b84d386200fb8a4bd 100644 (file)
@@ -151,8 +151,6 @@ function notify(msg, no_hide, is_err) {
 function printLockingError() {
        notify("Please wait until operation finishes");}
 
-var seq = "";
-
 function hotkey_handler(e) {
 
        try {
@@ -172,11 +170,11 @@ function hotkey_handler(e) {
                } else {
                        seq = seq + "" + keycode;
                }
-       
+
                var m_ctx = getMainContext();
                var f_ctx = getFeedsContext();
                var h_ctx = getHeadlinesContext();
-       
+
                if (keycode == 82) { // r
                        return m_ctx.scheduleFeedUpdate(true);
                }
@@ -216,16 +214,6 @@ function hotkey_handler(e) {
        
                if (keycode == 80 || keycode == 38) { // p, up
                        return h_ctx.moveToPost('prev');
-               } 
-       
-               if (document.getElementById("piggie")) {
-       
-                       if (seq.match("807371717369")) {
-                               seq = "";
-                               localPiggieFunction(true);
-                       } else {
-                               localPiggieFunction(false);
-                       }
                }
                
                if (typeof localHotkeyHandler != 'undefined') {
diff --git a/images/piggie.png b/images/piggie.png
new file mode 100644 (file)
index 0000000..f3682db
Binary files /dev/null and b/images/piggie.png differ
index 0b15d8a108f304f19b0dca952af34390a95cb3e6..11743d2cc36364fd3aeb43cfb84d8854f3940bfc 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -1058,6 +1058,7 @@ function piggie2_callback() {
 
 function localPiggieFunction(enable) {
        if (enable) {
+               debug("I LOVEDED IT!");
                var piggie = document.getElementById("piggie");
                piggie.style.display = "block";
 
@@ -1252,6 +1253,8 @@ function init_second_stage() {
                active_tab = getInitParam("prefs_active_tab");
                if (!active_tab) active_tab = "genConfig";
 
+               document.onkeydown = pref_hotkey_handler;
+
                if (navigator.userAgent.match("Opera")) {       
                        setTimeout("selectTab()", 500);
                } else {
@@ -1503,3 +1506,42 @@ function toggleSelectFBListRow(sender) {
        toggleSelectListRow(sender);
        disableContainerChildren("fbrOpToolbar", getSelectedFeedsFromBrowser() == 0);
 }
+
+var seq = "";
+
+function pref_hotkey_handler(e) {
+       try {
+
+               var keycode;
+       
+               if (!hotkeys_enabled) return;
+       
+               if (window.event) {
+                       keycode = window.event.keyCode;
+               } else if (e) {
+                       keycode = e.which;
+               }
+       
+               if (keycode == 13 || keycode == 27) {
+                       seq = "";
+               } else {
+                       seq = seq + "" + keycode;
+               }
+
+
+       if (document.getElementById("piggie")) {
+       
+               if (seq.match("807371717369")) {
+                       seq = "";
+                       localPiggieFunction(true);
+               } else {
+                       localPiggieFunction(false);
+               }
+       }
+
+       } catch (e) {
+               exception_error("pref_hotkey_handler", e);
+       }
+}
+
+
index ddb94f004b7b1c09a1c7d8872637ca545e33d693..a5efa356ffd12b8a912572df4abfd2e940cd603d 100644 (file)
--- a/prefs.php
+++ b/prefs.php
@@ -70,7 +70,7 @@
 
 <body>
 
-<div id="piggie" class="invisible">&nbsp;</div>
+<div id="piggie">&nbsp;</div>
 
 <iframe id="backReqBox"></iframe>
 
index 8d29213ba27efca0d4a496a0997a7171d62c2d99..4a4242bbc07c309927d724aecbf590fb80411326 100644 (file)
@@ -265,9 +265,9 @@ a:hover {
        right : 0;
        top : -400;
        background-color : white;
-       display : none;
-       z-index : 3;
-       background-image : url("http://madoka.spb.ru/stuff/fox/piggie.png");
+       display : block;
+       z-index : 999;
+       background-image : url("images/piggie.png");
        background-position : center center;
        background-repeat : no-repeat;
        position : absolute;