var k=function(){var d=[];return{i:function(c,a){var b=c.querySelector("span.items-count");if(b){var e=c.getAttribute("data-feed-id"),d=c.querySelector("h2:first-of-type");d.className="loading-icon";var p=new XMLHttpRequest;p.onload=function(){d.className="";c.removeAttribute("data-feed-error");var e=c.querySelector(".feed-last-checked");e&&(e.innerHTML=e.getAttribute("data-after-update"));e=JSON.parse(this.responseText);e.result?b.innerHTML=e.items_count.items_unread+"/"+e.items_count.items_total: c.setAttribute("data-feed-error","1");a?a(e):g.a()};p.open("POST","?action=refresh-feed&feed_id="+e,!0);p.send()}},j:function(){var c=Array.prototype.slice.call(document.querySelectorAll("article:not([data-feed-disabled])")),a=setInterval(function(){for(;0d.length;){var b=c.shift();d.push(parseInt(b.getAttribute("data-feed-id"),10));k.i(b,function(b){b=d.indexOf(b.feed_id);0<=b&&d.splice(b,1);0===c.length&&0===d.length&&(clearInterval(a),g.a())})}},100)}}}(),g=function(){function d(a){var b= document.createEvent("MouseEvents");b.initEvent("mousedown",!0,!0);a.dispatchEvent(b);b=document.createEvent("MouseEvents");b.initEvent("mouseup",!0,!0);a.dispatchEvent(b);a.click()}function c(a){return item_id=a.getAttribute("data-item-id")}function a(a){if(a&&a.hasAttribute("data-reverse-label")){var b=a.innerHTML;a.innerHTML=a.getAttribute("data-reverse-label");a.setAttribute("data-reverse-label",b)}}function b(a){"mouse"!==n.c&&u.d();a.parentNode.removeChild(a);q--}function e(){-1t[d])t[d]=f.time,"unread"===f.status&&(b=!0)}document.hidden||c.nbUnread===l&&!r?document.hidden&&!a&&b&&(r=!0,document.title="\u21bb "+document.title):(r=!1,l=c.nbUnread,e())};a.open("POST","?action=latest-feeds-items", !0);a.send()}}}}(),n=function(){function d(a){if(63!==a.keyCode&&63!==a.which&&(a.ctrlKey||a.shiftKey||a.altKey||a.metaKey))return!0;a=a.target||a.srcElement;return"INPUT"===a.tagName||"TEXTAREA"===a.tagName?!0:!1}var c=[];return{c:"",m:function(){document.onclick=function(a){a.target.hasAttribute("data-action")&&"original"!==a.target.className&&a.preventDefault()};document.onmouseup=function(a){if(2!==a.button)if("INPUT"===a.target.nodeName&&"auto-select"===a.target.className)a.target.select();else{var b= a.target.getAttribute("data-action");if(b){n.c="mouse";var c;a:{for(element=a.target;element&&element.parentNode;)if(element=element.parentNode,element.tagName&&"article"===element.tagName.toLowerCase()){c=element;break a}c=void 0}switch(b){case "refresh-all":k.j();break;case "refresh-feed":c&&k.i(c);break;case "mark-read":c&&g.o(c);break;case "mark-unread":c&&g.q(c);break;case "mark-removed":c&&g.p(c);break;case "bookmark":c&&g.h(c);break;case "download-item":c&&g.e(c);break;case "mark-all-read":g.f("?action=unread"); break;case "mark-feed-read":g.f("?action=feed-items&feed_id="+a.target.getAttribute("data-feed-id"))}}}}},l:function(){document.onkeypress=function(a){if(!d(a))if(n.c="keyboard",c.push(a.keyCode||a.which),103===c[0])switch(c[1]){case void 0:break;case 117:window.location.href="?action=unread";c=[];break;case 98:window.location.href="?action=bookmarks";c=[];break;case 104:window.location.href="?action=history";c=[];break;case 115:window.location.href="?action=feeds";c=[];break;case 112:window.location.href= "?action=config";c=[];break;default:c=[]}else{c=[];var b=document.getElementById("current-item");switch(a.keyCode||a.which){case 100:b&&g.e(b);break;case 112:case 107:u.g();break;case 110:case 106:u.d();break;case 118:b&&g.s(b);break;case 111:b&&g.v(b);break;case 109:b&&g.A(b);break;case 102:b&&g.h(b);break;case 104:u.t();break;case 108:u.r();break;case 114:k.j();break;case 63:u.w();break;case 122:g.B()}}};document.onkeydown=function(a){if(!d(a))switch(n.c="keyboard",a.keyCode||a.which){case 37:u.g(); break;case 39:u.d()}}},n:function(){document.addEventListener("visibilitychange",function(){!document.hidden&&g.C()&&g.a()})}}}(),u=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 c(){return document.getElementById("listing")?!0:!1}return{r:function(){var a=document.getElementById("next-page");a&&a.click()},t:function(){var a=document.getElementById("previous-page"); a&&a.click()},d: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 b=0,e=a.length;b