X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=js%2Ftt-rss.js;h=c6c0c13dd445177c7a6219992c3736e5f52e04a8;hb=4e8f32998a6295af690894f226517861183cbc02;hp=8c5a657491087500995a7237f316f88cbf12424c;hpb=ef74a05ea2080b715e79459c45787cb4118bed33;p=tt-rss.git diff --git a/js/tt-rss.js b/js/tt-rss.js index 8c5a6574..c6c0c13d 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; @@ -248,11 +251,17 @@ function init() { loading_set_progress(20); - var hasAudio = !!((myAudioTag = document.createElement('audio')).canPlayType); + 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); @@ -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() { @@ -452,11 +461,17 @@ function init() { hotkey_actions["select_article_cursor"] = function() { var id = getArticleUnderPointer(); if (id) { - var cb = dijit.byId("RCHK-" + id); - if (cb) { - cb.attr("checked", !cb.attr("checked")); - toggleSelectRowById(cb, "RROW-" + id); - return false; + var row = $("RROW-" + id); + + if (row) { + var cb = dijit.getEnclosingWidget( + row.getElementsByClassName("rchk")[0]); + + if (cb) { + cb.attr("checked", !cb.attr("checked")); + toggleSelectRowById(cb, "RROW-" + id); + return false; + } } } }; @@ -738,6 +753,8 @@ function parse_runtime_info(data) { init_params[k] = v; notify(''); } + + PluginHost.run(PluginHost.HOOK_RUNTIME_INFO_LOADED, data); } function collapse_feedlist() { @@ -977,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); @@ -1066,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) {