diff options
author | Andrew Dolgov <[email protected]> | 2013-05-07 15:36:14 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-05-07 15:36:14 +0400 |
commit | 82076ce53113be9cc053f8740356e7e1b81e5643 (patch) | |
tree | 5eba36805f593ec7dd0aad671b5bcca0ae01cf53 /js/tt-rss.js | |
parent | 66af65f14b4f3c670bb3f9ca7b1c80081f9281d1 (diff) | |
parent | 23923fb29b345c1eea5b70a6df4d30395425bf37 (diff) |
Merge branch 'master' into css-feedtree-counter
Conflicts:
tt-rss.css
Diffstat (limited to 'js/tt-rss.js')
-rw-r--r-- | js/tt-rss.js | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/js/tt-rss.js b/js/tt-rss.js index a572e5324..577922948 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -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); } @@ -134,7 +136,8 @@ function catchupAllFeeds() { new Ajax.Request("backend.php", { parameters: query_str, onComplete: function(transport) { - feedlist_callback2(transport); + request_counters(true); + viewCurrentFeed(); } }); global_unread = 0; @@ -246,13 +249,19 @@ function init() { if (!genericSanityCheck()) return false; - loading_set_progress(20); + loading_set_progress(30); + + var a = document.createElement('audio'); - var hasAudio = !!((myAudioTag = document.createElement('audio')).canPlayType); + 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); @@ -302,7 +311,7 @@ function init() { var id = getActiveArticleId(); var elem = $("CICD-"+id); if(elem.visible()) { - cdmUnexpandArticle(null, id); + cdmCollapseArticle(null, id, false); } else { cdmExpandArticle(id); @@ -323,7 +332,7 @@ function init() { hotkey_actions["edit_tags"] = function() { var id = getActiveArticleId(); if (id) { - editArticleTags(id, getActiveFeedId(), isCdmMode()); + editArticleTags(id); }; } hotkey_actions["dismiss_selected"] = function() { @@ -564,7 +573,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) @@ -744,6 +753,8 @@ function parse_runtime_info(data) { init_params[k] = v; notify(''); } + + PluginHost.run(PluginHost.HOOK_RUNTIME_INFO_LOADED, data); } function collapse_feedlist() { @@ -983,7 +994,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); @@ -1072,7 +1083,7 @@ function hash_get(key) { kv = window.location.hash.substring(1).toQueryParams(); return kv[key]; } catch (e) { - exception_error("hash_set", e); + exception_error("hash_get", e); } } function hash_set(key, value) { |