]> git.wh0rd.org - tt-rss.git/blobdiff - prefs.js
tweak README
[tt-rss.git] / prefs.js
index 04b3138367697969974506028717bb7a1e10a728..404602c33b9b2aa635b54a331446d01fa1ce7b58 100644 (file)
--- a/prefs.js
+++ b/prefs.js
@@ -1,8 +1,3 @@
-/*
-       This program is Copyright (c) 2003-2005 Andrew Dolgov <cthulhoo@gmail.com>              
-       Licensed under GPL v.2 or (at your preference) any later version.
-*/
-
 var xmlhttp = false;
 
 var active_feed = false;
@@ -448,7 +443,7 @@ function getSelectedFeedCats() {
 }
 
 
-function readSelectedFeeds() {
+function readSelectedFeeds(read) {
 
        if (!xmlhttp_ready(xmlhttp)) {
                printLockingError();
@@ -459,34 +454,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);
@@ -706,6 +682,19 @@ function feedEditSave() {
 
 }
 
+function labelTest() {
+
+       var sqlexp = document.getElementById("iedit_expr").value;
+       var descr = document.getElementById("iedit_descr").value;
+
+       xmlhttp.open("GET", "backend.php?op=pref-labels&subop=test&expr=" +
+               param_escape(sqlexp) + "&descr=" + param_escape(descr), true);
+
+       xmlhttp.onreadystatechange=infobox_callback;
+       xmlhttp.send(null);
+
+}
+
 function labelEditCancel() {
 
        if (!xmlhttp_ready(xmlhttp)) {