]> git.wh0rd.org - tt-rss.git/blobdiff - js/tt-rss.js
af_redditimgur: add support for bullshit ajaxified imgur albums
[tt-rss.git] / js / tt-rss.js
index a66411d11d507f0e123d942756088e5e3b32789c..26749d1089f073baf129d165b7cd0c2634a47d1e 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");
@@ -301,21 +302,27 @@ function init() {
                hotkey_actions["collapse_article"] = function() {
                                var id = getActiveArticleId();
                                var elem = $("CICD-"+id);
-                               if(elem.visible()) {
-                                       cdmCollapseArticle(null, id);
-                               }
-                               else {
-                                       cdmExpandArticle(id);
+
+                               if (elem) {
+                                       if (elem.visible()) {
+                                               cdmCollapseArticle(null, id);
+                                       }
+                                       else {
+                                               cdmExpandArticle(id);
+                                       }
                                }
                };
                hotkey_actions["toggle_expand"] = function() {
                                var id = getActiveArticleId();
                                var elem = $("CICD-"+id);
-                               if(elem.visible()) {
-                                       cdmCollapseArticle(null, id, false);
-                               }
-                               else {
-                                       cdmExpandArticle(id);
+
+                               if (elem) {
+                                       if (elem.visible()) {
+                                               cdmCollapseArticle(null, id, false);
+                                       }
+                                       else {
+                                               cdmExpandArticle(id);
+                                       }
                                }
                };
                hotkey_actions["search_dialog"] = function() {
@@ -500,6 +507,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 +566,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 +706,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;
@@ -752,15 +756,6 @@ function parse_runtime_info(data) {
 
 //             console.log("RI: " + k + " => " + v);
 
-               if (k == "new_version_available") {
-                       if (v == "1") {
-                               Element.show(dijit.byId("newVersionIcon").domNode);
-                       } else {
-                               Element.hide(dijit.byId("newVersionIcon").domNode);
-                       }
-                       return;
-               }
-
                if (k == "dep_ts" && parseInt(getInitParam("dep_ts")) > 0) {
                        if (parseInt(getInitParam("dep_ts")) < parseInt(v) && getInitParam("reload_on_ts_change")) {
                                window.location.reload();
@@ -964,27 +959,6 @@ function reverseHeadlineOrder() {
        }
 }
 
-function newVersionDlg() {
-       try {
-               var query = "backend.php?op=dlg&method=newVersion";
-
-               if (dijit.byId("newVersionDlg"))
-                       dijit.byId("newVersionDlg").destroyRecursive();
-
-               dialog = new dijit.Dialog({
-                       id: "newVersionDlg",
-                       title: __("New version available!"),
-                       style: "width: 600px",
-                       href: query,
-               });
-
-               dialog.show();
-
-       } catch (e) {
-               exception_error("newVersionDlg", e);
-       }
-}
-
 function handle_rpc_json(transport, scheduled_call) {
        try {
                var reply = JSON.parse(transport.responseText);
@@ -1077,6 +1051,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");
 
@@ -1088,6 +1067,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");