From 4f3a84f4d336a6d9bb1172873a063ff8a8b390ec Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 25 Nov 2005 16:38:08 +0100 Subject: cleaned up unread/selected style mess --- prefs.js | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) (limited to 'prefs.js') diff --git a/prefs.js b/prefs.js index c000ca19b..04dd88c7e 100644 --- a/prefs.js +++ b/prefs.js @@ -448,7 +448,7 @@ function getSelectedFeedCats() { } -function readSelectedFeeds() { +function readSelectedFeeds(read) { if (!xmlhttp_ready(xmlhttp)) { printLockingError(); @@ -459,34 +459,15 @@ function readSelectedFeeds() { if (sel_rows.length > 0) { - notify("Marking selected feeds as read..."); - - xmlhttp.open("GET", "backend.php?op=pref-rpc&subop=unread&ids="+ - param_escape(sel_rows.toString()), true); - xmlhttp.onreadystatechange=notify_callback; - xmlhttp.send(null); - - } else { - - notify("Please select some feeds first."); - - } -} - -function unreadSelectedFeeds() { - - if (!xmlhttp_ready(xmlhttp)) { - printLockingError(); - return - } - - var sel_rows = getSelectedFeeds(); - - if (sel_rows.length > 0) { + if (!read) { + op = "unread"; + } else { + op = "read"; + } - notify("Marking selected feeds as unread..."); + notify("Marking selected feeds as " + op + "..."); - xmlhttp.open("GET", "backend.php?op=pref-rpc&subop=unread&ids="+ + xmlhttp.open("GET", "backend.php?op=pref-rpc&subop=" + op + "&ids="+ param_escape(sel_rows.toString()), true); xmlhttp.onreadystatechange=notify_callback; xmlhttp.send(null); -- cgit v1.2.3