]> git.wh0rd.org - tt-rss.git/blobdiff - functions.js
Extended Actions to include Select by tag (add local modifications, fix
[tt-rss.git] / functions.js
index e8bd6af3399c495d97f3d99771ae7872be20ea35..1a06a9bf3c606d11bc06e1eb274258a3cd6880c5 100644 (file)
@@ -1619,4 +1619,54 @@ function showFeedsWithErrors() {
 
 }
 
+/* new support functions for SelectByTag */
 
+function get_all_tags(selObj){
+       try {
+               if( !selObj ) return "";
+
+               var result = "";
+               var len = selObj.options.length;
+
+               for (var i=0; i < len; i++){
+                       if (selObj.options[i].selected) {
+                               result += selObj[i].value + "%2C";   // is really a comma
+                       }
+               }
+
+               if (result.length > 0){
+                       result = result.substr(0, result.length-3);  // remove trailing %2C
+               }
+
+               return(result);
+
+       } catch (e) {
+               exception_error("get_all_tags", e);
+       }
+}
+
+function get_radio_checked(radioObj) {
+       try {
+               if (!radioObj) return "";
+
+               var len = radioObj.length;
+
+               if (len == undefined){
+                       if(radioObj.checked){
+                               return(radioObj.value);
+                       } else {
+                               return("");
+                       }
+               }
+
+               for( var i=0; i < len; i++ ){
+                       if( radioObj[i].checked ){
+                               return( radioObj[i].value);
+                       }
+               }
+
+       } catch (e) {
+               exception_error("get_radio_checked", e);
+       }
+       return("");
+}