Fix feed-last-checked update after refresh-all

I've dropped it accidentally with my last commit. Furthermore I moved
the data-feed-id definition to the article element and dropped multiple
references of the feed id. That's similar to what I've done before with
the data-item-id in 3dae99ac.

The article element holds the information whether a feed is disabled now.

Now it is shown if a feed had errors while updating.
This commit is contained in:
Mathias Kresin 2014-12-31 13:43:05 +01:00
parent 800026484c
commit 9d31eb1a01
11 changed files with 68 additions and 67 deletions

View File

@ -338,11 +338,11 @@ span#nav-counter:not(:empty):before, span#page-counter:not(:empty):before {
content: " ("; content: " (";
} }
span[id^="items-count-"]:before { span.items-count:before {
content: "("; content: "(";
} }
span#nav-counter:not(:empty):after, span#page-counter:not(:empty):after, span[id^="items-count-"]:after { span#nav-counter:not(:empty):after, span#page-counter:not(:empty):after, span.items-count:after {
content: ")"; content: ")";
} }
@ -448,8 +448,7 @@ nav .active a {
padding-top: 30px; padding-top: 30px;
} }
.feed-disabled, [data-feed-disabled] * {
.feed-disabled a {
color: #aaa; color: #aaa;
} }

37
assets/js/all.min.js vendored
View File

@ -1,19 +1,20 @@
var Miniflux={};Miniflux.App=function(){return{Run:function(){Miniflux.Event.ListenKeyboardEvents();Miniflux.Event.ListenMouseEvents()}}}(); var Miniflux={};Miniflux.App=function(){return{Run:function(){Miniflux.Event.ListenKeyboardEvents();Miniflux.Event.ListenMouseEvents()}}}();
Miniflux.Feed=function(){var e=[],d=[];return{Update:function(a,d){var e=document.getElementById("items-count-"+a);if(e){e.parentNode.className="loading-icon";var b=new XMLHttpRequest;b.onload=function(){e.parentNode.className="";var b=JSON.parse(this.responseText);if(b.result){var f=b.items_count,h=document.getElementById("items-count-"+a);h&&(h.innerHTML=f.items_unread+"/"+f.items_total)}d&&d(b)};b.open("POST","?action=refresh-feed&feed_id="+a,!0);b.send()}},UpdateAll:function(){for(var a=document.getElementsByTagName("a"), Miniflux.Feed=function(){var d=[];return{Update:function(c,b){var a=c.querySelector("span.items-count");if(a){var d=c.getAttribute("data-feed-id"),e=c.querySelector("h2:first-of-type");e.className="loading-icon";var f=new XMLHttpRequest;f.onload=function(){e.className="";var f=c.querySelector(".feed-last-checked");f&&(f.innerHTML=f.getAttribute("data-after-update"));if(f=c.querySelector(".feed-parsing-error"))f.innerHTML="";var d=JSON.parse(this.responseText);d.result?a.innerHTML=d.items_count.items_unread+
c=0,g=a.length;c<g;c++){var b=a[c].getAttribute("data-feed-id");b&&e.push(parseInt(b))}var k=setInterval(function(){for(;0<e.length&&5>d.length;){var b=e.shift();d.push(b);Miniflux.Feed.Update(b,function(b){b=d.indexOf(b.feed_id);0<=b&&d.splice(b,1);0===e.length&&0===d.length&&(clearInterval(k),window.location.href="?action=unread")})}},100)}}}(); "/"+d.items_count.items_total:f&&(f.innerHTML=f.getAttribute("data-after-error"));b&&b(d)};f.open("POST","?action=refresh-feed&feed_id="+d,!0);f.send()}},UpdateAll:function(){var c=Array.prototype.slice.call(document.querySelectorAll("article:not([data-feed-disabled])")),b=setInterval(function(){for(;0<c.length&&5>d.length;){var a=c.shift();d.push(parseInt(a.getAttribute("data-feed-id")));Miniflux.Feed.Update(a,function(a){a=d.indexOf(a.feed_id);0<=a&&d.splice(a,1);0===c.length&&0===d.length&&(clearInterval(b),
Miniflux.Item=function(){function e(b){return item_id=b.getAttribute("data-item-id")}function d(b){if(b&&b.hasAttribute("data-reverse-label")){var a=b.innerHTML;b.innerHTML=b.getAttribute("data-reverse-label");b.setAttribute("data-reverse-label",a)}}function a(b){"mouse"!==Miniflux.Event.lastEventType&&Miniflux.Nav.SelectNextItem();b.parentNode.removeChild(b);if(b=document.getElementById("page-counter")){var a=document.querySelector("section.page"),d=parseInt(b.textContent,10)-1,c=document.getElementsByTagName("article"); window.location.href="?action=unread")})}},100)}}}();
if(0===d||0===c.length)window.location=location.href;b.textContent=d;switch(a.getAttribute("data-item-page")){case "unread":document.title="Miniflux ("+d+")";document.getElementById("nav-counter").textContent=d;break;case "feed-items":document.title="("+d+") "+b.parentNode.firstChild.nodeValue;break;default:document.title=b.parentNode.firstChild.nodeValue+" ("+d+")"}}}function c(b){var c=e(b),f=new XMLHttpRequest;f.onload=function(){if(Miniflux.Nav.IsListing())if(b.getAttribute("data-hide"))a(b); Miniflux.Item=function(){function d(e){return item_id=e.getAttribute("data-item-id")}function c(e){if(e&&e.hasAttribute("data-reverse-label")){var b=e.innerHTML;e.innerHTML=e.getAttribute("data-reverse-label");e.setAttribute("data-reverse-label",b)}}function b(e){"mouse"!==Miniflux.Event.lastEventType&&Miniflux.Nav.SelectNextItem();e.parentNode.removeChild(e);if(e=document.getElementById("page-counter")){var b=document.querySelector("section.page"),a=parseInt(e.textContent,10)-1,c=document.getElementsByTagName("article");
else{b.setAttribute("data-item-status","read");var c=b.querySelector("a.mark");d(c);(c=b.querySelector("a.mark"))&&c.setAttribute("data-action","mark-unread")}};f.open("POST","?action=mark-item-read&id="+c,!0);f.send()}function g(b){var c=e(b),f=new XMLHttpRequest;f.onload=function(){if(Miniflux.Nav.IsListing())if(b.getAttribute("data-hide"))a(b);else{b.setAttribute("data-item-status","unread");var c=b.querySelector("a.mark");d(c);(c=b.querySelector("a.mark"))&&c.setAttribute("data-action","mark-read")}}; if(0===a||0===c.length)window.location=location.href;e.textContent=a;switch(b.getAttribute("data-item-page")){case "unread":document.title="Miniflux ("+a+")";document.getElementById("nav-counter").textContent=a;break;case "feed-items":document.title="("+a+") "+e.parentNode.firstChild.nodeValue;break;default:document.title=e.parentNode.firstChild.nodeValue+" ("+a+")"}}}function a(e){var a=d(e),g=new XMLHttpRequest;g.onload=function(){if(Miniflux.Nav.IsListing())if(e.getAttribute("data-hide"))b(e);
f.open("POST","?action=mark-item-unread&id="+c,!0);f.send()}return{MarkAsRead:c,MarkAsUnread:g,MarkAsRemoved:function(b){var c=e(b),d=new XMLHttpRequest;d.onload=function(){Miniflux.Nav.IsListing()&&a(b)};d.open("POST","?action=mark-item-removed&id="+c,!0);d.send()},SwitchBookmark:function(b){var c=e(b),f="1"===b.getAttribute("data-item-bookmark")?"0":"1",h=new XMLHttpRequest;h.onload=function(){var c=document.querySelector("section.page");if(Miniflux.Nav.IsListing()&&"bookmarks"===c.getAttribute("data-item-page"))a(b); else{e.setAttribute("data-item-status","read");var a=e.querySelector("a.mark");c(a);(a=e.querySelector("a.mark"))&&a.setAttribute("data-action","mark-unread")}};g.open("POST","?action=mark-item-read&id="+a,!0);g.send()}function h(e){var a=d(e),g=new XMLHttpRequest;g.onload=function(){if(Miniflux.Nav.IsListing())if(e.getAttribute("data-hide"))b(e);else{e.setAttribute("data-item-status","unread");var a=e.querySelector("a.mark");c(a);(a=e.querySelector("a.mark"))&&a.setAttribute("data-action","mark-read")}};
else if(b.setAttribute("data-item-bookmark",f),Miniflux.Nav.IsListing())c=b.querySelector("a.bookmark"),d(c);else if((c=b.querySelector("a.bookmark-icon"))&&c.hasAttribute("data-reverse-title")){var e=c.getAttribute("title");c.setAttribute("title",c.getAttribute("data-reverse-title"));c.setAttribute("data-reverse-title",e)}};h.open("POST","?action=bookmark&id="+c+"&value="+f,!0);h.send()},SwitchStatus:function(b){var a=b.getAttribute("data-item-status");"read"===a?g(b):"unread"===a&&c(b)},Show:function(b){(b= g.open("POST","?action=mark-item-unread&id="+a,!0);g.send()}return{MarkAsRead:a,MarkAsUnread:h,MarkAsRemoved:function(a){var c=d(a),g=new XMLHttpRequest;g.onload=function(){Miniflux.Nav.IsListing()&&b(a)};g.open("POST","?action=mark-item-removed&id="+c,!0);g.send()},SwitchBookmark:function(a){var f=d(a),g="1"===a.getAttribute("data-item-bookmark")?"0":"1",k=new XMLHttpRequest;k.onload=function(){var f=document.querySelector("section.page");if(Miniflux.Nav.IsListing()&&"bookmarks"===f.getAttribute("data-item-page"))b(a);
b.querySelector("a.show"))&&b.click()},OpenOriginal:function(b){var a=b.querySelector("a.original");a&&("unread"===b.getAttribute("data-item-status")&&c(b),a.removeAttribute("data-action"),a.click())},DownloadContent:function(b){var a=document.getElementById("download-item");if(a){a.innerHTML=" "+a.getAttribute("data-before-message");a.className="loading-icon";var c=new XMLHttpRequest;c.onload=function(){var b=JSON.parse(c.responseText);a.className="";if(b.result){var d=document.getElementById("item-content"); else if(a.setAttribute("data-item-bookmark",g),Miniflux.Nav.IsListing())f=a.querySelector("a.bookmark"),c(f);else if((f=a.querySelector("a.bookmark-icon"))&&f.hasAttribute("data-reverse-title")){var d=f.getAttribute("title");f.setAttribute("title",f.getAttribute("data-reverse-title"));f.setAttribute("data-reverse-title",d)}};k.open("POST","?action=bookmark&id="+f+"&value="+g,!0);k.send()},SwitchStatus:function(b){var f=b.getAttribute("data-item-status");"read"===f?h(b):"unread"===f&&a(b)},Show:function(a){(a=
d&&(d.innerHTML=b.content);a.innerHTML=a.getAttribute("data-after-message")}else a.innerHTML=a.getAttribute("data-failure-message")};b=e(b);c.open("POST","?action=download-item&id="+b,!0);c.send()}},MarkListingAsRead:function(b){for(var a=document.getElementsByTagName("article"),c=[],d=0,g=a.length;d<g;d++)c.push(e(a[d]));a=new XMLHttpRequest;a.onload=function(){window.location.href=b};a.open("POST","?action=mark-items-as-read",!0);a.send(JSON.stringify(c))},ToggleRTLMode:function(){for(var a=["#current-item h1", a.querySelector("a.show"))&&a.click()},OpenOriginal:function(b){var f=b.querySelector("a.original");f&&("unread"===b.getAttribute("data-item-status")&&a(b),f.removeAttribute("data-action"),f.click())},DownloadContent:function(a){var b=document.getElementById("download-item");if(b){b.innerHTML=" "+b.getAttribute("data-before-message");b.className="loading-icon";var c=new XMLHttpRequest;c.onload=function(){var a=JSON.parse(c.responseText);b.className="";if(a.result){var e=document.getElementById("item-content");
"#item-content","#listing #current-item h2","#listing #current-item .preview"],c=0;c<a.length;c++){var d=document.querySelector(a[c]);d&&(d.dir=""==d.dir?"rtl":"")}}}}(); e&&(e.innerHTML=a.content);b.innerHTML=b.getAttribute("data-after-message")}else b.innerHTML=b.getAttribute("data-failure-message")};a=d(a);c.open("POST","?action=download-item&id="+a,!0);c.send()}},MarkListingAsRead:function(a){for(var b=document.getElementsByTagName("article"),c=[],k=0,h=b.length;k<h;k++)c.push(d(b[k]));b=new XMLHttpRequest;b.onload=function(){window.location.href=a};b.open("POST","?action=mark-items-as-read",!0);b.send(JSON.stringify(c))},ToggleRTLMode:function(){for(var b=["#current-item h1",
Miniflux.Event=function(){var e=[];return{lastEventType:"",ListenMouseEvents:function(){document.onclick=function(d){var a=d.target.getAttribute("data-action");if(a){Miniflux.Event.lastEventType="mouse";var c;a:{for(element=d.target;element&&element.parentNode;)if(element=element.parentNode,element.tagName&&"article"===element.tagName.toLowerCase()){c=element;break a}c=null}switch(a){case "refresh-all":d.preventDefault();Miniflux.Feed.UpdateAll();break;case "refresh-feed":d.preventDefault();Miniflux.Feed.Update(d.target.getAttribute("data-feed-id")); "#item-content","#listing #current-item h2","#listing #current-item .preview"],a=0;a<b.length;a++){var c=document.querySelector(b[a]);c&&(c.dir=""==c.dir?"rtl":"")}}}}();
break;case "mark-read":d.preventDefault();Miniflux.Item.MarkAsRead(c);break;case "mark-unread":d.preventDefault();Miniflux.Item.MarkAsUnread(c);break;case "mark-removed":d.preventDefault();Miniflux.Item.MarkAsRemoved(c);break;case "bookmark":d.preventDefault();Miniflux.Item.SwitchBookmark(c);break;case "download-item":d.preventDefault();Miniflux.Item.DownloadContent(c);break;case "original-link":d.preventDefault();Miniflux.Item.OpenOriginal(c);break;case "mark-all-read":d.preventDefault();Miniflux.Item.MarkListingAsRead("?action=unread"); Miniflux.Event=function(){var d=[];return{lastEventType:"",ListenMouseEvents:function(){document.onclick=function(c){var b=c.target.getAttribute("data-action");if(b){Miniflux.Event.lastEventType="mouse";var a;a:{for(element=c.target;element&&element.parentNode;)if(element=element.parentNode,element.tagName&&"article"===element.tagName.toLowerCase()){a=element;break a}a=null}switch(b){case "refresh-all":c.preventDefault();Miniflux.Feed.UpdateAll();break;case "refresh-feed":c.preventDefault();Miniflux.Feed.Update(a);
break;case "mark-feed-read":d.preventDefault(),Miniflux.Item.MarkListingAsRead("?action=feed-items&feed_id="+d.target.getAttribute("data-feed-id"))}}}},ListenKeyboardEvents:function(){document.onkeypress=function(d){if(63==d.keyCode||!(d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)){var a=d.target||d.srcElement;if("INPUT"!=a.tagName&&"TEXTAREA"!=a.tagName)if(Miniflux.Event.lastEventType="keyboard",e.push(d.keyCode||d.which),103===e[0])switch(e[1]){case void 0:break;case 117:window.location.href="?action=unread"; break;case "mark-read":c.preventDefault();Miniflux.Item.MarkAsRead(a);break;case "mark-unread":c.preventDefault();Miniflux.Item.MarkAsUnread(a);break;case "mark-removed":c.preventDefault();Miniflux.Item.MarkAsRemoved(a);break;case "bookmark":c.preventDefault();Miniflux.Item.SwitchBookmark(a);break;case "download-item":c.preventDefault();Miniflux.Item.DownloadContent(a);break;case "original-link":c.preventDefault();Miniflux.Item.OpenOriginal(a);break;case "mark-all-read":c.preventDefault();Miniflux.Item.MarkListingAsRead("?action=unread");
e=[];break;case 98:window.location.href="?action=bookmarks";e=[];break;case 104:window.location.href="?action=history";e=[];break;case 115:window.location.href="?action=feeds";e=[];break;case 112:window.location.href="?action=config";e=[];break;default:e=[]}else switch(e=[],a=document.getElementById("current-item"),d.keyCode||d.which){case 100:Miniflux.Item.DownloadContent(a);break;case 112:case 107:Miniflux.Nav.SelectPreviousItem();break;case 110:case 106:Miniflux.Nav.SelectNextItem();break;case 118:Miniflux.Item.OpenOriginal(a); break;case "mark-feed-read":c.preventDefault(),Miniflux.Item.MarkListingAsRead("?action=feed-items&feed_id="+c.target.getAttribute("data-feed-id"))}}}},ListenKeyboardEvents:function(){document.onkeypress=function(c){if(63==c.keyCode||!(c.ctrlKey||c.shiftKey||c.altKey||c.metaKey)){var b=c.target||c.srcElement;if("INPUT"!=b.tagName&&"TEXTAREA"!=b.tagName)if(Miniflux.Event.lastEventType="keyboard",d.push(c.keyCode||c.which),103===d[0])switch(d[1]){case void 0:break;case 117:window.location.href="?action=unread";
break;case 111:Miniflux.Item.Show(a);break;case 109:Miniflux.Item.SwitchStatus(a);break;case 102:Miniflux.Item.SwitchBookmark(a);break;case 104:Miniflux.Nav.OpenPreviousPage();break;case 108:Miniflux.Nav.OpenNextPage();break;case 114:Miniflux.Feed.UpdateAll();break;case 63:Miniflux.Nav.ShowHelp();break;case 122:Miniflux.Item.ToggleRTLMode()}}}}}}(); d=[];break;case 98:window.location.href="?action=bookmarks";d=[];break;case 104:window.location.href="?action=history";d=[];break;case 115:window.location.href="?action=feeds";d=[];break;case 112:window.location.href="?action=config";d=[];break;default:d=[]}else switch(d=[],b=document.getElementById("current-item"),c.keyCode||c.which){case 100:Miniflux.Item.DownloadContent(b);break;case 112:case 107:Miniflux.Nav.SelectPreviousItem();break;case 110:case 106:Miniflux.Nav.SelectNextItem();break;case 118:Miniflux.Item.OpenOriginal(b);
Miniflux.Nav=function(){function e(a){var c=pageYOffset+document.documentElement.clientHeight;(0>c-(a.offsetTop+a.offsetHeight)||c-a.offsetTop>document.documentElement.clientHeight)&&window.scrollTo(0,a.offsetTop-10)}function d(){return document.getElementById("listing")?!0:!1}return{OpenNextPage:function(){var a=document.getElementById("next-page");a&&a.click()},OpenPreviousPage:function(){var a=document.getElementById("previous-page");a&&a.click()},SelectNextItem:function(){var a=document.getElementById("next-item"); break;case 111:Miniflux.Item.Show(b);break;case 109:Miniflux.Item.SwitchStatus(b);break;case 102:Miniflux.Item.SwitchBookmark(b);break;case 104:Miniflux.Nav.OpenPreviousPage();break;case 108:Miniflux.Nav.OpenNextPage();break;case 114:Miniflux.Feed.UpdateAll();break;case 63:Miniflux.Nav.ShowHelp();break;case 122:Miniflux.Item.ToggleRTLMode()}}}}}}();
if(a)a.click();else if(d())if(a=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var c=0,g=a.length;c<g;c++){if("current-item"===a[c].id){c+1<g&&(a[c].id="item-"+a[c].getAttribute("data-item-id"),a[c+1].id="current-item",e(a[c+1]));break}}else a[0].id="current-item",e(a[0])},SelectPreviousItem:function(){var a=document.getElementById("previous-item");if(a)a.click();else if(d())if(a=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var c= Miniflux.Nav=function(){function d(b){var a=pageYOffset+document.documentElement.clientHeight;(0>a-(b.offsetTop+b.offsetHeight)||a-b.offsetTop>document.documentElement.clientHeight)&&window.scrollTo(0,b.offsetTop-10)}function c(){return document.getElementById("listing")?!0:!1}return{OpenNextPage:function(){var b=document.getElementById("next-page");b&&b.click()},OpenPreviousPage:function(){var b=document.getElementById("previous-page");b&&b.click()},SelectNextItem:function(){var b=document.getElementById("next-item");
a.length-1;0<=c;c--){if("current-item"===a[c].id){0<=c-1&&(a[c].id="item-"+a[c].getAttribute("data-item-id"),a[c-1].id="current-item",e(a[c-1]));break}}else a[a.length-1].id="current-item",e(a[a.length-1])},ShowHelp:function(){open("?action=show-help","Help","width=320,height=450,location=no,scrollbars=no,status=no,toolbar=no")},IsListing:d}}();Miniflux.App.Run(); if(b)b.click();else if(c())if(b=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var a=0,h=b.length;a<h;a++){if("current-item"===b[a].id){a+1<h&&(b[a].id="item-"+b[a].getAttribute("data-item-id"),b[a+1].id="current-item",d(b[a+1]));break}}else b[0].id="current-item",d(b[0])},SelectPreviousItem:function(){var b=document.getElementById("previous-item");if(b)b.click();else if(c())if(b=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var a=
b.length-1;0<=a;a--){if("current-item"===b[a].id){0<=a-1&&(b[a].id="item-"+b[a].getAttribute("data-item-id"),b[a-1].id="current-item",d(b[a-1]));break}}else b[b.length-1].id="current-item",d(b[b.length-1])},ShowHelp:function(){open("?action=show-help","Help","width=320,height=450,location=no,scrollbars=no,status=no,toolbar=no")},IsListing:c}}();Miniflux.App.Run();

View File

@ -34,7 +34,7 @@ Miniflux.Event = (function() {
break; break;
case 'refresh-feed': case 'refresh-feed':
e.preventDefault(); e.preventDefault();
Miniflux.Feed.Update(e.target.getAttribute("data-feed-id")); Miniflux.Feed.Update(currentItem);
break; break;
case 'mark-read': case 'mark-read':
e.preventDefault(); e.preventDefault();

View File

@ -9,27 +9,32 @@ Miniflux.Feed = (function() {
// Number of concurrent requests when updating all feeds // Number of concurrent requests when updating all feeds
var queue_length = 5; var queue_length = 5;
// Update the items unread/total count for the feed
function updateItemsCounter(feed_id, counts)
{
var container = document.getElementById("items-count-" + feed_id);
if (container) container.innerHTML = counts["items_unread"] + "/" + counts['items_total'];
}
return { return {
Update: function(feed_id, callback) { Update: function(feed, callback) {
var container = document.getElementById("items-count-" + feed_id); var itemsCounter = feed.querySelector("span.items-count");
if (! container) return; if (! itemsCounter) return;
//add data-feed-id to article element and couse the first h2 var feed_id = feed.getAttribute("data-feed-id")
container.parentNode.className = "loading-icon";
var heading = feed.querySelector("h2:first-of-type");
heading.className = "loading-icon";
var request = new XMLHttpRequest(); var request = new XMLHttpRequest();
request.onload = function() { request.onload = function() {
container.parentNode.className = ""; heading.className = "";
var lastChecked = feed.querySelector(".feed-last-checked");
if (lastChecked) lastChecked.innerHTML = lastChecked.getAttribute("data-after-update");
var feedParsingError = feed.querySelector(".feed-parsing-error");
if (feedParsingError) feedParsingError.innerHTML = "";
var response = JSON.parse(this.responseText); var response = JSON.parse(this.responseText);
if (response.result) updateItemsCounter(feed_id, response.items_count); if (response.result) {
itemsCounter.innerHTML = response.items_count["items_unread"] + "/" + response.items_count['items_total'];
} else {
if (feedParsingError) feedParsingError.innerHTML = feedParsingError.getAttribute("data-after-error");
}
if (callback) callback(response); if (callback) callback(response);
}; };
@ -38,19 +43,14 @@ Miniflux.Feed = (function() {
request.send(); request.send();
}, },
UpdateAll: function() { UpdateAll: function() {
var links = document.getElementsByTagName("a"); var feeds = Array.prototype.slice.call(document.querySelectorAll("article:not([data-feed-disabled])"));
for (var i = 0, ilen = links.length; i < ilen; i++) {
var feed_id = links[i].getAttribute('data-feed-id');
if (feed_id) feeds.push(parseInt(feed_id));
}
var interval = setInterval(function() { var interval = setInterval(function() {
while (feeds.length > 0 && queue.length < queue_length) { while (feeds.length > 0 && queue.length < queue_length) {
var feed_id = feeds.shift(); var feed = feeds.shift();
queue.push(feed_id); queue.push(parseInt(feed.getAttribute('data-feed-id')));
Miniflux.Feed.Update(feed_id, function(response) { Miniflux.Feed.Update(feed, function(response) {
var index = queue.indexOf(response.feed_id); var index = queue.indexOf(response.feed_id);
if (index >= 0) queue.splice(index, 1); if (index >= 0) queue.splice(index, 1);

View File

@ -20,35 +20,36 @@
<section class="items"> <section class="items">
<?php foreach ($feeds as $feed): ?> <?php foreach ($feeds as $feed): ?>
<article> <article data-feed-id="<?= $feed['id'] ?>" <?= (! $feed['enabled']) ? 'data-feed-disabled="1"' : '' ?>>
<h2 <?= (! $feed['enabled']) ? 'class="feed-disabled"' : '' ?>> <h2>
<?php if (! $feed['enabled']): ?> <?php if (! $feed['enabled']): ?>
<span title="<?= t('Subscription disabled') ?>"></a> <span title="<?= t('Subscription disabled') ?>"></a>
<?php endif ?> <?php endif ?>
<?= Helper\favicon($favicons, $feed['id']) ?> <?= Helper\favicon($favicons, $feed['id']) ?>
<a href="?action=feed-items&amp;feed_id=<?= $feed['id'] ?>" title="<?= t('Show only this subscription') ?>"><?= Helper\escape($feed['title']) ?></a> <a href="?action=feed-items&amp;feed_id=<?= $feed['id'] ?>" title="<?= t('Show only this subscription') ?>"><?= Helper\escape($feed['title']) ?></a>
<span id="items-count-<?= $feed['id'] ?>"><?= $feed['items_unread'] .'/' . $feed['items_total'] ?></span> <span class="items-count"><?= $feed['items_unread'] .'/' . $feed['items_total'] ?></span>
<?php if ($feed['enabled']): ?> <?php if ($feed['enabled']): ?>
<br/> <br/>
<?php if ($feed['last_checked']): ?> <?php if ($feed['last_checked']): ?>
<time class="feed-last-checked" id="last-checked-feed-<?= $feed['id'] ?>" data-after-update="<?= t('updated just now') ?>"> <time class="feed-last-checked" data-after-update="<?= t('updated just now') ?>">
<?= t('checked at').' '.dt('%e %B %Y %k:%M', $feed['last_checked']) ?> <?= t('checked at').' '.dt('%e %B %Y %k:%M', $feed['last_checked']) ?>
</time> </time>
<?php else: ?> <?php else: ?>
<span class="feed-last-checked" id="last-checked-feed-<?= $feed['id'] ?>" data-after-update="<?= t('updated just now') ?>"> <span class="feed-last-checked" data-after-update="<?= t('updated just now') ?>">
<?= t('never updated after creation') ?> <?= t('never updated after creation') ?>
</span> </span>
<?php endif ?> <?php endif ?>
<?php if ($feed['parsing_error']): ?> <span class="feed-parsing-error" data-after-error="<?= t('(error occurred during the last check)') ?>">
<span class="feed-parsing-error"><?= t('(error occurred during the last check)') ?></span> <?php if ($feed['parsing_error']): ?>
<?php endif ?> <?= t('(error occurred during the last check)') ?>
<?php endif ?>
</span>
<?php endif ?> <?php endif ?>
</h2> </h2>
@ -59,7 +60,7 @@
<?php if ($feed['enabled']): ?> <?php if ($feed['enabled']): ?>
<li> <li>
<a href="?action=refresh-feed&amp;feed_id=<?= $feed['id'] ?>" data-feed-id="<?= $feed['id'] ?>" data-action="refresh-feed"><?= t('refresh') ?></a> <a href="?action=refresh-feed&amp;feed_id=<?= $feed['id'] ?>" data-action="refresh-feed"><?= t('refresh') ?></a>
</li> </li>
<?php endif ?> <?php endif ?>

View File

@ -5083,10 +5083,10 @@ span#nav-counter:not(:empty):after,
span#page-counter:not(:empty):after { span#page-counter:not(:empty):after {
content: ")"; content: ")";
} }
span[id^="items-count-"]:before { span.items-count:before {
content: "("; content: "(";
} }
span[id^="items-count-"]:after { span.items-count:after {
content: ")"; content: ")";
} }
.loading-icon:before { .loading-icon:before {

View File

@ -56,7 +56,7 @@ span {
} }
} }
&[id^="items-count-"] { &.items-count {
&:before { &:before {
content: "@{icon-bracket-open}"; content: "@{icon-bracket-open}";
} }

View File

@ -5083,10 +5083,10 @@ span#nav-counter:not(:empty):after,
span#page-counter:not(:empty):after { span#page-counter:not(:empty):after {
content: ")"; content: ")";
} }
span[id^="items-count-"]:before { span.items-count:before {
content: "("; content: "(";
} }
span[id^="items-count-"]:after { span.items-count:after {
content: ")"; content: ")";
} }
.loading-icon:before { .loading-icon:before {

View File

@ -56,7 +56,7 @@ span {
} }
} }
&[id^="items-count-"] { &.items-count {
&:before { &:before {
content: "@{icon-bracket-open}"; content: "@{icon-bracket-open}";
} }

View File

@ -231,9 +231,9 @@ span#nav-counter:not(:empty):before, span#page-counter:not(:empty):before {
content: " ("; } content: " ("; }
span#nav-counter:not(:empty):after, span#page-counter:not(:empty):after { span#nav-counter:not(:empty):after, span#page-counter:not(:empty):after {
content: ")"; } content: ")"; }
span[id^="items-count-"]:before { span.items-count:before {
content: "("; } content: "("; }
span[id^="items-count-"]:after { span.items-count:after {
content: ")"; } content: ")"; }
section.page { section.page {

View File

@ -135,7 +135,7 @@ span {
} }
} }
&[id^="items-count-"] { &.items-count {
&:before { &:before {
content: $icon-bracket-open; content: $icon-bracket-open;
} }