Set image limit to 251 for /a/ and /v/, default to 151.

This commit is contained in:
Nicolas Stepien 2012-01-15 14:51:46 +01:00
parent ca8d119e57
commit 679630e887
3 changed files with 37 additions and 26 deletions

View File

@ -2716,25 +2716,31 @@
threadStats = {
init: function() {
var dialog, html;
threadStats.posts = 1;
threadStats.images = $('.op img[md5]') ? 1 : 0;
html = "<div class=move><span id=postcount>" + threadStats.posts + "</span> / <span id=imagecount>" + threadStats.images + "</span></div>";
dialog = ui.dialog('stats', 'bottom: 0; left: 0;', html);
var dialog;
dialog = ui.dialog('stats', 'bottom: 0; left: 0;', '<div class=move><span id=postcount>0</span> / <span id=imagecount>0</span></div>');
dialog.className = 'dialog';
threadStats.postcountEl = $('#postcount', dialog);
threadStats.imagecountEl = $('#imagecount', dialog);
$.add(d.body, dialog);
threadStats.posts = threadStats.images = 0;
threadStats.imgLimit = (function() {
switch (g.BOARD) {
case 'a':
case 'v':
return 251;
default:
return 151;
}
})();
return g.callbacks.push(threadStats.node);
},
node: function(root) {
if (root.className) return;
threadStats.postcountEl.textContent = ++threadStats.posts;
if ($('img[md5]', root)) {
threadStats.imagecountEl.textContent = ++threadStats.images;
if (threadStats.images > 151) {
return threadStats.imagecountEl.className = 'error';
}
var imgcount;
if (/\binline\b/.test(root.className)) return;
$.id('postcount').textContent = ++threadStats.posts;
if (!$('img[md5]', root)) return;
imgcount = $.id('imagecount');
imgcount.textContent = ++threadStats.images;
if (threadStats.images > threadStats.imgLimit) {
return imgcount.className = 'error';
}
}
};

View File

@ -1,4 +1,6 @@
master
- mayhem
Set image limit in Thread Stats to 251 for /a/ and /v/, default to 151.
2.24.2
- mayhem

View File

@ -2115,22 +2115,25 @@ reportButton =
threadStats =
init: ->
threadStats.posts = 1
threadStats.images = if $ '.op img[md5]' then 1 else 0
html = "<div class=move><span id=postcount>#{threadStats.posts}</span> / <span id=imagecount>#{threadStats.images}</span></div>"
dialog = ui.dialog 'stats', 'bottom: 0; left: 0;', html
dialog = ui.dialog 'stats', 'bottom: 0; left: 0;', '<div class=move><span id=postcount>0</span> / <span id=imagecount>0</span></div>'
dialog.className = 'dialog'
threadStats.postcountEl = $ '#postcount', dialog
threadStats.imagecountEl = $ '#imagecount', dialog
$.add d.body, dialog
threadStats.posts = threadStats.images = 0
threadStats.imgLimit =
switch g.BOARD
when 'a', 'v'
251
else
151
g.callbacks.push threadStats.node
node: (root) ->
return if root.className
threadStats.postcountEl.textContent = ++threadStats.posts
if $ 'img[md5]', root
threadStats.imagecountEl.textContent = ++threadStats.images
if threadStats.images > 151
threadStats.imagecountEl.className = 'error'
return if /\binline\b/.test root.className
$.id('postcount').textContent = ++threadStats.posts
return unless $ 'img[md5]', root
imgcount = $.id 'imagecount'
imgcount.textContent = ++threadStats.images
if threadStats.images > threadStats.imgLimit
imgcount.className = 'error'
unread =
init: ->