From 9932fb068b42bde5aa47637f7fedf5e3b7a0fa94 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 1 Dec 2005 13:43:13 +0100 Subject: [PATCH] hotkey s stars/unstars selected article --- README | 1 + backend.php | 4 ++-- viewfeed.js | 18 ++++++++---------- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/README b/README index 01bb0d26b..2dac46a94 100644 --- a/README +++ b/README @@ -34,6 +34,7 @@ Interface: "a" hides or shows only unread feeds in the feedlist; "j" move to previous feed "k" move to next feed + "s" star/unstar selected article Requirements: diff --git a/backend.php b/backend.php index 9307f78ad..6969b3783 100644 --- a/backend.php +++ b/backend.php @@ -1133,10 +1133,10 @@ if ($line["marked"] == "t" || $line["marked"] == "1") { $marked_pic = "\"Reset"; + alt=\"Reset mark\" onclick='javascript:toggleMark($id)'>"; } else { $marked_pic = "\"Set"; + alt=\"Set mark\" onclick='javascript:toggleMark($id)'>"; } $content_link = "" . diff --git a/viewfeed.js b/viewfeed.js index 4aa7f4f5e..0dae392df 100644 --- a/viewfeed.js +++ b/viewfeed.js @@ -77,13 +77,7 @@ function view(id, feed_id) { } -function rowToggleMark(row) { - - - -} - -function toggleMark(id, toggle) { +function toggleMark(id) { var f_document = parent.frames["feeds-frame"].document; @@ -100,10 +94,10 @@ function toggleMark(id, toggle) { // alert(vfeedu); - if (toggle == true) { + if (mark_img.alt != "Reset mark") { mark_img.src = "images/mark_set.png"; mark_img.alt = "Reset mark"; - mark_img.setAttribute('onclick', 'javascript:toggleMark('+id+', false)'); + mark_img.setAttribute('onclick', 'javascript:toggleMark('+id+')'); query = query + "&mark=1"; if (vfeedu && crow.className.match("Unread")) { @@ -113,7 +107,7 @@ function toggleMark(id, toggle) { } else { mark_img.src = "images/mark_unset.png"; mark_img.alt = "Set mark"; - mark_img.setAttribute('onclick', 'javascript:toggleMark('+id+', true)'); + mark_img.setAttribute('onclick', 'javascript:toggleMark('+id+')'); query = query + "&mark=0"; if (vfeedu && crow.className.match("Unread")) { @@ -224,6 +218,10 @@ function localHotkeyHandler(keycode) { // return viewfeed(active_feed_id, active_offset, "ForceUpdate"); // } + if (keycode == 83) { // s + if (active_post_id) toggleMark(active_post_id); + } + // alert("KC: " + keycode); }