]> git.wh0rd.org - tt-rss.git/blobdiff - js/tt-rss.js
block automarking headlines on scroll in unexpanded cdm because it doesn't work so...
[tt-rss.git] / js / tt-rss.js
index 9e4cb63cec0512612807d5d425e25ceea7166526..e3731c0cbf11c84883f4d5dab52314711e533d65 100644 (file)
@@ -40,6 +40,8 @@ function setActiveFeedId(id, is_cat) {
                $("headlines-frame").setAttribute("is-cat", is_cat ? 1 : 0);
 
                selectFeed(id, is_cat);
+
+               PluginHost.run(PluginHost.HOOK_FEED_SET_ACTIVE, _active_article_id);
        } catch (e) {
                exception_error("setActiveFeedId", e);
        }
@@ -114,6 +116,7 @@ function updateFeedList() {
 
                tree.startup();
 
+
        } catch (e) {
                exception_error("updateFeedList", e);
        }
@@ -247,17 +250,19 @@ function init() {
                if (!genericSanityCheck())
                        return false;
 
-               loading_set_progress(20);
+               loading_set_progress(30);
 
                var a = document.createElement('audio');
 
                var hasAudio = !!a.canPlayType;
                var hasSandbox = "sandbox" in document.createElement("iframe");
                var hasMp3 = !!(a.canPlayType && a.canPlayType('audio/mpeg;').replace(/no/, ''));
+               var clientTzOffset = new Date().getTimezoneOffset() * 60;
 
                new Ajax.Request("backend.php", {
                        parameters: {op: "rpc", method: "sanityCheck", hasAudio: hasAudio,
                                hasMp3: hasMp3,
+                               clientTzOffset: clientTzOffset,
                                hasSandbox: hasSandbox},
                        onComplete: function(transport) {
                                        backend_sanity_check_callback(transport);
@@ -307,7 +312,7 @@ function init() {
                                var id = getActiveArticleId();
                                var elem = $("CICD-"+id);
                                if(elem.visible()) {
-                                       cdmUnexpandArticle(null, id);
+                                       cdmCollapseArticle(null, id, false);
                                }
                                else {
                                        cdmExpandArticle(id);
@@ -328,7 +333,7 @@ function init() {
                hotkey_actions["edit_tags"] = function() {
                                var id = getActiveArticleId();
                                if (id) {
-                                       editArticleTags(id, getActiveFeedId(), isCdmMode());
+                                       editArticleTags(id);
                                };
                        }
                hotkey_actions["dismiss_selected"] = function() {
@@ -543,11 +548,37 @@ function init_second_stage() {
                        closeArticlePanel();
 
                        _widescreen_mode = getInitParam("widescreen");
+                       switchPanelMode(_widescreen_mode);
 
-                       if (_widescreen_mode) {
-                               switchPanelMode(_widescreen_mode);
+                       if (parseInt(getCookie("ttrss_fh_width")) > 0) {
+                               dijit.byId("feeds-holder").domNode.setStyle(
+                                       {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',
+                               function (args) {
+                                       setCookie("ttrss_fh_width", args.w, getInitParam("cookie_lifetime"));
+                       });
+
+                       var tmph = dojo.connect(dijit.byId('content-insert'), 'resize',
+                               function (args) {
+                                       setCookie("ttrss_ci_width", args.w, getInitParam("cookie_lifetime"));
+                                       setCookie("ttrss_ci_height", args.h, getInitParam("cookie_lifetime"));
+                       });
+
                });
 
                delCookie("ttrss_test");
@@ -569,7 +600,7 @@ function init_second_stage() {
                        setActiveFeedId(hash_feed_id, hash_feed_is_cat);
                }
 
-               loading_set_progress(30);
+               loading_set_progress(50);
 
                // can't use cache_clear() here because viewfeed might not have initialized yet
                if ('sessionStorage' in window && window['sessionStorage'] !== null)
@@ -749,6 +780,8 @@ function parse_runtime_info(data) {
                init_params[k] = v;
                notify('');
        }
+
+       PluginHost.run(PluginHost.HOOK_RUNTIME_INFO_LOADED, data);
 }
 
 function collapse_feedlist() {
@@ -988,7 +1021,7 @@ function handle_rpc_json(transport, scheduled_call) {
                        if (counters)
                                parse_counters(counters, scheduled_call);
 
-                       var runtime_info = reply['runtime-info'];;
+                       var runtime_info = reply['runtime-info'];
 
                        if (runtime_info)
                                parse_runtime_info(runtime_info);
@@ -1027,6 +1060,7 @@ function switchPanelMode(wide) {
                                borderTopWidth: '0px' });
 
                        $("headlines-toolbar").setStyle({ borderBottomWidth: '0px' });
+                       $("headlines-frame").setStyle({ borderBottomWidth: '0px' });
 
                } else {
 
@@ -1038,6 +1072,8 @@ function switchPanelMode(wide) {
                                borderTopWidth: '1px'});
 
                        $("headlines-toolbar").setStyle({ borderBottomWidth: '1px' });
+
+                       $("headlines-frame").setStyle({ borderBottomWidth: '1px' });
                }
 
                closeArticlePanel();