diff --git a/assets/js/all.min.js b/assets/js/all.min.js index c6bb782..b1b0aa9 100644 --- a/assets/js/all.min.js +++ b/assets/js/all.min.js @@ -1,19 +1,19 @@ -var k=function(){var d=[];return{h: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()}},i: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.h(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(f){var a= -document.createEvent("MouseEvents");a.initEvent("mousedown",!0,!0);f.dispatchEvent(a);a=document.createEvent("MouseEvents");a.initEvent("mouseup",!0,!0);f.dispatchEvent(a);f.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(f){if("read"!==f.getAttribute("data-item-status")){if(f.getAttribute("data-hide"))e(f); -else{f.setAttribute("data-item-status","read");var b=f.querySelector("a.mark");a(b);(f=f.querySelector("a.mark"))&&f.setAttribute("data-action","mark-unread")}l--}}function e(a){"mouse"!==m.c&&t.d();a.parentNode.removeChild(a);q--}function n(){-1u[e])u[e]=d.time,"unread"===d.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,n())};a.open("POST","?action=latest-feeds-items",!0);a.send()}}}}(),m=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:"",l: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){m.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.i();break;case "refresh-feed":c&&k.h(c);break;case "mark-read":c&&g.n(c);break;case "mark-unread":c&&g.p(c);break;case "mark-removed":c&&g.o(c);break;case "bookmark":c&&g.g(c); -break;case "download-item":c&&g.e(c);break;case "mark-feed-read":g.q(a.target.getAttribute("data-feed-id"))}}}}},k:function(){document.onkeypress=function(a){if(!d(a))if(m.c="keyboard",c.push(a.key||a.which),"g"===c[0]||103===c[0])switch(c[1]){case void 0:break;case "u":case 117:window.location.href="?action=unread";c=[];break;case "b":case 98:window.location.href="?action=bookmarks";c=[];break;case "h":case 104:window.location.href="?action=history";c=[];break;case "s":case 115:window.location.href= -"?action=feeds";c=[];break;case "p":case 112:window.location.href="?action=config";c=[];break;default:c=[]}else{c=[];var b=document.getElementById("current-item");switch(a.key||a.which){case "d":case 100:b&&g.e(b);break;case "p":case 112:case "k":case 107:t.f();break;case "n":case 110:case "j":case 106:t.d();break;case "v":case 118:b&&g.s(b);break;case "o":case 111:b&&g.v(b);break;case "m":case 109:b&&g.A(b);break;case "f":case 102:b&&g.g(b);break;case "h":case 104:t.t();break;case "l":case 108:t.r(); -break;case "r":case 114:k.i();break;case "?":case 63:t.w();break;case "z":case 122:g.B()}}};document.onkeydown=function(a){if(!d(a))switch(m.c="keyboard",a.key||a.which){case "ArrowLeft":case "Left":case 37:t.f();break;case "ArrowRight":case "Right":case 39:t.d()}}},m:function(){document.addEventListener("visibilitychange",function(){!document.hidden&&g.C()&&g.a()})}}}(),t=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;bu[d])u[d]=h.time,"unread"===h.status&&(c=!0)}document.hidden||b.nbUnread===l&&!t?document.hidden&&!a&&c&&(t=!0,document.title="\u21bb "+document.title): +(t=!1,l=b.nbUnread,n())};a.open("POST","?action=latest-feeds-items",!0);a.send()}}}}(),m=function(){function b(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 d=[];return{c:"",s: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 c=a.target.getAttribute("data-action");if(c){m.c="mouse";var b;a:{for(element=a.target;element&&element.parentNode;)if(element=element.parentNode,element.tagName&&"article"===element.tagName.toLowerCase()){b=element;break a}b=void 0}switch(c){case "refresh-all":k.l(a.target.getAttribute("data-concurrent-requests"));break;case "refresh-feed":b&&k.j(b);break;case "mark-read":b&&f.v(b);break;case "mark-unread":b&&f.A(b);break;case "mark-removed":b&& +f.w(b);break;case "bookmark":b&&f.i(b);break;case "download-item":b&&f.g(b);break;case "mark-feed-read":f.B(a.target.getAttribute("data-feed-id"))}}}}},o:function(){document.onkeypress=function(a){if(!b(a))if(m.c="keyboard",d.push(a.key||a.which),"g"===d[0]||103===d[0])switch(d[1]){case void 0:break;case "u":case 117:window.location.href="?action=unread";d=[];break;case "b":case 98:window.location.href="?action=bookmarks";d=[];break;case "h":case 104:window.location.href="?action=history";d=[];break; +case "s":case 115:window.location.href="?action=feeds";d=[];break;case "p":case 112:window.location.href="?action=config";d=[];break;default:d=[]}else{d=[];var c=document.getElementById("current-item");switch(a.key||a.which){case "d":case 100:c&&f.g(c);break;case "p":case 112:case "k":case 107:v.h();break;case "n":case 110:case "j":case 106:v.f();break;case "v":case 118:c&&f.D(c);break;case "o":case 111:c&&f.H(c);break;case "m":case 109:c&&f.J(c);break;case "f":case 102:c&&f.i(c);break;case "h":case 104:v.F(); +break;case "l":case 108:v.C();break;case "r":case 114:k.l();break;case "?":case 63:v.I();break;case "z":case 122:f.K()}}};document.onkeydown=function(a){if(!b(a))switch(m.c="keyboard",a.key||a.which){case "ArrowLeft":case "Left":case 37:v.h();break;case "ArrowRight":case "Right":case 39:v.f()}}},u:function(){document.addEventListener("visibilitychange",function(){!document.hidden&&f.L()&&f.a()})}}}(),v=function(){function b(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{C:function(){var a=document.getElementById("next-page");a&&a.click()},F:function(){var a=document.getElementById("previous-page");a&&a.click()},f:function(){var a=document.getElementById("next-item");if(a)a.click();else if(d())if(a=document.getElementsByTagName("article"),document.getElementById("current-item"))for(var c=0,h=a.length;c< +h;c++){if("current-item"===a[c].id){c+1 0 && queue.length < queue_length) { var feed = feeds.shift(); diff --git a/controllers/feed.php b/controllers/feed.php index c39e8cc..bef4a24 100644 --- a/controllers/feed.php +++ b/controllers/feed.php @@ -122,7 +122,8 @@ Router\get_action('feeds', function() { 'nb_unread_items' => $nb_unread_items, 'nb_failed_feeds' => Model\Feed\count_failed_feeds(), 'menu' => 'feeds', - 'title' => t('Subscriptions') + 'title' => t('Subscriptions'), + 'frontend_concurrent_requests' => Model\Config\get('frontend_concurrent_requests') ))); }); diff --git a/models/config.php b/models/config.php index 3754296..c4f863c 100644 --- a/models/config.php +++ b/models/config.php @@ -303,6 +303,7 @@ function validate_modification(array $values) new Validators\Integer('nocontent', t('Must be an integer')), new Validators\Integer('favicons', t('Must be an integer')), new Validators\Integer('original_marks_read', t('Must be an integer')), + new Validators\Integer('frontend_concurrent_requests', t('Must be an integer')), ); if (ENABLE_AUTO_UPDATE) { diff --git a/models/schema.php b/models/schema.php index 7375c06..1999fdc 100644 --- a/models/schema.php +++ b/models/schema.php @@ -5,7 +5,12 @@ namespace Schema; use PDO; use Model\Config; -const VERSION = 40; +const VERSION = 41; + +function version_41($pdo) +{ + $pdo->exec('INSERT INTO settings ("key", "value") VALUES ("frontend_concurrent_requests", 5)'); +} function version_40($pdo) { diff --git a/templates/config.php b/templates/config.php index 6fe4eaf..75a3653 100644 --- a/templates/config.php +++ b/templates/config.php @@ -75,6 +75,9 @@


+ + +
diff --git a/templates/feeds.php b/templates/feeds.php index 0f1d693..bb0c934 100644 --- a/templates/feeds.php +++ b/templates/feeds.php @@ -6,7 +6,7 @@
  • -
  • +
  • @@ -73,4 +73,4 @@ - + \ No newline at end of file