]> git.wh0rd.org - tt-rss.git/blobdiff - js/tt-rss.js
Updater: check whether system() is useable.
[tt-rss.git] / js / tt-rss.js
index 3b7793553a94b13dcb8a659f86717d1fe0fa723c..c6414515944abf7b85afae92d1a248724312ba4d 100644 (file)
@@ -231,6 +231,7 @@ function init() {
                dojo.require("dijit.form.Select");
                dojo.require("dijit.form.SimpleTextarea");
                dojo.require("dijit.form.TextBox");
+               dojo.require("dijit.form.ComboBox");
                dojo.require("dijit.form.ValidationTextBox");
                dojo.require("dijit.InlineEditBox");
                dojo.require("dijit.layout.AccordionContainer");
@@ -500,6 +501,10 @@ function init() {
                                if (!isCdmMode()) {
                                        _widescreen_mode = !_widescreen_mode;
 
+                                       // reset stored sizes because geometry changed
+                                       setCookie("ttrss_ci_width", 0);
+                                       setCookie("ttrss_ci_height", 0);
+
                                        switchPanelMode(_widescreen_mode);
                                }
                };
@@ -555,17 +560,6 @@ function init_second_stage() {
                                        {width: getCookie("ttrss_fh_width") + "px" });
                        }
 
-                       if (parseInt(getCookie("ttrss_ci_width")) > 0) {
-                               if (_widescreen_mode) {
-                                       dijit.byId("content-insert").domNode.setStyle(
-                                               {width: getCookie("ttrss_ci_width") + "px" });
-
-                               } else {
-                                       dijit.byId("content-insert").domNode.setStyle(
-                                               {height: getCookie("ttrss_ci_height") + "px" });
-                               }
-                       }
-
                        dijit.byId("main").resize();
 
                        var tmph = dojo.connect(dijit.byId('feeds-holder'), 'resize',
@@ -706,6 +700,10 @@ function quickMenuGo(opid) {
                        if (!isCdmMode()) {
                                _widescreen_mode = !_widescreen_mode;
 
+                               // reset stored sizes because geometry changed
+                               setCookie("ttrss_ci_width", 0);
+                               setCookie("ttrss_ci_height", 0);
+
                                switchPanelMode(_widescreen_mode);
                        }
                        break;
@@ -987,12 +985,13 @@ function newVersionDlg() {
 
 function handle_rpc_json(transport, scheduled_call) {
        try {
-               try {
-                       var reply = JSON.parse(transport.responseText);
-               } catch (e) {
-                       alert(__("Failed to parse server reply. This could be caused by a server or network timeout. Backend output was logged to the browser console."));
-                       console.log("handle_rpc_json, received: " + transport.responseText);
-               }
+               var reply = JSON.parse(transport.responseText);
+
+               var netalert_dijit = dijit.byId("net-alert");
+               var netalert = false;
+
+               if (netalert_dijit)
+                       netalert = netalert_dijit.domNode;
 
                if (reply) {
 
@@ -1040,16 +1039,21 @@ function handle_rpc_json(transport, scheduled_call) {
                        if (runtime_info)
                                parse_runtime_info(runtime_info);
 
-                       Element.hide(dijit.byId("net-alert").domNode);
+                       if (netalert) Element.hide(netalert);
 
                } else {
-                       //notify_error("Error communicating with server.");
-                       Element.show(dijit.byId("net-alert").domNode);
+                       if (netalert)
+                               Element.show(netalert);
+                       else
+                               notify_error("Communication problem with server.");
                }
 
        } catch (e) {
-               Element.show(dijit.byId("net-alert").domNode);
-               //notify_error("Error communicating with server.");
+               if (netalert)
+                       Element.show(netalert);
+               else
+                       notify_error("Communication problem with server.");
+
                console.log(e);
                //exception_error("handle_rpc_json", e, transport);
        }
@@ -1071,6 +1075,11 @@ function switchPanelMode(wide) {
                                height: 'auto',
                                borderTopWidth: '0px' });
 
+                       if (parseInt(getCookie("ttrss_ci_width")) > 0) {
+                               dijit.byId("content-insert").domNode.setStyle(
+                                       {width: getCookie("ttrss_ci_width") + "px" });
+                       }
+
                        $("headlines-frame").setStyle({ borderBottomWidth: '0px' });
                        $("headlines-frame").addClassName("wide");
 
@@ -1082,6 +1091,11 @@ function switchPanelMode(wide) {
                                height: '50%',
                                borderTopWidth: '0px'});
 
+                       if (parseInt(getCookie("ttrss_ci_height")) > 0) {
+                               dijit.byId("content-insert").domNode.setStyle(
+                                       {height: getCookie("ttrss_ci_height") + "px" });
+                       }
+
                        $("headlines-frame").setStyle({ borderBottomWidth: '1px' });
                        $("headlines-frame").removeClassName("wide");