]> git.wh0rd.org - tt-rss.git/blobdiff - functions.js
headlines subtoolbar, misc api changes
[tt-rss.git] / functions.js
index 36aa8fd6a7c1abab32d65e32156281708f7eeddc..d3886437b932bc391657c56d50b5b52e09208e8b 100644 (file)
@@ -32,6 +32,13 @@ function rpc_notify_callback() {
        }
 }
 
+function rpc_pnotify_callback() {
+       var container = parent.document.getElementById('notify');
+       if (xmlhttp_rpc.readyState == 4) {
+               container.innerHTML=xmlhttp_rpc.responseText;
+       }
+}
+
 function param_escape(arg) {
        if (typeof encodeURIComponent != 'undefined')
                return encodeURIComponent(arg); 
@@ -469,7 +476,8 @@ function selectTableRow(r, do_select) {
        }
 }
 
-function selectTableRowsByIdPrefix(content_id, prefix, check_prefix, do_select) {
+function selectTableRowsByIdPrefix(content_id, prefix, check_prefix, do_select, 
+       classcheck) {
 
        var content = document.getElementById(content_id);
 
@@ -479,15 +487,18 @@ function selectTableRowsByIdPrefix(content_id, prefix, check_prefix, do_select)
        }
 
        for (i = 0; i < content.rows.length; i++) {
-               if (content.rows[i].id.match(prefix)) {
-                       selectTableRow(content.rows[i], do_select);
-               }
+               if (!classcheck || content.rows[i].className.match(classcheck)) {
+       
+                       if (content.rows[i].id.match(prefix)) {
+                               selectTableRow(content.rows[i], do_select);
+                       }
 
-               var row_id = content.rows[i].id.replace(prefix, "");
-               var check = document.getElementById(check_prefix + row_id);
+                       var row_id = content.rows[i].id.replace(prefix, "");
+                       var check = document.getElementById(check_prefix + row_id);
 
-               if (check) {
-                       check.checked = do_select;
+                       if (check) {
+                               check.checked = do_select;
+                       }
                }
        }
 }
@@ -504,7 +515,9 @@ function getSelectedTableRowIds(content_id, prefix) {
        var sel_rows = new Array();
 
        for (i = 0; i < content.rows.length; i++) {
-               if (content.rows[i].className.match("Selected")) {
+               if (content.rows[i].id.match(prefix) && 
+                               content.rows[i].className.match("Selected")) {
+                               
                        var row_id = content.rows[i].id.replace(prefix + "-", "");
                        sel_rows.push(row_id);  
                }
@@ -514,3 +527,18 @@ function getSelectedTableRowIds(content_id, prefix) {
 
 }
 
+function toggleSelectRow(sender) {
+       var parent_row = sender.parentNode.parentNode;
+
+       if (sender.checked) {
+               if (!parent_row.className.match("Selected")) {
+                       parent_row.className = parent_row.className + "Selected";
+               }
+       } else {
+               if (parent_row.className.match("Selected")) {
+                       parent_row.className = parent_row.className.replace("Selected", "");
+               }
+       }
+}
+
+