From 40fe2d73821788e7c202191dc7b94b025585d338 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 16 Apr 2013 15:44:38 +0400 Subject: remove js-based player, better mp3 support detection for html5 audio --- js/tt-rss.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index a572e5324..fe12297d4 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -248,11 +248,15 @@ 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/, '')); new Ajax.Request("backend.php", { parameters: {op: "rpc", method: "sanityCheck", hasAudio: hasAudio, + hasMp3: hasMp3, hasSandbox: hasSandbox}, onComplete: function(transport) { backend_sanity_check_callback(transport); -- cgit v1.2.3 From 3cc5a3cd43be77b64e395d8a9178814330505ce2 Mon Sep 17 00:00:00 2001 From: supahgreg Date: Tue, 16 Apr 2013 20:08:17 -0500 Subject: minor typo fix in hash_get() --- js/tt-rss.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index fe12297d4..9a223733f 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -1076,7 +1076,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) { -- cgit v1.2.3 From da76e61af8d8c9129acfbf0db670342853a62747 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 17 Apr 2013 19:58:04 +0400 Subject: catchupAllFeeds: do not call obsolete callback --- js/tt-rss.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index 9a223733f..9e4cb63ce 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -134,7 +134,8 @@ function catchupAllFeeds() { new Ajax.Request("backend.php", { parameters: query_str, onComplete: function(transport) { - feedlist_callback2(transport); + request_counters(true); + viewCurrentFeed(); } }); global_unread = 0; -- cgit v1.2.3 From 8d388f321b22691246393e3f812d42ab388c8c42 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 24 Apr 2013 19:49:37 +0400 Subject: add a simple JS-based hook host --- js/tt-rss.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index 9e4cb63ce..3f8545149 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); } -- cgit v1.2.3 From 204f9b186ff903bb5638320ba73614a6a89e2d6d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 25 Apr 2013 14:04:49 +0400 Subject: remove cdmUnexpandArticle --- js/tt-rss.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index 3f8545149..88a360f99 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -309,7 +309,7 @@ function init() { var id = getActiveArticleId(); var elem = $("CICD-"+id); if(elem.visible()) { - cdmUnexpandArticle(null, id); + cdmCollapseArticle(null, id, false); } else { cdmExpandArticle(id); -- cgit v1.2.3 From 6bfc97da869ca180d2f5fee01c9ff503cb47b1bd Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 26 Apr 2013 10:31:57 +0400 Subject: add automatic timezone (based on client tz offset) --- js/tt-rss.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index 88a360f99..a7518959c 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -256,10 +256,12 @@ function init() { 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); -- cgit v1.2.3 From 8ceea119a8287568439a2a9d167b333f74a47e21 Mon Sep 17 00:00:00 2001 From: supahgreg Date: Sat, 27 Apr 2013 11:01:54 -0500 Subject: Add JS PluginHost.HOOK_PARAMS_LOADED and PluginHost.HOOK_RUNTIME_INFO_LOADED to notify when interesting info has been created/updated. --- js/tt-rss.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index a7518959c..2a741ab2d 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -753,6 +753,8 @@ function parse_runtime_info(data) { init_params[k] = v; notify(''); } + + PluginHost.run(PluginHost.HOOK_RUNTIME_INFO_LOADED, data); } function collapse_feedlist() { @@ -992,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); -- cgit v1.2.3 From 27372ddac6b17ab2700ec2f9bc6bc1ac0ea153fe Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 30 Apr 2013 20:07:08 +0400 Subject: fix editArticleTags() call broken on archived feed --- js/tt-rss.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index 2a741ab2d..c6c0c13dd 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -332,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() { -- cgit v1.2.3 From ea18cceaca2fb7562f07a78248fcc15469413629 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 2 May 2013 09:48:38 +0400 Subject: remove splash before freshfeed is loaded --- js/tt-rss.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index c6c0c13dd..577922948 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -249,7 +249,7 @@ function init() { if (!genericSanityCheck()) return false; - loading_set_progress(20); + loading_set_progress(30); var a = document.createElement('audio'); @@ -573,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) -- cgit v1.2.3