Various bugfixes (merge pull-request #235)
This commit is contained in:
parent
87d6e0d00b
commit
9b2eaa2602
37
assets/js/all.min.js
vendored
37
assets/js/all.min.js
vendored
@ -1,26 +1,25 @@
|
|||||||
var Miniflux={};
|
var Miniflux={};
|
||||||
Miniflux.App=function(){return{BlinkIcon:function(){var e=document.querySelectorAll(".loading-icon");[].forEach.call(e,function(b){b.classList.toggle("loading-icon-blink")})},Run:function(){Miniflux.Event.ListenKeyboardEvents();Miniflux.Event.ListenMouseEvents()},MozillaAuth:function(e){navigator.id.watch({onlogin:function(b){var a=new XMLHttpRequest;a.open("POST","?action="+e+"&token="+b,!0);a.setRequestHeader("Connection","close");a.onload=function(){window.location.href=this.responseText};a.send("token="+
|
Miniflux.App=function(){return{BlinkIcon:function(){var d=document.querySelectorAll(".loading-icon");[].forEach.call(d,function(b){b.classList.toggle("loading-icon-blink")})},Run:function(){Miniflux.Event.ListenKeyboardEvents();Miniflux.Event.ListenMouseEvents()},MozillaAuth:function(d){navigator.id.watch({onlogin:function(b){var a=new XMLHttpRequest;a.open("POST","?action="+d+"&token="+b,!0);a.setRequestHeader("Connection","close");a.onload=function(){window.location.href=this.responseText};a.send("token="+
|
||||||
b)},onlogout:function(){}});navigator.id.request()}}}();
|
b)},onlogout:function(){}});navigator.id.request()}}}();
|
||||||
Miniflux.Feed=function(){function e(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 b(){for(var b=document.getElementsByTagName("a"),d=0,c=b.length;d<c;d++){var g=b[d].getAttribute("data-feed-id");g&&a.push(parseInt(g))}}var a=[],d=[],f;return{Update:function(a,b){e(a);var c=new XMLHttpRequest;c.onload=function(){var c=document.getElementById("loading-feed-"+
|
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 b(){for(var b=document.getElementsByTagName("a"),c=0,d=b.length;c<d;c++){var e=b[c].getAttribute("data-feed-id");e&&a.push(parseInt(e))}}var a=[],c=[],f;return{Update:function(a,b){d(a);var c=new XMLHttpRequest;c.onload=function(){var e=document.getElementById("loading-feed-"+
|
||||||
a);c&&(c.innerHTML="");if(c=document.getElementById("last-checked-feed-"+a))c.innerHTML=c.getAttribute("data-after-update");try{var k=JSON.parse(this.responseText);if(k.result){var d=k.items_count,e=document.getElementById("items-count-"+a);e&&(e.innerHTML="("+d.items_unread+"/"+d.items_total+")")}b&&b(k)}catch(f){}};c.open("POST","?action=refresh-feed&feed_id="+a,!0);c.send()},UpdateAll:function(){b();var e=setInterval(function(){for(;0<a.length&&5>d.length;){var b=a.shift();d.push(b);Miniflux.Feed.Update(b,
|
a);e&&(e.innerHTML="");if(e=document.getElementById("last-checked-feed-"+a))e.innerHTML=e.getAttribute("data-after-update");try{var h=JSON.parse(this.responseText);if(h.result){var n=h.items_count,c=document.getElementById("items-count-"+a);c&&(c.innerHTML="("+n.items_unread+"/"+n.items_total+")")}b&&b(h)}catch(d){}};c.open("POST","?action=refresh-feed&feed_id="+a,!0);c.send()},UpdateAll:function(){b();var d=setInterval(function(){for(;0<a.length&&5>c.length;){var b=a.shift();c.push(b);Miniflux.Feed.Update(b,
|
||||||
function(c){c=d.indexOf(c.feed_id);0<=c&&d.splice(c,1);0==a.length&&0==d.length&&(clearInterval(e),clearInterval(f),window.location.href="?action=unread")})}},100)}}}();
|
function(b){b=c.indexOf(b.feed_id);0<=b&&c.splice(b,1);0==a.length&&0==c.length&&(clearInterval(d),clearInterval(f),window.location.href="?action=unread")})}},100)}}}();
|
||||||
Miniflux.Item=function(){function e(c){var a=document.getElementById("item-"+c);a||(a=document.getElementById("current-item"),a.getAttribute("data-item-id")!=c&&(a=!1));return a}function b(c){if((c=document.getElementById("bookmark-"+c))&&c.getAttribute("data-reverse-label")){var a=c.innerHTML;c.innerHTML=c.getAttribute("data-reverse-label");c.setAttribute("data-reverse-label",a)}}function a(c){if(c=document.getElementById("status-"+c)){var a=c.innerHTML;c.innerHTML=c.getAttribute("data-reverse-label");
|
Miniflux.Item=function(){function d(e){var a=document.getElementById("item-"+e);a||(a=document.getElementById("current-item"),a.getAttribute("data-item-id")!=e&&(a=!1));return a}function b(e){if(e&&e.getAttribute("data-reverse-label")){var a=e.innerHTML;e.innerHTML=e.getAttribute("data-reverse-label");e.setAttribute("data-reverse-label",a)}}function a(e){e=document.getElementById("bookmark-"+e);b(e)}function c(e){e=document.getElementById("status-"+e);b(e)}function f(e){"mouse"!=Miniflux.Event.lastEventType&&
|
||||||
c.setAttribute("data-reverse-label",a)}}function d(c){"mouse"!=Miniflux.Event.lastEventType&&Miniflux.Nav.SelectNextItem();c.parentNode.removeChild(c);var a=document.getElementById("page-counter");if(a){c=c.getAttribute("data-item-page");var b=parseInt(a.textContent,10)-1;if(0===b)switch(c){case "unread":window.location="?action=unread";break;case "history":window.location="?action=history"}a.textContent=b;"unread"===c?(document.title="Miniflux ("+b+")",document.getElementById("nav-counter").textContent=
|
Miniflux.Nav.SelectNextItem();e.parentNode.removeChild(e);var a=document.getElementById("page-counter");if(a){e=e.getAttribute("data-item-page");var b=parseInt(a.textContent,10)-1,c=document.getElementsByTagName("article");if(0===b||0===c.length)window.location=location.href;a.textContent=b;switch(e){case "unread":document.title="Miniflux ("+b+")";document.getElementById("nav-counter").textContent="("+b+")";break;case "feed-items":document.title="("+b+") "+a.parentNode.firstChild.nodeValue;break;
|
||||||
"("+b+")"):document.title=a.parentNode.innerText}}function f(c){var b=new XMLHttpRequest;b.onload=function(){if(Miniflux.Nav.IsListing()){var b=e(c);if(b)if(b.getAttribute("data-hide"))d(b);else{b.setAttribute("data-item-status","read");a(c);if(b=document.getElementById("show-"+c)){b.className="read";var g=document.createElement("span");g.id="read-icon-"+c;g.appendChild(document.createTextNode("\u2714 "));b.parentNode.insertBefore(g,b)}(b=document.getElementById("status-"+c))&&b.setAttribute("data-action",
|
default:document.title=a.parentNode.textContent}}}function g(e){var a=new XMLHttpRequest;a.onload=function(){if(Miniflux.Nav.IsListing()){var a=d(e);if(a)if(a.getAttribute("data-hide"))f(a);else{a.setAttribute("data-item-status","read");c(e);if(a=document.getElementById("show-"+e)){a.className="read";var b=document.createElement("span");b.id="read-icon-"+e;b.appendChild(document.createTextNode("\u2714 "));a.parentNode.insertBefore(b,a)}(a=document.getElementById("status-"+e))&&a.setAttribute("data-action",
|
||||||
"mark-unread")}}};b.open("POST","?action=mark-item-read&id="+c,!0);b.send()}function h(c){var b=new XMLHttpRequest;b.onload=function(){if(Miniflux.Nav.IsListing()){var b=e(c);if(b)if(b.getAttribute("data-hide"))d(b);else{b.setAttribute("data-item-status","unread");a(c);if(b=document.getElementById("show-"+c))b.className="";(b=document.getElementById("read-icon-"+c))&&b.parentNode.removeChild(b);(b=document.getElementById("status-"+c))&&b.setAttribute("data-action","mark-read")}}};b.open("POST","?action=mark-item-unread&id="+
|
"mark-unread")}}};a.open("POST","?action=mark-item-read&id="+e,!0);a.send()}function l(a){var b=new XMLHttpRequest;b.onload=function(){if(Miniflux.Nav.IsListing()){var b=d(a);if(b)if(b.getAttribute("data-hide"))f(b);else{b.setAttribute("data-item-status","unread");c(a);if(b=document.getElementById("show-"+a))b.className="";(b=document.getElementById("read-icon-"+a))&&b.parentNode.removeChild(b);(b=document.getElementById("status-"+a))&&b.setAttribute("data-action","mark-read")}}};b.open("POST","?action=mark-item-unread&id="+
|
||||||
c,!0);b.send()}function m(c,a){var d=c.getAttribute("data-item-id"),e=new XMLHttpRequest;e.onload=function(){try{if(JSON.parse(this.responseText).result)if(c.setAttribute("data-item-bookmark",a),a)if(Miniflux.Nav.IsListing()){if(f=document.getElementById("show-"+d)){var e=document.createElement("span");e.id="bookmark-icon-"+d;e.appendChild(document.createTextNode("\u2605 "));f.parentNode.insertBefore(e,f)}b(d)}else{var f=document.getElementById("bookmark-"+d);f&&(f.innerHTML="\u2605")}else if(Miniflux.Nav.IsListing()){var l=
|
a,!0);b.send()}function m(e,b){var c=e.getAttribute("data-item-id"),d=new XMLHttpRequest;d.onload=function(){try{if(JSON.parse(this.responseText).result)if(e.setAttribute("data-item-bookmark",b),b)if(Miniflux.Nav.IsListing()){if(f=document.getElementById("show-"+c)){var d=document.createElement("span");d.id="bookmark-icon-"+c;d.appendChild(document.createTextNode("\u2605 "));f.parentNode.insertBefore(d,f)}a(c)}else{var f=document.getElementById("bookmark-"+c);f&&(f.innerHTML="\u2605")}else if(Miniflux.Nav.IsListing()){var k=
|
||||||
document.getElementById("bookmark-icon-"+d);l&&l.parentNode.removeChild(l);b(d)}else{var n=document.getElementById("bookmark-"+d);n&&(n.innerHTML="\u2606")}}catch(h){}};e.open("POST","?action=bookmark&id="+d+"&value="+a,!0);e.send()}return{Get:e,MarkAsRead:f,MarkAsUnread:h,MarkAsRemoved:function(c){var a=new XMLHttpRequest;a.onload=function(){Miniflux.Nav.IsListing()&&d(e(c))};a.open("POST","?action=mark-item-removed&id="+c,!0);a.send()},SwitchBookmark:function(c){"1"==c.getAttribute("data-item-bookmark")?
|
document.getElementById("bookmark-icon-"+c);k&&k.parentNode.removeChild(k);a(c)}else{var p=document.getElementById("bookmark-"+c);p&&(p.innerHTML="\u2606")}}catch(g){}};d.open("POST","?action=bookmark&id="+c+"&value="+b,!0);d.send()}return{Get:d,MarkAsRead:g,MarkAsUnread:l,MarkAsRemoved:function(a){var b=new XMLHttpRequest;b.onload=function(){Miniflux.Nav.IsListing()&&f(d(a))};b.open("POST","?action=mark-item-removed&id="+a,!0);b.send()},SwitchBookmark:function(a){"1"==a.getAttribute("data-item-bookmark")?
|
||||||
m(c,0):m(c,1)},SwitchStatus:function(c){var a=c.getAttribute("data-item-id");c=c.getAttribute("data-item-status");"read"==c?h(a):"unread"==c&&f(a)},ChangeStatus:function(c,a){switch(a){case "read":f(c);break;case "unread":h(c)}},Show:function(c){(c=document.getElementById("show-"+c))&&c.click()},OpenOriginal:function(c){var a=document.getElementById("original-"+c);a&&("unread"==e(c).getAttribute("data-item-status")&&f(c),a.removeAttribute("data-action"),a.click())},DownloadContent:function(){var c=
|
m(a,0):m(a,1)},SwitchStatus:function(a){var b=a.getAttribute("data-item-id");a=a.getAttribute("data-item-status");"read"==a?l(b):"unread"==a&&g(b)},Show:function(a){(a=document.getElementById("show-"+a))&&a.click()},OpenOriginal:function(a){var b=document.getElementById("original-"+a);b&&("unread"==d(a).getAttribute("data-item-status")&&g(a),b.removeAttribute("data-action"),b.click())},DownloadContent:function(){var a=document.getElementById("download-item");if(a){var b=a.getAttribute("data-item-id"),
|
||||||
document.getElementById("download-item");if(c){var a=c.getAttribute("data-item-id"),b=c.getAttribute("data-before-message"),d=document.createElement("span");d.appendChild(document.createTextNode("\u2600"));d.className="loading-icon";c.innerHTML="";c.className="downloading";c.appendChild(d);c.appendChild(document.createTextNode(" "+b));var e=setInterval(Miniflux.App.BlinkIcon,250),f=new XMLHttpRequest;f.onload=function(){var a=JSON.parse(f.responseText);clearInterval(e);if(a.result){var b=document.getElementById("item-content");
|
c=a.getAttribute("data-before-message"),d=document.createElement("span");d.appendChild(document.createTextNode("\u2600"));d.className="loading-icon";a.innerHTML="";a.className="downloading";a.appendChild(d);a.appendChild(document.createTextNode(" "+c));var f=setInterval(Miniflux.App.BlinkIcon,250),g=new XMLHttpRequest;g.onload=function(){var b=JSON.parse(g.responseText);clearInterval(f);if(b.result){var c=document.getElementById("item-content");c&&(c.innerHTML=b.content);a&&(b=a.getAttribute("data-after-message"),
|
||||||
b&&(b.innerHTML=a.content);c&&(a=c.getAttribute("data-after-message"),c.innerHTML="",c.appendChild(document.createTextNode(" "+a)))}else c&&(a=c.getAttribute("data-failure-message"),c.innerHTML="",c.appendChild(document.createTextNode(" "+a)))};f.open("POST","?action=download-item&id="+a,!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"));b=new XMLHttpRequest;b.onload=function(){window.location.href=
|
a.innerHTML="",a.appendChild(document.createTextNode(" "+b)))}else a&&(b=a.getAttribute("data-failure-message"),a.innerHTML="",a.appendChild(document.createTextNode(" "+b)))};g.open("POST","?action=download-item&id="+b,!0);g.send()}},MarkListingAsRead:function(a){for(var b=document.getElementsByTagName("article"),c=[],d=0,f=b.length;d<f;d++)c.push(b[d].getAttribute("data-item-id"));b=new XMLHttpRequest;b.onload=function(){window.location.href=a};b.open("POST","?action=mark-items-as-read",!0);b.send(JSON.stringify(c))}}}();
|
||||||
a};b.open("POST","?action=mark-items-as-read",!0);b.send(JSON.stringify(d))}}}();
|
Miniflux.Event=function(){var d=[];return{lastEventType:"",ListenMouseEvents:function(){document.onclick=function(b){var a=b.target.getAttribute("data-action");if(a)switch(Miniflux.Event.lastEventType="mouse",a){case "refresh-all":b.preventDefault();Miniflux.Feed.UpdateAll();break;case "refresh-feed":b.preventDefault();Miniflux.Feed.Update(b.target.getAttribute("data-feed-id"));break;case "mark-read":b.preventDefault();Miniflux.Item.MarkAsRead(b.target.getAttribute("data-item-id"));break;case "mark-unread":b.preventDefault();
|
||||||
Miniflux.Event=function(){var e=[];return{lastEventType:"",ListenMouseEvents:function(){document.onclick=function(b){var a=b.target.getAttribute("data-action");if(a)switch(Miniflux.Event.lastEventType="mouse",a){case "refresh-all":b.preventDefault();Miniflux.Feed.UpdateAll();break;case "refresh-feed":b.preventDefault();Miniflux.Feed.Update(b.target.getAttribute("data-feed-id"));break;case "mark-read":b.preventDefault();Miniflux.Item.MarkAsRead(b.target.getAttribute("data-item-id"));break;case "mark-unread":b.preventDefault();
|
|
||||||
Miniflux.Item.MarkAsUnread(b.target.getAttribute("data-item-id"));break;case "mark-removed":b.preventDefault();Miniflux.Item.MarkAsRemoved(b.target.getAttribute("data-item-id"));break;case "bookmark":b.preventDefault();Miniflux.Item.SwitchBookmark(Miniflux.Item.Get(b.target.getAttribute("data-item-id")));break;case "download-item":b.preventDefault();Miniflux.Item.DownloadContent();break;case "original-link":b.preventDefault();Miniflux.Item.OpenOriginal(b.target.getAttribute("data-item-id"));break;
|
Miniflux.Item.MarkAsUnread(b.target.getAttribute("data-item-id"));break;case "mark-removed":b.preventDefault();Miniflux.Item.MarkAsRemoved(b.target.getAttribute("data-item-id"));break;case "bookmark":b.preventDefault();Miniflux.Item.SwitchBookmark(Miniflux.Item.Get(b.target.getAttribute("data-item-id")));break;case "download-item":b.preventDefault();Miniflux.Item.DownloadContent();break;case "original-link":b.preventDefault();Miniflux.Item.OpenOriginal(b.target.getAttribute("data-item-id"));break;
|
||||||
case "mark-all-read":b.preventDefault();Miniflux.Item.MarkListingAsRead("?action=unread");break;case "mark-feed-read":b.preventDefault();Miniflux.Item.MarkListingAsRead("?action=feed-items&feed_id="+b.target.getAttribute("data-feed-id"));break;case "mozilla-login":b.preventDefault();Miniflux.App.MozillaAuth("mozilla-auth");break;case "mozilla-link":b.preventDefault(),Miniflux.App.MozillaAuth("mozilla-link")}}},ListenKeyboardEvents:function(){document.onkeypress=function(b){Miniflux.Event.lastEventType=
|
case "mark-all-read":b.preventDefault();Miniflux.Item.MarkListingAsRead("?action=unread");break;case "mark-feed-read":b.preventDefault();Miniflux.Item.MarkListingAsRead("?action=feed-items&feed_id="+b.target.getAttribute("data-feed-id"));break;case "mozilla-login":b.preventDefault();Miniflux.App.MozillaAuth("mozilla-auth");break;case "mozilla-link":b.preventDefault(),Miniflux.App.MozillaAuth("mozilla-link")}}},ListenKeyboardEvents:function(){document.onkeypress=function(b){Miniflux.Event.lastEventType=
|
||||||
"keyboard";e.push(b.keyCode||b.which);if(103==e[0])switch(e[1]){case void 0:break;case 117:window.location.href="?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=[],b.keyCode||b.which){case 100:Miniflux.Item.DownloadContent(Miniflux.Nav.GetCurrentItemId());break;
|
"keyboard";d.push(b.keyCode||b.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=[],b.keyCode||b.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();
|
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 63:Miniflux.Nav.ShowHelp()}}}}}();
|
||||||
Miniflux.Nav=function(){function e(a){var b=pageYOffset+document.documentElement.clientHeight;(0>b-(a.offsetTop+a.offsetHeight)||b-a.offsetTop>document.documentElement.clientHeight)&&window.scrollTo(0,a.offsetTop-10)}function b(){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 b=pageYOffset+document.documentElement.clientHeight;(0>b-(a.offsetTop+a.offsetHeight)||b-a.offsetTop>document.documentElement.clientHeight)&&window.scrollTo(0,a.offsetTop-10)}function b(){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 a=document.getElementById("next-item");if(a)a.click();else if(b())if(a=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var d=0,f=a.length;d<f;d++){if("current-item"==a[d].id){a[d].id="item-"+a[d].getAttribute("data-item-id");d+1<f&&(a[d+1].id="current-item",e(a[d+1]));break}}else a[0].id="current-item",e(a[0])},SelectPreviousItem:function(){var a=
|
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(b())if(a=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var c=0,f=a.length;c<f;c++){if("current-item"==a[c].id){a[c].id="item-"+a[c].getAttribute("data-item-id");c+1<f&&(a[c+1].id="current-item",d(a[c+1]));break}}else a[0].id="current-item",d(a[0])},SelectPreviousItem:function(){var a=
|
||||||
document.getElementById("previous-item");if(a)a.click();else if(b())if(a=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var d=a.length-1;0<=d;d--){if("current-item"==a[d].id){a[d].id="item-"+a[d].getAttribute("data-item-id");0<=d-1&&(a[d-1].id="current-item",e(a[d-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:b}}();
|
document.getElementById("previous-item");if(a)a.click();else if(b())if(a=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var c=a.length-1;0<=c;c--){if("current-item"==a[c].id){a[c].id="item-"+a[c].getAttribute("data-item-id");0<=c-1&&(a[c-1].id="current-item",d(a[c-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:b}}();
|
||||||
Miniflux.App.Run();
|
Miniflux.App.Run();
|
||||||
|
@ -12,10 +12,8 @@ Miniflux.Item = (function() {
|
|||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeBookmarkLabel(item_id)
|
function changeLabel(link)
|
||||||
{
|
{
|
||||||
var link = document.getElementById("bookmark-" + item_id);
|
|
||||||
|
|
||||||
if (link && link.getAttribute("data-reverse-label")) {
|
if (link && link.getAttribute("data-reverse-label")) {
|
||||||
var content = link.innerHTML;
|
var content = link.innerHTML;
|
||||||
link.innerHTML = link.getAttribute("data-reverse-label");
|
link.innerHTML = link.getAttribute("data-reverse-label");
|
||||||
@ -23,7 +21,13 @@ Miniflux.Item = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showItemBookmarked(item_id, item)
|
function changeBookmarkLabel(item_id)
|
||||||
|
{
|
||||||
|
var link = document.getElementById("bookmark-" + item_id);
|
||||||
|
changeLabel(link);
|
||||||
|
}
|
||||||
|
|
||||||
|
function showItemBookmarked(item_id)
|
||||||
{
|
{
|
||||||
if (! Miniflux.Nav.IsListing()) {
|
if (! Miniflux.Nav.IsListing()) {
|
||||||
|
|
||||||
@ -45,7 +49,7 @@ Miniflux.Item = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideItemBookmarked(item_id, item)
|
function showItemNotBookmarked(item_id)
|
||||||
{
|
{
|
||||||
if (! Miniflux.Nav.IsListing()) {
|
if (! Miniflux.Nav.IsListing()) {
|
||||||
|
|
||||||
@ -64,12 +68,7 @@ Miniflux.Item = (function() {
|
|||||||
function changeStatusLabel(item_id)
|
function changeStatusLabel(item_id)
|
||||||
{
|
{
|
||||||
var link = document.getElementById("status-" + item_id);
|
var link = document.getElementById("status-" + item_id);
|
||||||
|
changeLabel(link);
|
||||||
if (link) {
|
|
||||||
var content = link.innerHTML;
|
|
||||||
link.innerHTML = link.getAttribute("data-reverse-label");
|
|
||||||
link.setAttribute("data-reverse-label", content);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showItemAsRead(item_id)
|
function showItemAsRead(item_id)
|
||||||
@ -141,27 +140,26 @@ Miniflux.Item = (function() {
|
|||||||
var pageCounter = document.getElementById("page-counter");
|
var pageCounter = document.getElementById("page-counter");
|
||||||
|
|
||||||
if (pageCounter) {
|
if (pageCounter) {
|
||||||
var page = item.getAttribute("data-item-page");
|
var source = item.getAttribute("data-item-page");
|
||||||
var counter = parseInt(pageCounter.textContent, 10) - 1;
|
var counter = parseInt(pageCounter.textContent, 10) - 1;
|
||||||
|
var articles = document.getElementsByTagName("article");
|
||||||
if (counter === 0) {
|
|
||||||
switch (page) {
|
if (counter === 0 || articles.length === 0) {
|
||||||
case "unread":
|
window.location = location.href;
|
||||||
window.location = "?action=unread";
|
|
||||||
break;
|
|
||||||
case "history":
|
|
||||||
window.location = "?action=history";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pageCounter.textContent = counter;
|
pageCounter.textContent = counter;
|
||||||
|
|
||||||
if (page === "unread") {
|
switch (source) {
|
||||||
document.title = "Miniflux (" + counter + ")";
|
case "unread":
|
||||||
document.getElementById("nav-counter").textContent = "(" + counter + ")";
|
document.title = "Miniflux (" + counter + ")";
|
||||||
} else {
|
document.getElementById("nav-counter").textContent = "(" + counter + ")";
|
||||||
document.title = pageCounter.parentNode.innerText;
|
break;
|
||||||
|
case "feed-items":
|
||||||
|
document.title = "(" + counter + ") " + pageCounter.parentNode.firstChild.nodeValue;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
document.title = pageCounter.parentNode.textContent;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -212,10 +210,10 @@ Miniflux.Item = (function() {
|
|||||||
item.setAttribute("data-item-bookmark", value);
|
item.setAttribute("data-item-bookmark", value);
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
showItemBookmarked(item_id, item);
|
showItemBookmarked(item_id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
hideItemBookmarked(item_id, item);
|
showItemNotBookmarked(item_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -254,17 +252,6 @@ Miniflux.Item = (function() {
|
|||||||
markAsRead(item_id);
|
markAsRead(item_id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ChangeStatus: function(item_id, status) {
|
|
||||||
|
|
||||||
switch (status) {
|
|
||||||
case "read":
|
|
||||||
markAsRead(item_id);
|
|
||||||
break;
|
|
||||||
case "unread":
|
|
||||||
markAsUnread(item_id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Show: function(item_id) {
|
Show: function(item_id) {
|
||||||
var link = document.getElementById("show-" + item_id);
|
var link = document.getElementById("show-" + item_id);
|
||||||
if (link) link.click();
|
if (link) link.click();
|
||||||
|
Loading…
Reference in New Issue
Block a user