more piggies! I demand MORE piggies!!!

This commit is contained in:
Andrew Dolgov 2005-08-25 07:57:51 +01:00
parent 7880091293
commit 13ad91024c
4 changed files with 59 additions and 27 deletions

View File

@ -40,6 +40,8 @@
$feed = $line["title"]; $feed = $line["title"];
$feed_id = $line["id"]; $feed_id = $line["id"];
$subop = $_GET["subop"];
$total = $line["total"]; $total = $line["total"];
$unread = $line["unread"]; $unread = $line["unread"];
@ -53,14 +55,20 @@
print "<tr class=\"$class\" id=\"FEEDR-$feed_id\">"; print "<tr class=\"$class\" id=\"FEEDR-$feed_id\">";
$icon_file = ICONS_DIR . "/$feed_id.ico"; $icon_file = ICONS_DIR . "/$feed_id.ico";
if (file_exists($icon_file) && filesize($icon_file) > 0) { if ($subop != "piggie") {
$feed_icon = "<img width=\"16\" height=\"16\"
src=\"" . ICONS_URL . "/$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\">";
} else {
$feed_icon = "&nbsp;";
}
} else { } 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>"; $feed = "<a href=\"javascript:viewfeed($feed_id, 0);\">$feed</a>";
if (ENABLE_FEED_ICONS) { if (ENABLE_FEED_ICONS) {
print "<td>$feed_icon</td>"; print "<td>$feed_icon</td>";

View File

@ -39,4 +39,32 @@ function printLockingError() {
notify("Please wait until operation finishes"); 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);
}
}

View File

@ -263,26 +263,8 @@ function editSelectedFeed() {
} }
var seq = ""; function localPiggieFunction(enable) {
if (enable) {
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")) {
piggie.style.display = "block"; piggie.style.display = "block";
seq = ""; seq = "";
notify("I loveded it!!!"); notify("I loveded it!!!");
@ -290,7 +272,6 @@ function hotkey_handler(e) {
piggie.style.display = "none"; piggie.style.display = "none";
notify(""); notify("");
} }
} }
function init() { function init() {

View File

@ -307,7 +307,22 @@ function update_title() {
//document.title = "Tiny Tiny RSS (" + total_unread + " unread)"; //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() { function init() {
updateFeedList(false, false); updateFeedList(false, false);
document.onkeydown = hotkey_handler;
setTimeout("timeout()", 1800*1000); setTimeout("timeout()", 1800*1000);
} }