Change loading icon to use an utf8 symbol

This commit is contained in:
Frédéric Guillot 2014-02-22 21:50:54 -05:00
parent 754dcdd274
commit 6ed3ec788a
9 changed files with 66 additions and 27 deletions

View File

@ -617,6 +617,16 @@ iframe {
color: #333; color: #333;
} }
.loading-icon {
color: #000;
opacity: 1;
transition: opacity 0.2s ease-in-out;
}
.loading-icon-blink {
opacity: 0;
}
/* desktop design */ /* desktop design */
@media only screen and (min-width: 480px) { @media only screen and (min-width: 480px) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 847 B

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

@ -1,22 +1,24 @@
var Miniflux={};Miniflux.App=function(){return{Run:function(){Miniflux.Event.ListenKeyboardEvents();Miniflux.Event.ListenMouseEvents()},MozillaAuth:function(e){navigator.id.watch({onlogin:function(a){var b=new XMLHttpRequest;b.open("POST","?action="+e+"&token="+a,!0);b.setRequestHeader("Connection","close");b.onload=function(){window.location.href=this.responseText};b.send("token="+a)},onlogout:function(){}});navigator.id.request()}}}(); var Miniflux={};
Miniflux.Feed=function(){function e(b){if(b=document.getElementById("loading-feed-"+b)){var a=document.createElement("img");a.src="assets/img/refresh.gif";b.appendChild(a)}}function a(){for(var a=document.getElementsByTagName("a"),d=0,e=a.length;d<e;d++){var c=a[d].getAttribute("data-feed-id");c&&b.push(parseInt(c))}}var b=[],d=[];return{Update:function(b,a){e(b);var d=new XMLHttpRequest;d.onload=function(){var c=document.getElementById("loading-feed-"+b);c&&(c.innerHTML="");if(c=document.getElementById("last-checked-feed-"+ Miniflux.App=function(){return{BlinkIcon:function(){var d=document.querySelectorAll(".loading-icon");[].forEach.call(d,function(c){c.classList.toggle("loading-icon-blink")})},Run:function(){Miniflux.Event.ListenKeyboardEvents();Miniflux.Event.ListenMouseEvents()},MozillaAuth:function(d){navigator.id.watch({onlogin:function(c){var a=new XMLHttpRequest;a.open("POST","?action="+d+"&token="+c,!0);a.setRequestHeader("Connection","close");a.onload=function(){window.location.href=this.responseText};a.send("token="+
b))c.innerHTML=c.getAttribute("data-after-update");try{var g=JSON.parse(this.responseText);if(g.result){var m=g.items_count,d=document.getElementById("items-count-"+b);d&&(d.innerHTML="("+m.items_unread+"/"+m.items_total+")")}a&&a(g)}catch(e){}};d.open("POST","?action=refresh-feed&feed_id="+b,!0);d.send()},UpdateAll:function(){a();var e=setInterval(function(){for(;0<b.length&&5>d.length;){var a=b.shift();d.push(a);Miniflux.Feed.Update(a,function(a){a=d.indexOf(a.feed_id);0<=a&&d.splice(a,1);0==b.length&& c)},onlogout:function(){}});navigator.id.request()}}}();
0==d.length&&(clearInterval(e),window.location.href="?action=unread")})}},100)}}}(); Miniflux.Feed=function(){function d(a){if(a=document.getElementById("loading-feed-"+a))a.appendChild(document.createTextNode("\u2600")),a.classList.add("loading-icon-blink");f||(f=setInterval(Miniflux.App.BlinkIcon,500))}function c(){for(var c=document.getElementsByTagName("a"),e=0,b=c.length;e<b;e++){var g=c[e].getAttribute("data-feed-id");g&&a.push(parseInt(g))}}var a=[],e=[],f;return{Update:function(a,c){d(a);var b=new XMLHttpRequest;b.onload=function(){var b=document.getElementById("loading-feed-"+
Miniflux.Item=function(){function e(c){var b=document.getElementById("item-"+c);b||(b=document.getElementById("current-item"),b.getAttribute("data-item-id")!=c&&(b=!1));return b}function a(c){if((c=document.getElementById("bookmark-"+c))&&c.getAttribute("data-reverse-label")){var b=c.innerHTML;c.innerHTML=c.getAttribute("data-reverse-label");c.setAttribute("data-reverse-label",b)}}function b(c){if(c=document.getElementById("status-"+c)){var b=c.innerHTML;c.innerHTML=c.getAttribute("data-reverse-label"); a);b&&(b.innerHTML="");if(b=document.getElementById("last-checked-feed-"+a))b.innerHTML=b.getAttribute("data-after-update");try{var k=JSON.parse(this.responseText);if(k.result){var e=k.items_count,d=document.getElementById("items-count-"+a);d&&(d.innerHTML="("+e.items_unread+"/"+e.items_total+")")}c&&c(k)}catch(f){}};b.open("POST","?action=refresh-feed&feed_id="+a,!0);b.send()},UpdateAll:function(){c();var d=setInterval(function(){for(;0<a.length&&5>e.length;){var c=a.shift();e.push(c);Miniflux.Feed.Update(c,
c.setAttribute("data-reverse-label",b)}}function d(c){"mouse"!=Miniflux.Event.lastEventType&&Miniflux.Nav.SelectNextItem();c.parentNode.removeChild(c);if(c=document.getElementById("page-counter"))counter=parseInt(c.textContent.trim(),10)-1,0==counter?window.location="?action=unread":(c.textContent=counter+" ",document.title="miniflux ("+counter+")",document.getElementById("nav-counter").textContent="("+counter+")")}function f(c){var a=new XMLHttpRequest;a.onload=function(){if(Miniflux.Nav.IsListing()){var a= function(b){b=e.indexOf(b.feed_id);0<=b&&e.splice(b,1);0==a.length&&0==e.length&&(clearInterval(d),clearInterval(f),window.location.href="?action=unread")})}},100)}}}();
e(c);if(a)if(a.getAttribute("data-hide"))d(a);else{a.setAttribute("data-item-status","read");b(c);if(a=document.getElementById("show-"+c)){a.className="read";var g=document.createElement("span");g.id="read-icon-"+c;g.appendChild(document.createTextNode("\u2611 "));a.parentNode.insertBefore(g,a)}(a=document.getElementById("status-"+c))&&a.setAttribute("data-action","mark-unread")}}};a.open("POST","?action=mark-item-read&id="+c,!0);a.send()}function k(c){var a=new XMLHttpRequest;a.onload=function(){if(Miniflux.Nav.IsListing()){var a= Miniflux.Item=function(){function d(b){var a=document.getElementById("item-"+b);a||(a=document.getElementById("current-item"),a.getAttribute("data-item-id")!=b&&(a=!1));return a}function c(b){if((b=document.getElementById("bookmark-"+b))&&b.getAttribute("data-reverse-label")){var a=b.innerHTML;b.innerHTML=b.getAttribute("data-reverse-label");b.setAttribute("data-reverse-label",a)}}function a(b){if(b=document.getElementById("status-"+b)){var a=b.innerHTML;b.innerHTML=b.getAttribute("data-reverse-label");
e(c);if(a)if(a.getAttribute("data-hide"))d(a);else{a.setAttribute("data-item-status","unread");b(c);if(a=document.getElementById("show-"+c))a.className="";(a=document.getElementById("read-icon-"+c))&&a.parentNode.removeChild(a);(a=document.getElementById("status-"+c))&&a.setAttribute("data-action","mark-read")}}};a.open("POST","?action=mark-item-unread&id="+c,!0);a.send()}function l(c,b){var d=c.getAttribute("data-item-id"),e=new XMLHttpRequest;e.onload=function(){c.setAttribute("data-item-bookmark", b.setAttribute("data-reverse-label",a)}}function e(b){"mouse"!=Miniflux.Event.lastEventType&&Miniflux.Nav.SelectNextItem();b.parentNode.removeChild(b);if(b=document.getElementById("page-counter"))counter=parseInt(b.textContent.trim(),10)-1,0==counter?window.location="?action=unread":(b.textContent=counter+" ",document.title="miniflux ("+counter+")",document.getElementById("nav-counter").textContent="("+counter+")")}function f(b){var c=new XMLHttpRequest;c.onload=function(){if(Miniflux.Nav.IsListing()){var c=
b);if(b)if(Miniflux.Nav.IsListing()){if(h=document.getElementById("show-"+d)){var e=document.createElement("span");e.id="bookmark-icon-"+d;e.appendChild(document.createTextNode("\u2605 "));h.parentNode.insertBefore(e,h)}a(d)}else{var h=document.getElementById("bookmark-"+d);h&&(h.innerHTML="\u2605")}else if(Miniflux.Nav.IsListing())(e=document.getElementById("bookmark-icon-"+d))&&e.parentNode.removeChild(e),a(d);else if(e=document.getElementById("bookmark-"+d))e.innerHTML="\u2606"};e.open("POST", d(b);if(c)if(c.getAttribute("data-hide"))e(c);else{c.setAttribute("data-item-status","read");a(b);if(c=document.getElementById("show-"+b)){c.className="read";var g=document.createElement("span");g.id="read-icon-"+b;g.appendChild(document.createTextNode("\u2611 "));c.parentNode.insertBefore(g,c)}(c=document.getElementById("status-"+b))&&c.setAttribute("data-action","mark-unread")}}};c.open("POST","?action=mark-item-read&id="+b,!0);c.send()}function h(b){var c=new XMLHttpRequest;c.onload=function(){if(Miniflux.Nav.IsListing()){var c=
"?action=bookmark&id="+d+"&value="+b,!0);e.send()}return{Get:e,MarkAsRead:f,MarkAsUnread:k,SwitchBookmark:function(c){"1"==c.getAttribute("data-item-bookmark")?l(c,0):l(c,1)},SwitchStatus:function(c){var a=c.getAttribute("data-item-id");c=c.getAttribute("data-item-status");"read"==c?k(a):"unread"==c&&f(a)},ChangeStatus:function(c,a){switch(a){case "read":f(c);break;case "unread":k(c)}},Show:function(c){(c=document.getElementById("show-"+c))&&c.click()},OpenOriginal:function(c){var a=document.getElementById("original-"+ d(b);if(c)if(c.getAttribute("data-hide"))e(c);else{c.setAttribute("data-item-status","unread");a(b);if(c=document.getElementById("show-"+b))c.className="";(c=document.getElementById("read-icon-"+b))&&c.parentNode.removeChild(c);(c=document.getElementById("status-"+b))&&c.setAttribute("data-action","mark-read")}}};c.open("POST","?action=mark-item-unread&id="+b,!0);c.send()}function l(b,a){var e=b.getAttribute("data-item-id"),d=new XMLHttpRequest;d.onload=function(){b.setAttribute("data-item-bookmark",
c);a&&("unread"==e(c).getAttribute("data-item-status")&&f(c),a.removeAttribute("data-action"),a.click())},DownloadContent:function(){var a=document.getElementById("download-item");if(a){var b=a.getAttribute("data-item-id"),d=a.getAttribute("data-before-message"),e=document.createElement("img");e.src="./assets/img/refresh.gif";a.innerHTML="";a.className="downloading";a.appendChild(e);a.appendChild(document.createTextNode(" "+d));var f=new XMLHttpRequest;f.onload=function(){var b=JSON.parse(f.responseText); a);if(a)if(Miniflux.Nav.IsListing()){if(f=document.getElementById("show-"+e)){var d=document.createElement("span");d.id="bookmark-icon-"+e;d.appendChild(document.createTextNode("\u2605 "));f.parentNode.insertBefore(d,f)}c(e)}else{var f=document.getElementById("bookmark-"+e);f&&(f.innerHTML="\u2605")}else if(Miniflux.Nav.IsListing())(d=document.getElementById("bookmark-icon-"+e))&&d.parentNode.removeChild(d),c(e);else if(d=document.getElementById("bookmark-"+e))d.innerHTML="\u2606"};d.open("POST",
if(b.result){var d=document.getElementById("item-content");d&&(d.innerHTML=b.content);a&&(b=a.getAttribute("data-after-message"),a.innerHTML="",a.appendChild(document.createTextNode(" "+b)))}else a&&(b=a.getAttribute("data-failure-message"),a.innerHTML="",a.appendChild(document.createTextNode(" "+b)))};f.open("POST","?action=download-item&id="+b,!0);f.send()}},MarkListingAsRead:function(a){for(var b=document.getElementsByTagName("article"),d=[],e=0,f=b.length;e<f;e++)d.push(b[e].getAttribute("data-item-id")); "?action=bookmark&id="+e+"&value="+a,!0);d.send()}return{Get:d,MarkAsRead:f,MarkAsUnread:h,SwitchBookmark:function(b){"1"==b.getAttribute("data-item-bookmark")?l(b,0):l(b,1)},SwitchStatus:function(b){var a=b.getAttribute("data-item-id");b=b.getAttribute("data-item-status");"read"==b?h(a):"unread"==b&&f(a)},ChangeStatus:function(b,a){switch(a){case "read":f(b);break;case "unread":h(b)}},Show:function(b){(b=document.getElementById("show-"+b))&&b.click()},OpenOriginal:function(b){var a=document.getElementById("original-"+
b=new XMLHttpRequest;b.onload=function(){window.location.href=a};b.open("POST","?action=mark-items-as-read",!0);b.send(JSON.stringify(d))}}}(); b);a&&("unread"==d(b).getAttribute("data-item-status")&&f(b),a.removeAttribute("data-action"),a.click())},DownloadContent:function(){var b=document.getElementById("download-item");if(b){var a=b.getAttribute("data-item-id"),c=b.getAttribute("data-before-message"),e=document.createElement("span");e.appendChild(document.createTextNode("\u2600"));e.className="loading-icon";b.innerHTML="";b.className="downloading";b.appendChild(e);b.appendChild(document.createTextNode(" "+c));var d=setInterval(Miniflux.App.BlinkIcon,
Miniflux.Event=function(){var e=[];return{lastEventType:"",ListenMouseEvents:function(){document.onclick=function(a){var b=a.target.getAttribute("data-action");if(b)switch(Miniflux.Event.lastEventType="mouse",b){case "refresh-all":a.preventDefault();Miniflux.Feed.UpdateAll();break;case "refresh-feed":a.preventDefault();Miniflux.Feed.Update(a.target.getAttribute("data-feed-id"));break;case "mark-read":a.preventDefault();Miniflux.Item.MarkAsRead(a.target.getAttribute("data-item-id"));break;case "mark-unread":a.preventDefault(); 250),f=new XMLHttpRequest;f.onload=function(){var a=JSON.parse(f.responseText);clearInterval(d);if(a.result){var c=document.getElementById("item-content");c&&(c.innerHTML=a.content);b&&(a=b.getAttribute("data-after-message"),b.innerHTML="",b.appendChild(document.createTextNode(" "+a)))}else b&&(a=b.getAttribute("data-failure-message"),b.innerHTML="",b.appendChild(document.createTextNode(" "+a)))};f.open("POST","?action=download-item&id="+a,!0);f.send()}},MarkListingAsRead:function(a){for(var c=document.getElementsByTagName("article"),
Miniflux.Item.MarkAsUnread(a.target.getAttribute("data-item-id"));break;case "bookmark":a.preventDefault();Miniflux.Item.SwitchBookmark(Miniflux.Item.Get(a.target.getAttribute("data-item-id")));break;case "download-item":a.preventDefault();Miniflux.Item.DownloadContent();break;case "original-link":Miniflux.Item.OpenOriginal(a.target.getAttribute("data-item-id"));break;case "mark-all-read":a.preventDefault();Miniflux.Item.MarkListingAsRead("?action=unread");break;case "mark-feed-read":a.preventDefault(); e=[],d=0,f=c.length;d<f;d++)e.push(c[d].getAttribute("data-item-id"));c=new XMLHttpRequest;c.onload=function(){window.location.href=a};c.open("POST","?action=mark-items-as-read",!0);c.send(JSON.stringify(e))}}}();
Miniflux.Item.MarkListingAsRead("?action=feed-items&feed_id="+a.target.getAttribute("data-feed-id"));break;case "mozilla-login":a.preventDefault();Miniflux.App.MozillaAuth("mozilla-auth");break;case "mozilla-link":a.preventDefault(),Miniflux.App.MozillaAuth("mozilla-link")}}},ListenKeyboardEvents:function(){document.onkeypress=function(a){Miniflux.Event.lastEventType="keyboard";e.push(a.keyCode||a.which);if(103==e[0])switch(e[1]){case void 0:break;case 117:window.location.href="?action=unread";e= Miniflux.Event=function(){var d=[];return{lastEventType:"",ListenMouseEvents:function(){document.onclick=function(c){var a=c.target.getAttribute("data-action");if(a)switch(Miniflux.Event.lastEventType="mouse",a){case "refresh-all":c.preventDefault();Miniflux.Feed.UpdateAll();break;case "refresh-feed":c.preventDefault();Miniflux.Feed.Update(c.target.getAttribute("data-feed-id"));break;case "mark-read":c.preventDefault();Miniflux.Item.MarkAsRead(c.target.getAttribute("data-item-id"));break;case "mark-unread":c.preventDefault();
[];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.keyCode||a.which){case 100:Miniflux.Item.DownloadContent(Miniflux.Nav.GetCurrentItemId());break;case 112:case 107:Miniflux.Nav.SelectPreviousItem();break;case 110:case 106:Miniflux.Nav.SelectNextItem();break;case 118:Miniflux.Item.OpenOriginal(Miniflux.Nav.GetCurrentItemId()); Miniflux.Item.MarkAsUnread(c.target.getAttribute("data-item-id"));break;case "bookmark":c.preventDefault();Miniflux.Item.SwitchBookmark(Miniflux.Item.Get(c.target.getAttribute("data-item-id")));break;case "download-item":c.preventDefault();Miniflux.Item.DownloadContent();break;case "original-link":Miniflux.Item.OpenOriginal(c.target.getAttribute("data-item-id"));break;case "mark-all-read":c.preventDefault();Miniflux.Item.MarkListingAsRead("?action=unread");break;case "mark-feed-read":c.preventDefault();
Miniflux.Item.MarkListingAsRead("?action=feed-items&feed_id="+c.target.getAttribute("data-feed-id"));break;case "mozilla-login":c.preventDefault();Miniflux.App.MozillaAuth("mozilla-auth");break;case "mozilla-link":c.preventDefault(),Miniflux.App.MozillaAuth("mozilla-link")}}},ListenKeyboardEvents:function(){document.onkeypress=function(c){Miniflux.Event.lastEventType="keyboard";d.push(c.keyCode||c.which);if(103==d[0])switch(d[1]){case void 0:break;case 117:window.location.href="?action=unread";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=[],c.keyCode||c.which){case 100:Miniflux.Item.DownloadContent(Miniflux.Nav.GetCurrentItemId());break;case 112:case 107:Miniflux.Nav.SelectPreviousItem();break;case 110:case 106:Miniflux.Nav.SelectNextItem();break;case 118:Miniflux.Item.OpenOriginal(Miniflux.Nav.GetCurrentItemId());
break;case 111:Miniflux.Item.Show(Miniflux.Nav.GetCurrentItemId());break;case 109:Miniflux.Item.SwitchStatus(Miniflux.Nav.GetCurrentItem());break;case 102:Miniflux.Item.SwitchBookmark(Miniflux.Nav.GetCurrentItem());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 111:Miniflux.Item.Show(Miniflux.Nav.GetCurrentItemId());break;case 109:Miniflux.Item.SwitchStatus(Miniflux.Nav.GetCurrentItem());break;case 102:Miniflux.Item.SwitchBookmark(Miniflux.Nav.GetCurrentItem());break;case 104:Miniflux.Nav.OpenPreviousPage();break;case 108:Miniflux.Nav.OpenNextPage();break;case 114:Miniflux.Feed.UpdateAll();break;case 63:Miniflux.Nav.ShowHelp()}}}}}();
Miniflux.Nav=function(){function e(a){var d=pageYOffset+document.documentElement.clientHeight;(0>d-(a.offsetTop+a.offsetHeight)||d-a.offsetTop>document.documentElement.clientHeight)&&window.scrollTo(0,a.offsetTop-10)}function a(){return document.getElementById("listing")?!0:!1}return{GetCurrentItem:function(){return document.getElementById("current-item")},GetCurrentItemId:function(){var a=Miniflux.Nav.GetCurrentItem();return a?a.getAttribute("data-item-id"):null},OpenNextPage:function(){var a=document.getElementById("next-page"); Miniflux.Nav=function(){function d(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 c(){return document.getElementById("listing")?!0:!1}return{GetCurrentItem:function(){return document.getElementById("current-item")},GetCurrentItemId:function(){var a=Miniflux.Nav.GetCurrentItem();return a?a.getAttribute("data-item-id"):null},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 b=document.getElementById("next-item");if(b)b.click();else if(a())if(b=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var d=0,f=b.length;d<f;d++){if("current-item"==b[d].id){b[d].id="item-"+b[d].getAttribute("data-item-id");d+1<f&&(b[d+1].id="current-item",e(b[d+1]));break}}else b[0].id="current-item",e(b[0])},SelectPreviousItem:function(){var b= a&&a.click()},OpenPreviousPage:function(){var a=document.getElementById("previous-page");a&&a.click()},SelectNextItem:function(){var a=document.getElementById("next-item");if(a)a.click();else if(c())if(a=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var e=0,f=a.length;e<f;e++){if("current-item"==a[e].id){a[e].id="item-"+a[e].getAttribute("data-item-id");e+1<f&&(a[e+1].id="current-item",d(a[e+1]));break}}else a[0].id="current-item",d(a[0])},SelectPreviousItem:function(){var a=
document.getElementById("previous-item");if(b)b.click();else if(a())if(b=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var d=b.length-1;0<=d;d--){if("current-item"==b[d].id){b[d].id="item-"+b[d].getAttribute("data-item-id");0<=d-1&&(b[d-1].id="current-item",e(b[d-1]));break}}else b[b.length-1].id="current-item",e(b[b.length-1])},ShowHelp:function(){open("?action=show-help","Help","width=320,height=450,location=no,scrollbars=no,status=no,toolbar=no")},IsListing:a}}(); document.getElementById("previous-item");if(a)a.click();else if(c())if(a=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var e=a.length-1;0<=e;e--){if("current-item"==a[e].id){a[e].id="item-"+a[e].getAttribute("data-item-id");0<=e-1&&(a[e-1].id="current-item",d(a[e-1]));break}}else a[a.length-1].id="current-item",d(a[a.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(); Miniflux.App.Run();

View File

@ -3,6 +3,14 @@ var Miniflux = {};
Miniflux.App = (function() { Miniflux.App = (function() {
return { return {
// Blink the refresh icon to avoid to load an image and just for fun
BlinkIcon: function() {
var icons = document.querySelectorAll(".loading-icon");
[].forEach.call(icons, function(icon) {
icon.classList.toggle("loading-icon-blink");
});
},
Run: function() { Run: function() {
Miniflux.Event.ListenKeyboardEvents(); Miniflux.Event.ListenKeyboardEvents();
Miniflux.Event.ListenMouseEvents(); Miniflux.Event.ListenMouseEvents();

View File

@ -9,15 +9,21 @@ 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;
// Interval reference for the loading icon
var icon_interval;
// Show the refresh icon when updating a feed // Show the refresh icon when updating a feed
function showRefreshIcon(feed_id) function showRefreshIcon(feed_id)
{ {
var container = document.getElementById("loading-feed-" + feed_id); var container = document.getElementById("loading-feed-" + feed_id);
if (container) { if (container) {
var img = document.createElement("img"); container.appendChild(document.createTextNode("☀"));
img.src = "assets/img/refresh.gif"; container.classList.add("loading-icon-blink");
container.appendChild(img); }
if (! icon_interval) {
icon_interval = setInterval(Miniflux.App.BlinkIcon, 500);
} }
} }
@ -91,6 +97,7 @@ Miniflux.Feed = (function() {
if (feeds.length == 0 && queue.length == 0) { if (feeds.length == 0 && queue.length == 0) {
clearInterval(interval); clearInterval(interval);
clearInterval(icon_interval);
window.location.href = "?action=unread"; window.location.href = "?action=unread";
} }
}); });

View File

@ -256,19 +256,23 @@ Miniflux.Item = (function() {
var item_id = container.getAttribute("data-item-id"); var item_id = container.getAttribute("data-item-id");
var message = container.getAttribute("data-before-message"); var message = container.getAttribute("data-before-message");
var img = document.createElement("img"); var span = document.createElement("span");
img.src = "./assets/img/refresh.gif"; span.appendChild(document.createTextNode("☀"));
span.className = "loading-icon";
container.innerHTML = ""; container.innerHTML = "";
container.className = "downloading"; container.className = "downloading";
container.appendChild(img); container.appendChild(span);
container.appendChild(document.createTextNode(" " + message)); container.appendChild(document.createTextNode(" " + message));
var icon_interval = setInterval(Miniflux.App.BlinkIcon, 250);
var request = new XMLHttpRequest(); var request = new XMLHttpRequest();
request.onload = function() { request.onload = function() {
var response = JSON.parse(request.responseText); var response = JSON.parse(request.responseText);
clearInterval(icon_interval);
if (response.result) { if (response.result) {

View File

@ -25,7 +25,7 @@
<?php if (! $feed['enabled']): ?> <?php if (! $feed['enabled']): ?>
<span title="<?= t('Subscription disabled') ?>"></a> <span title="<?= t('Subscription disabled') ?>"></a>
<?php else: ?> <?php else: ?>
<span id="loading-feed-<?= $feed['id'] ?>"></span> <span id="loading-feed-<?= $feed['id'] ?>" class="loading-icon"></span>
<?php endif ?> <?php endif ?>
<span id="items-count-<?= $feed['id'] ?>">(<?= $feed['items_unread'] .'/' . $feed['items_total'] ?>)</span> <span id="items-count-<?= $feed['id'] ?>">(<?= $feed['items_unread'] .'/' . $feed['items_total'] ?>)</span>

View File

@ -148,3 +148,7 @@ textarea:focus {
text-decoration: none; text-decoration: none;
color: #fff; color: #fff;
} }
.loading-icon {
color: #fff;
}

View File

@ -183,4 +183,8 @@ textarea:focus {
.menu-more a { .menu-more a {
text-decoration: none; text-decoration: none;
color: #fff; color: #fff;
}
.loading-icon {
color: #fff;
} }