]> git.wh0rd.org - tt-rss.git/blobdiff - functions.js
outputFeedList: fix markup problems
[tt-rss.git] / functions.js
index 1172a49f71541e28e351949137079e36f54411b9..b26f75fd8a1ebd7d719d6ce952a4592d6c2e1705 100644 (file)
@@ -7,6 +7,10 @@ function browser_has_opacity() {
                navigator.userAgent.match("Opera") != null;
 }
 
+function is_msie() {
+       return navigator.userAgent.match("MSIE");
+}
+
 function is_opera() {
        return navigator.userAgent.match("Opera");
 }
@@ -1248,11 +1252,18 @@ function getRelativeFeedId(list, id, direction, unread_only) {
        }
 }
 
-function showBlockElement(id) {
+function showBlockElement(id, h_id) {
        var elem = document.getElementById(id);
 
        if (elem) {
                elem.style.display = "block";
+
+               if (h_id) {
+                       elem = document.getElementById(h_id);
+                       if (elem) {
+                               elem.style.display = "none";
+                       }
+               }
        } else {
                alert("[showBlockElement] can't find element with id " + id);
        } 
@@ -1433,9 +1444,16 @@ function qaddFeed() {
        
        var query = Form.serialize("feed_add_form");
        
-       xmlhttp.open("GET", "backend.php?" + query, true);
+       debug("subscribe q: " + query);
+
+/*     xmlhttp.open("GET", "backend.php?" + query, true);
        xmlhttp.onreadystatechange=dlg_frefresh_callback;
-       xmlhttp.send(null);
+       xmlhttp.send(null); */
+
+       xmlhttp.open("POST", "backend.php", true);
+       xmlhttp.onreadystatechange=dlg_frefresh_callback;
+       xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
+       xmlhttp.send(query);
 
        return false;
 }
@@ -1502,71 +1520,13 @@ function debug(msg) {
 }
 
 function getInitParam(key) {
-       var c = getCookie("TTIP:" + key);
-       if (c) {
-               return c;
-       } else {
-               return getMainContext().init_params[key];
-       }
+       return init_params[key];
 }
 
 function storeInitParam(key, value) {
-       try {
-               init_params[key] = value;
-               debug("storeInitParam: " + key + " => " + value + 
-                       " (" + getInitParam("cookie_lifetime") + ")");
-               if (getInitParam("cookie_lifetime") > 0) {
-                       setCookie("TTIP:" + key, value, getInitParam("cookie_lifetime"));
-               } else {
-                       setCookie("TTIP:" + key, value);
-               }
-       } catch (e) {
-               exception_error("storeInitParam", e);
-       }
+       debug("<b>storeInitParam is OBSOLETE: " + key + " => " + value + "</b>");
 }
 
-
-/*
-function storeInitParam(key, value, is_client) {
-       try {
-               if (!is_client) {
-                       if (getMainContext().init_params[key] != value) {
-                               debug("storeInitParam: " + key + " => " + value);
-                               //new Ajax.Request("backend.php?op=rpc&subop=storeParam&key=" + 
-                               //      param_escape(key) + "&value=" + param_escape(value));   
-                               var f = getMainContext().document.getElementById("backReqBox");
-                               f.src = "backend.php?op=rpc&subop=storeParam&key=" + 
-                                       param_escape(key) + "&value=" + param_escape(value);
-                       }
-               }
-               getMainContext().init_params[key] = value;
-       } catch (e) {
-               exception_error("storeInitParam", e);
-       }
-} */
-
-/*
-function storeInitParams(params, is_client) {
-       try {
-               var s = "";
-
-               for (k in params) {
-                       if (getMainContext().init_params[k] != params[k]) {
-                               s += k + "=" + params[k] + ";";
-                               getMainContext().init_params[k] = params[k];
-                       }
-               } 
-
-               debug("storeInitParams: " + s);
-       
-               if (!is_client) {
-                       new Ajax.Request("backend.php?op=rpc&subop=storeParams&str=" + s);
-               }
-       } catch (e) {
-               exception_error("storeInitParams", e);
-       }
-}*/
-
 function fatalError(code, message) {
        try {