diff --git a/classes/feeds.php b/classes/feeds.php index a04ea2d..1de9c2c 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -1875,7 +1875,7 @@ class Feeds extends Handler_Protected { $sum = 0; for ($i = 0; $i < strlen($name); $i++) { - $sum += ord($name{$i}); + $sum += ord($name[$i]); } $sum %= count($colormap); diff --git a/css/updates.css b/css/updates.css index 15489ad..271c771 100644 --- a/css/updates.css +++ b/css/updates.css @@ -190,7 +190,7 @@ img.img_card_preview { } .toolbar-hide { - visibility: hidden !important; + visibility: visible !important; } .dijitMenuPopup { diff --git a/include/colors.php b/include/colors.php index c441f7c..659fec7 100644 --- a/include/colors.php +++ b/include/colors.php @@ -205,7 +205,7 @@ function _color_unpack($hex, $normalize = false) { if (strlen($hex) == 4) { $hex = $hex[1] . $hex[1] . $hex[2] . $hex[2] . $hex[3] . $hex[3]; - } $c = hexdec($hex); + } $c = hexdec(ltrim($hex, '#')); for ($i = 16; $i >= 0; $i -= 8) { $out[] = (($c >> $i) & 0xFF) / ($normalize ? 255 : 1); } return $out; diff --git a/js/Feeds.js b/js/Feeds.js index ba63aac..cc13ac7 100644 --- a/js/Feeds.js +++ b/js/Feeds.js @@ -431,7 +431,14 @@ define(["dojo/_base/declare"], function (declare) { }); }, catchupCurrent: function(mode) { - this.catchupFeed(this.getActive(), this.activeIsCat(), mode); + Headlines.select('unread'); + Headlines.selectionToggleUnread({ no_error: 1 }); + let _feeds = this; + setTimeout(function() { + if (_feeds.getActive() != undefined) { + _feeds.open({feed: _feeds.getActive(), is_cat: _feeds.activeIsCat()}); + } + }, 1000); }, catchupFeedInGroup: function(id) { const title = this.getName(id); diff --git a/js/Headlines.js b/js/Headlines.js index 1c1f859..ed99326 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -1,6 +1,11 @@ 'use strict'; /* global __, ngettext */ define(["dojo/_base/declare"], function (declare) { + function decodeHTMLEntities(text) { + var textArea = document.createElement('textarea'); + textArea.innerHTML = text; + return textArea.value; + } var img_preview_elem = document.createElement('div'); img_preview_elem.style.display = 'none'; document.body.appendChild(img_preview_elem); @@ -191,7 +196,7 @@ define(["dojo/_base/declare"], function (declare) { //console.log("Article.getActive(): " + Article.getActive()); //console.log("App.getInitParam('cdm_expanded'): " + App.getInitParam("cdm_expanded")); //console.log("App.getViewMode(): " + App.getViewMode()); - + if (id != Article.getActiveHeadline() && ((event.ctrlKey || event.shiftKey) || App.getViewMode() == "full")) { Article.setActiveHeadline(id); Article.openInNewWindow(id); @@ -440,11 +445,11 @@ define(["dojo/_base/declare"], function (declare) { if (App.isCombinedMode()) { row_class += App.getInitParam("cdm_expanded") ? " expanded" : " expandable"; - img_preview_elem.innerHTML = hl.content; + img_preview_elem.innerHTML = decodeHTMLEntities(hl.content) + decodeHTMLEntities(hl.enclosures); var img_preview_src = 'images/blank_icon.gif'; var imgs = img_preview_elem.querySelectorAll('img'); for (var i = 0; i < imgs.length; i++) { - if (imgs[i].src && imgs[i].src.match(/\.(thumb|jpeg|jpg|gif|png)(\?|$)/i) != null) { + if (imgs[i].src) { img_preview_src = imgs[i].src; break; } @@ -454,7 +459,7 @@ define(["dojo/_base/declare"], function (declare) { const originally_from = Article.formatOriginallyFrom(hl); var author_display = hl.feed_title; - if (hl.feed_title == "") + if (hl.feed_title == "") author_display = hl.author; this.fullArticles[hl.id] = `