fix broken piggie

This commit is contained in:
Andrew Dolgov 2006-08-12 15:57:13 +01:00
parent 9e397d0f5a
commit d437c8cf56
5 changed files with 48 additions and 18 deletions

View File

@ -151,8 +151,6 @@ function notify(msg, no_hide, is_err) {
function printLockingError() { function printLockingError() {
notify("Please wait until operation finishes");} notify("Please wait until operation finishes");}
var seq = "";
function hotkey_handler(e) { function hotkey_handler(e) {
try { try {
@ -172,11 +170,11 @@ function hotkey_handler(e) {
} else { } else {
seq = seq + "" + keycode; seq = seq + "" + keycode;
} }
var m_ctx = getMainContext(); var m_ctx = getMainContext();
var f_ctx = getFeedsContext(); var f_ctx = getFeedsContext();
var h_ctx = getHeadlinesContext(); var h_ctx = getHeadlinesContext();
if (keycode == 82) { // r if (keycode == 82) { // r
return m_ctx.scheduleFeedUpdate(true); return m_ctx.scheduleFeedUpdate(true);
} }
@ -216,16 +214,6 @@ function hotkey_handler(e) {
if (keycode == 80 || keycode == 38) { // p, up if (keycode == 80 || keycode == 38) { // p, up
return h_ctx.moveToPost('prev'); return h_ctx.moveToPost('prev');
}
if (document.getElementById("piggie")) {
if (seq.match("807371717369")) {
seq = "";
localPiggieFunction(true);
} else {
localPiggieFunction(false);
}
} }
if (typeof localHotkeyHandler != 'undefined') { if (typeof localHotkeyHandler != 'undefined') {

BIN
images/piggie.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -1058,6 +1058,7 @@ function piggie2_callback() {
function localPiggieFunction(enable) { function localPiggieFunction(enable) {
if (enable) { if (enable) {
debug("I LOVEDED IT!");
var piggie = document.getElementById("piggie"); var piggie = document.getElementById("piggie");
piggie.style.display = "block"; piggie.style.display = "block";
@ -1252,6 +1253,8 @@ function init_second_stage() {
active_tab = getInitParam("prefs_active_tab"); active_tab = getInitParam("prefs_active_tab");
if (!active_tab) active_tab = "genConfig"; if (!active_tab) active_tab = "genConfig";
document.onkeydown = pref_hotkey_handler;
if (navigator.userAgent.match("Opera")) { if (navigator.userAgent.match("Opera")) {
setTimeout("selectTab()", 500); setTimeout("selectTab()", 500);
} else { } else {
@ -1503,3 +1506,42 @@ function toggleSelectFBListRow(sender) {
toggleSelectListRow(sender); toggleSelectListRow(sender);
disableContainerChildren("fbrOpToolbar", getSelectedFeedsFromBrowser() == 0); 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);
}
}

View File

@ -70,7 +70,7 @@
<body> <body>
<div id="piggie" class="invisible">&nbsp;</div> <div id="piggie">&nbsp;</div>
<iframe id="backReqBox"></iframe> <iframe id="backReqBox"></iframe>

View File

@ -265,9 +265,9 @@ a:hover {
right : 0; right : 0;
top : -400; top : -400;
background-color : white; background-color : white;
display : none; display : block;
z-index : 3; z-index : 999;
background-image : url("http://madoka.spb.ru/stuff/fox/piggie.png"); background-image : url("images/piggie.png");
background-position : center center; background-position : center center;
background-repeat : no-repeat; background-repeat : no-repeat;
position : absolute; position : absolute;