]> git.wh0rd.org - tt-rss.git/commitdiff
Merge branch 'af-comics-gocomics-feed' into 'master'
authorAndrew Dolgov <cthulhoo@gmail.com>
Sun, 22 Jan 2017 08:03:45 +0000 (11:03 +0300)
committerAndrew Dolgov <cthulhoo@gmail.com>
Sun, 22 Jan 2017 08:03:45 +0000 (11:03 +0300)
Update af_comics plugin to support GoComics.

Updates the af_comics plugin to support new GoComics site, which dropped native RSS feeds.

See merge request !42

classes/feeds.php
classes/pref/feeds.php
classes/pref/filters.php
include/feedbrowser.php
include/functions2.php
js/feedlist.js
js/functions.js
js/prefs.js
js/tt-rss.js
js/viewfeed.js

index 8f101e5cb774e46c74f027fd9100665d1d2bb423..e0756b6640a6a43a88c83bd1891e109d242ece1b 100755 (executable)
@@ -741,7 +741,7 @@ class Feeds extends Handler_Protected {
                                                <a title=\"".__('Edit tags for this article')."\"
                                                href=\"#\" onclick=\"editArticleTags($id)\">(+)</a>";
 
-                                       $num_comments = $line["num_comments"];
+                                       $num_comments = (int) $line["num_comments"];
                                        $entry_comments = "";
 
                                        if ($num_comments > 0) {
index faef0900fc05b779c771e756c63653c11cefd7cb..bac859d7524d3a5b23a878aa0c3bb7cc32871dcb 100755 (executable)
@@ -62,7 +62,7 @@ class Pref_Feeds extends Handler_Protected {
                        $cat['items'] = $this->get_category_items($line['id']);
 
                        $num_children = $this->calculate_children_count($cat);
-                       $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', $num_children), $num_children);
+                       $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', (int) $num_children), $num_children);
 
                        if ($num_children > 0 || $show_empty_cats)
                                array_push($items, $cat);
@@ -211,7 +211,7 @@ class Pref_Feeds extends Handler_Protected {
                                $cat['items'] = $this->get_category_items($line['id']);
 
                                $num_children = $this->calculate_children_count($cat);
-                               $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', $num_children), $num_children);
+                               $cat['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', (int) $num_children), $num_children);
 
                                if ($num_children > 0 || $show_empty_cats)
                                        array_push($root['items'], $cat);
@@ -261,7 +261,7 @@ class Pref_Feeds extends Handler_Protected {
                                array_push($root['items'], $cat);
 
                        $num_children = $this->calculate_children_count($root);
-                       $root['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', $num_children), $num_children);
+                       $root['param'] = vsprintf(_ngettext('(%d feed)', '(%d feeds)', (int) $num_children), $num_children);
 
                } else {
                        $feed_result = $this->dbh->query("SELECT id, title, last_error,
index 95f82765fe7cb80206de73a36120ff071b4a3240..b7c286ecf2665c41c71eec2eef077ae715e25eba 100755 (executable)
@@ -1096,7 +1096,7 @@ class Pref_Filters extends Handler_Protected {
 
                if (!$title) $title = __("[No caption]");
 
-               $title = sprintf(_ngettext("%s (%d rule)", "%s (%d rules)", $num_rules), $title, $num_rules);
+               $title = sprintf(_ngettext("%s (%d rule)", "%s (%d rules)", (int) $num_rules), $title, $num_rules);
 
 
                $result = $this->dbh->query(
@@ -1114,7 +1114,7 @@ class Pref_Filters extends Handler_Protected {
                if ($match_any_rule) $title .= " (" . __("matches any rule") . ")";
 
                if ($num_actions > 0)
-                       $actions = sprintf(_ngettext("%s (+%d action)", "%s (+%d actions)", $num_actions), $actions, $num_actions);
+                       $actions = sprintf(_ngettext("%s (+%d action)", "%s (+%d actions)", (int) $num_actions), $actions, $num_actions);
 
                return array($title, $actions);
        }
index 800bcd970c6026bedffa29510356ce3e7f596815..4772420abb8f4cc4f0951555f0f0c193e4d717e0 100644 (file)
@@ -81,7 +81,7 @@
                                $class = ($feedctr % 2) ? "even" : "odd";
 
                                if ($line['articles_archived'] > 0) {
-                                       $archived = sprintf(_ngettext("%d archived article", "%d archived articles", $line['articles_archived']), $line['articles_archived']);
+                                       $archived = sprintf(_ngettext("%d archived article", "%d archived articles", (int) $line['articles_archived']), $line['articles_archived']);
                                        $archived = "&nbsp;<span class='subscribers'>($archived)</span>";
                                } else {
                                        $archived = '';
index 4535e62670a9d4217b4c20681d7464bfc6b706ac..28477a0cfd0c7447f5a0237eae0d5fca6f2d7eaf 100644 (file)
                                $line = $p->hook_render_article($line);
                        }
 
-                       $num_comments = $line["num_comments"];
+                       $num_comments = (int) $line["num_comments"];
                        $entry_comments = "";
 
                        if ($num_comments > 0) {
index c98cfaab5941ed5f7c737bc4f07a7e74dd987d7e..e66a0c1b6a8017bd7fa7f0b589ad7b61573f70de 100644 (file)
@@ -198,7 +198,7 @@ function feedlist_init() {
                loading_set_progress(50);
 
                document.onkeydown = hotkey_handler;
-               setTimeout("hotkey_prefix_timeout()", 5*1000);
+               setTimeout(hotkey_prefix_timeout, 5*1000);
 
                if (!getActiveFeedId()) {
                        viewfeed({feed: -3});
index 384382554b62721b5def286c9a7829e9e7d6c2b0..63ff4121bb8c8fa56b326bd2794d5ebfb2aede20 100755 (executable)
@@ -668,7 +668,7 @@ function hotkey_prefix_timeout() {
                        Element.hide('cmdline');
                }
 
-               setTimeout("hotkey_prefix_timeout()", 1000);
+               setTimeout(hotkey_prefix_timeout, 1000);
 
        } catch  (e) {
                exception_error("hotkey_prefix_timeout", e);
@@ -1325,7 +1325,7 @@ function unsubscribeFeed(feed_id, title) {
                                                updateFeedList();
                                        } else {
                                                if (feed_id == getActiveFeedId())
-                                                       setTimeout("viewfeed({feed:-5})", 100);
+                                                       setTimeout(function() { viewfeed({feed:-5}) }, 100);
 
                                                if (feed_id < 0) updateFeedList();
                                        }
index 69e779d4505dfa8ddcc5e14b143a03c8cc9a0579..23d43f366d6433ccaab7f7e5131d400411f5a2d4 100755 (executable)
@@ -901,10 +901,10 @@ function init_second_stage() {
                if (method == 'editFeed') {
                        var param = getURLParam('methodparam');
 
-                       window.setTimeout('editFeed(' + param + ')', 100);
+                       window.setTimeout(function() { editFeed(param) }, 100);
                }
 
-               setTimeout("hotkey_prefix_timeout()", 5*1000);
+               setTimeout(hotkey_prefix_timeout, 5*1000);
 
        } catch (e) {
                exception_error("init_second_stage", e);
index 26982608e7d3c625f9e09899a2cb6d24179fcfdf..20e0fc5a9714b7b23d734b9c04b84f5de0a9e474 100644 (file)
@@ -159,7 +159,7 @@ function viewCurrentFeed(method) {
 function timeout() {
        if (getInitParam("bw_limit") != "1") {
                request_counters();
-               setTimeout("timeout()", 60*1000);
+               setTimeout(timeout, 60*1000);
        }
 }
 
@@ -654,7 +654,7 @@ function init_second_stage() {
 
                if (getInitParam("simple_update")) {
                        console.log("scheduling simple feed updater...");
-                       window.setTimeout("update_random_feed()", 30*1000);
+                       window.setTimeout(update_random_feed, 30*1000);
                }
 
        } catch (e) {
@@ -1130,7 +1130,7 @@ function update_random_feed() {
                        parameters: "op=rpc&method=updateRandomFeed",
                        onComplete: function(transport) {
                                handle_rpc_json(transport, true);
-                               window.setTimeout("update_random_feed()", 30*1000);
+                               window.setTimeout(update_random_feed, 30*1000);
                        } });
 
        } catch (e) {
index feb397157c04555269e357cc9519237e08decb71..007728a1004ca64c319e5f5e60d440b3b846b54c 100755 (executable)
@@ -2315,7 +2315,7 @@ function updateFloatingTitle(unread_only) {
 function catchupCurrentBatchIfNeeded() {
        if (catchup_id_batch.length > 0) {
                window.clearTimeout(catchup_timeout_id);
-               catchup_timeout_id = window.setTimeout('catchupBatchedArticles()', 1000);
+               catchup_timeout_id = window.setTimeout(catchupBatchedArticles, 1000);
 
                if (catchup_id_batch.length >= 10) {
                        catchupBatchedArticles();