]> git.wh0rd.org - tt-rss.git/blobdiff - functions.js
cdm tweaks, misc fixes
[tt-rss.git] / functions.js
index 3fa3d5e5332dacddf61d89425ad9d5ab6e9403cc..26f3f4bfb1e972255913626d5d80e429b26e3cb1 100644 (file)
@@ -237,6 +237,18 @@ function hotkey_handler(e) {
                        debug_mode_enabled = !debug_mode_enabled;
                }
 
+               if (keycode == 190 && shift_key) { // >
+                       viewFeedGoPage(1);
+               }
+               
+               if (keycode == 188 && shift_key) { // <
+                       viewFeedGoPage(-1);
+               }
+
+               if (keycode == 191 && shift_key) { // ?
+                       viewFeedGoPage(0);
+               }
+
                if (keycode == 69 && shift_key) {
                        return editFeedDlg(getActiveFeedId());
                }
@@ -529,7 +541,12 @@ function parse_counters(reply, scheduled_call) {
                        if (t == "category") {
                                var catctr = document.getElementById("FCATCTR-" + id);
                                if (catctr) {
-                                       catctr.innerHTML = "(" + ctr + " unread)";
+                                       catctr.innerHTML = "(" + ctr + ")";
+                                       if (ctr > 0) {
+                                               catctr.className = "catCtrHasUnread";
+                                       } else {
+                                               catctr.className = "catCtrNoUnread";
+                                       }
                                }
                                continue;
                        }
@@ -613,7 +630,7 @@ function parse_counters(reply, scheduled_call) {
        }
 }
 
-function parse_counters_reply(xmlhttp) {
+function parse_counters_reply(xmlhttp, scheduled_call) {
 
        if (!xmlhttp.responseXML) {
                notify("refetch_callback: backend did not return valid XML", true, true);
@@ -648,7 +665,7 @@ function parse_counters_reply(xmlhttp) {
 
        var counters = reply.firstChild;
        
-       parse_counters(counters, true);
+       parse_counters(counters, scheduled_call);
 
        var runtime_info = counters.nextSibling;
 
@@ -777,6 +794,14 @@ function update_all_counters(feed) {
                        query = query + "&aid=" + feed;
                }
 
+               if (tagsAreDisplayed()) {
+                       query = query + "&omode=lt";
+               } else {
+                       query = query + "&omode=flc";
+               }
+
+               debug("update_all_counters QUERY: " + query);
+
                xmlhttp_rpc.open("GET", query, true);
                xmlhttp_rpc.onreadystatechange=all_counters_callback;
                xmlhttp_rpc.send(null);
@@ -1514,3 +1539,40 @@ function getFeedName(id, is_cat) {
 function viewContentUrl(url) {
        getContentContext().location = url;
 }
+
+function filterDlgCheckAction(sender) {
+
+       try {
+
+               var action = sender[sender.selectedIndex].value;
+
+               var form = document.forms["filter_add_form"];
+       
+               if (!form) {
+                       form = document.forms["filter_edit_form"];
+               }
+
+               if (!form) {
+                       debug("filterDlgCheckAction: can't find form!");
+                       return;
+               }
+
+               var action_param = form.action_param;
+
+               if (!action_param) {
+                       debug("filterDlgCheckAction: can't find action param!");
+                       return;
+               }
+
+               // if selected action supports parameters, enable params field
+               if (action == 4) {
+                       action_param.disabled = false;
+               } else {
+                       action_param.disabled = true;
+               }
+
+       } catch (e) {
+               exception_error(e, "filterDlgCheckAction");
+       }
+
+}