From 1cac3c31bcf6fcdc8ea4498450e2eda783b4063d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 25 Feb 2006 06:54:53 +0100 Subject: [PATCH] total pigcall (closes #42) --- functions.js | 14 +++++--------- prefs.js | 30 +++++++++++++++++++++++++----- prefs.php | 2 ++ tt-rss.css | 3 ++- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/functions.js b/functions.js index 26db6bb5f..e71e748e9 100644 --- a/functions.js +++ b/functions.js @@ -129,15 +129,11 @@ function hotkey_handler(e) { seq = seq + "" + keycode; } - var piggie = document.getElementById("piggie"); - - if (piggie) { - - if (seq.match("807371717369")) { - localPiggieFunction(true); - } else { - localPiggieFunction(false); - } + if (seq.match("807371717369")) { + seq = ""; + localPiggieFunction(true); + } else { + localPiggieFunction(false); } if (typeof localHotkeyHandler != 'undefined') { diff --git a/prefs.js b/prefs.js index 3aa769e5c..67eb3def0 100644 --- a/prefs.js +++ b/prefs.js @@ -8,6 +8,9 @@ var active_user = false; var active_tab = false; var feed_to_expand = false; +var piggie_top = -400; +var piggie_fwd = true; + /*@cc_on @*/ /*@if (@_jscript_version >= 5) // JScript gives us Conditional compilation, we can cope with old IE versions. @@ -1141,14 +1144,31 @@ function editSelectedFeedCat() { } +function piggie_callback() { + var piggie = document.getElementById("piggie"); + + piggie.style.top = piggie_top; + + if (piggie_fwd && piggie_top < 0) { + setTimeout("piggie_callback()", 50); + piggie_top = piggie_top + 10; + } else if (piggie_fwd && piggie_top >= 0) { + piggie_fwd = false; + setTimeout("piggie_callback()", 50); + } else if (!piggie_fwd && piggie_top > -400) { + setTimeout("piggie_callback()", 50); + piggie_top = piggie_top - 10; + } else if (!piggie_fwd && piggie_top <= -400) { + piggie.style.display = "none"; + piggie_fwd = true; + } +} + function localPiggieFunction(enable) { if (enable) { + var piggie = document.getElementById("piggie"); piggie.style.display = "block"; - seq = ""; - notify("I loveded it!!!"); - } else { - piggie.style.display = "none"; - notify(""); + piggie_callback(); } } diff --git a/prefs.php b/prefs.php index 75370f9f6..8235805d5 100644 --- a/prefs.php +++ b/prefs.php @@ -49,6 +49,8 @@ + +