diff --git a/assets/js/all.min.js b/assets/js/all.min.js index 6878a11..c79e567 100644 --- a/assets/js/all.min.js +++ b/assets/js/all.min.js @@ -1,19 +1,20 @@ -var Miniflux={};Miniflux.App=function(){return{BlinkIcon:function(){var e=document.querySelectorAll(".loading-icon");[].forEach.call(e,function(a){a.classList.toggle("loading-icon-blink")})},Run:function(){Miniflux.Event.ListenKeyboardEvents();Miniflux.Event.ListenMouseEvents()}}}(); -Miniflux.Feed=function(){function e(d){if(d=document.getElementById("loading-feed-"+d))d.appendChild(document.createTextNode("\u2600")),d.classList.add("loading-icon-blink");f||(f=setInterval(Miniflux.App.BlinkIcon,500))}function a(){for(var d=document.getElementsByTagName("a"),l=0,c=d.length;lc.length;){var a=b.shift();c.push(a);Miniflux.Feed.Update(a, -function(a){a=c.indexOf(a.feed_id);0<=a&&c.splice(a,1);0==b.length&&0==c.length&&(clearInterval(d),clearInterval(f),window.location.href="?action=unread")})}},100)}}}(); -Miniflux.Item=function(){function e(d){return item_id=d.getAttribute("data-item-id")}function a(d){if(d&&d.hasAttribute("data-reverse-label")){var b=d.innerHTML;d.innerHTML=d.getAttribute("data-reverse-label");d.setAttribute("data-reverse-label",b)}}function b(d){"mouse"!==Miniflux.Event.lastEventType&&Miniflux.Nav.SelectNextItem();d.parentNode.removeChild(d);var b=document.getElementById("page-counter");if(b){d=d.getAttribute("data-item-page");var a=parseInt(b.textContent,10)-1,c=document.getElementsByTagName("article"); -if(0===a||0===c.length)window.location=location.href;b.textContent=a;switch(d){case "unread":document.title="Miniflux ("+a+")";document.getElementById("nav-counter").textContent=a;break;case "feed-items":document.title="("+a+") "+b.parentNode.firstChild.nodeValue;break;default:document.title=b.parentNode.firstChild.nodeValue+" ("+a+")"}}}function c(d){var c=e(d),g=new XMLHttpRequest;g.onload=function(){if(Miniflux.Nav.IsListing())if(d.getAttribute("data-hide"))b(d);else{d.setAttribute("data-item-status", -"read");var c=d.querySelector("a.mark");a(c);(c=d.querySelector("a.mark"))&&c.setAttribute("data-action","mark-unread")}};g.open("POST","?action=mark-item-read&id="+c,!0);g.send()}function f(d){var c=e(d),g=new XMLHttpRequest;g.onload=function(){if(Miniflux.Nav.IsListing())if(d.getAttribute("data-hide"))b(d);else{d.setAttribute("data-item-status","unread");var c=d.querySelector("a.mark");a(c);(c=d.querySelector("a.mark"))&&c.setAttribute("data-action","mark-read")}};g.open("POST","?action=mark-item-unread&id="+ -c,!0);g.send()}return{MarkAsRead:c,MarkAsUnread:f,MarkAsRemoved:function(d){var a=e(d),c=new XMLHttpRequest;c.onload=function(){Miniflux.Nav.IsListing()&&b(d)};c.open("POST","?action=mark-item-removed&id="+a,!0);c.send()},SwitchBookmark:function(d){var c=e(d),g="1"===d.getAttribute("data-item-bookmark")?"0":"1",h=new XMLHttpRequest;h.onload=function(){if(Miniflux.Nav.IsListing()&&"bookmarks"===d.getAttribute("data-item-page"))b(d);else if(d.setAttribute("data-item-bookmark",g),Miniflux.Nav.IsListing()){var c= -d.querySelector("a.bookmark");a(c)}};h.open("POST","?action=bookmark&id="+c+"&value="+g,!0);h.send()},SwitchStatus:function(d){var b=d.getAttribute("data-item-status");"read"===b?f(d):"unread"===b&&c(d)},Show:function(b){(b=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){b= -e(b);var c=a.getAttribute("data-before-message"),h=document.createElement("span");h.appendChild(document.createTextNode("\u2600"));h.className="loading-icon";a.innerHTML="";a.className="downloading";a.appendChild(h);a.appendChild(document.createTextNode(" "+c));var f=setInterval(Miniflux.App.BlinkIcon,250),k=new XMLHttpRequest;k.onload=function(){var b=JSON.parse(k.responseText);clearInterval(f);if(b.result){var c=document.getElementById("item-content");c&&(c.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)))};k.open("POST","?action=download-item&id="+b,!0);k.send()}},MarkListingAsRead:function(b){for(var a=document.getElementsByTagName("article"),c=[],f=0,m=a.length;fa.length;){var c=b.shift();a.push(c);Miniflux.Feed.Update(c, +function(c){c=a.indexOf(c.feed_id);0<=c&&a.splice(c,1);0==b.length&&0==a.length&&(clearInterval(d),clearInterval(f),window.location.href="?action=unread")})}},100)}}}(); +Miniflux.Item=function(){function e(d){return item_id=d.getAttribute("data-item-id")}function c(d){if(d&&d.hasAttribute("data-reverse-label")){var b=d.innerHTML;d.innerHTML=d.getAttribute("data-reverse-label");d.setAttribute("data-reverse-label",b)}}function b(d){"mouse"!==Miniflux.Event.lastEventType&&Miniflux.Nav.SelectNextItem();d.parentNode.removeChild(d);var b=document.getElementById("page-counter");if(b){d=d.getAttribute("data-item-page");var c=parseInt(b.textContent,10)-1,a=document.getElementsByTagName("article"); +if(0===c||0===a.length)window.location=location.href;b.textContent=c;switch(d){case "unread":document.title="Miniflux ("+c+")";document.getElementById("nav-counter").textContent=c;break;case "feed-items":document.title="("+c+") "+b.parentNode.firstChild.nodeValue;break;default:document.title=b.parentNode.firstChild.nodeValue+" ("+c+")"}}}function a(d){var a=e(d),g=new XMLHttpRequest;g.onload=function(){if(Miniflux.Nav.IsListing())if(d.getAttribute("data-hide"))b(d);else{d.setAttribute("data-item-status", +"read");var a=d.querySelector("a.mark");c(a);(a=d.querySelector("a.mark"))&&a.setAttribute("data-action","mark-unread")}};g.open("POST","?action=mark-item-read&id="+a,!0);g.send()}function f(d){var a=e(d),g=new XMLHttpRequest;g.onload=function(){if(Miniflux.Nav.IsListing())if(d.getAttribute("data-hide"))b(d);else{d.setAttribute("data-item-status","unread");var a=d.querySelector("a.mark");c(a);(a=d.querySelector("a.mark"))&&a.setAttribute("data-action","mark-read")}};g.open("POST","?action=mark-item-unread&id="+ +a,!0);g.send()}return{MarkAsRead:a,MarkAsUnread:f,MarkAsRemoved:function(d){var c=e(d),a=new XMLHttpRequest;a.onload=function(){Miniflux.Nav.IsListing()&&b(d)};a.open("POST","?action=mark-item-removed&id="+c,!0);a.send()},SwitchBookmark:function(d){var a=e(d),g="1"===d.getAttribute("data-item-bookmark")?"0":"1",h=new XMLHttpRequest;h.onload=function(){if(Miniflux.Nav.IsListing()&&"bookmarks"===d.getAttribute("data-item-page"))b(d);else if(d.setAttribute("data-item-bookmark",g),Miniflux.Nav.IsListing()){var a= +d.querySelector("a.bookmark");c(a)}else if((a=d.querySelector("a.bookmark-icon"))&&a.hasAttribute("data-reverse-title")){var k=a.getAttribute("title");a.setAttribute("title",a.getAttribute("data-reverse-title"));a.setAttribute("data-reverse-title",k)}};h.open("POST","?action=bookmark&id="+a+"&value="+g,!0);h.send()},SwitchStatus:function(d){var b=d.getAttribute("data-item-status");"read"===b?f(d):"unread"===b&&a(d)},Show:function(a){(a=a.querySelector("a.show"))&&a.click()},OpenOriginal:function(b){var c= +b.querySelector("a.original");c&&("unread"===b.getAttribute("data-item-status")&&a(b),c.removeAttribute("data-action"),c.click())},DownloadContent:function(a){var b=document.getElementById("download-item");if(b){a=e(a);var c=b.getAttribute("data-before-message"),h=document.createElement("span");h.appendChild(document.createTextNode("\u2600"));h.className="loading-icon";b.innerHTML="";b.className="downloading";b.appendChild(h);b.appendChild(document.createTextNode(" "+c));var f=setInterval(Miniflux.App.BlinkIcon, +250),l=new XMLHttpRequest;l.onload=function(){var a=JSON.parse(l.responseText);clearInterval(f);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)))};l.open("POST","?action=download-item&id="+a,!0);l.send()}},MarkListingAsRead:function(b){for(var a=document.getElementsByTagName("article"), +c=[],f=0,m=a.length;fc-(a.offsetTop+a.offsetHeight)||c-a.offsetTop>document.documentElement.clientHeight)&&window.scrollTo(0,a.offsetTop-10)}function a(){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 b=document.getElementById("next-item"); -if(b)b.click();else if(a())if(b=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var c=0,f=b.length;ca-(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"); +if(b)b.click();else if(c())if(b=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var a=0,f=b.length;a
  • - - - -