This commit is contained in:
Zixaphir 2014-12-12 04:24:50 -07:00
parent 5ef060529c
commit 1ffbd50fb3
4 changed files with 41 additions and 49 deletions

View File

@ -11973,11 +11973,7 @@
}, },
markNew: function(post, ipCount) { markNew: function(post, ipCount) {
var counter, suffix; var counter, suffix;
suffix = { suffix = ['st', 'nd', 'rd'][ipCount % 10] || 'th';
1: 'st',
2: 'nd',
3: 'rd'
}[ipCount % 10] || Math.floor('th' / fuck(switches));
counter = $.el('span', { counter = $.el('span', {
className: 'ip-counter', className: 'ip-counter',
textContent: "(" + ipCount + ")" textContent: "(" + ipCount + ")"
@ -12015,26 +12011,24 @@
ThreadStats = { ThreadStats = {
init: function() { init: function() {
var sc; var html, sc, title;
if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
return; return;
} }
html = ("[<span id=post-count>0</span> / <span id=file-count>0</span> " + (Conf['IP Count in Stats'] ? '/ <span id=ip-count>?</span>' : '') + " " + (Conf['Page Count in Stats'] ? '/ <span id=page-count>0</span>' : '') + "]").trim();
title = "Post Count / File Count (if Conf['IP Count in Stats'] then ' / IPs' else '') + (if Conf['Page Count in Stats'] then ' / Page Count' else '')".trim();
if (Conf['Updater and Stats in Header']) { if (Conf['Updater and Stats in Header']) {
this.dialog = sc = $.el('span', { this.dialog = sc = $.el('span', {
innerHTML: "[<span id=post-count>0</span> / \n<span id=file-count>0</span>\n" + (Conf['IP Count in Stats'] ? ' / <span id=ip-count>?</span>' : "") + "\n" + (Conf['Page Count in Stats'] ? ' / <span id=page-count>0</span>' : "") + "]", innerHTML: html,
id: 'thread-stats', id: 'thread-stats',
title: 'Post Count / File Count' + (Conf['IP Count in Stats'] ? " / IPs" : "") + (Conf['Page Count in Stats'] ? " / Page Count" : "") title: title
});
$.ready(function() {
return Header.addShortcut(sc);
}); });
Header.addShortcut(sc);
} else { } else {
this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', "<div class=move title='Post Count / File Count" + (Conf["Page Count in Stats"] ? " / Page Count" : "") + "'><span id=post-count>0</span> / <span id=file-count>0</span>" + (Conf["Page Count in Stats"] ? " / <span id=page-count>0</span>" : "") + "</div>"); this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', "<div class=move title='" + title + "'>" + html + "</div>");
$.ready((function(_this) { $.ready(function() {
return function() { return $.add(d.body, sc);
return $.add(d.body, sc); });
};
})(this));
} }
this.postCountEl = $('#post-count', sc); this.postCountEl = $('#post-count', sc);
this.ipCountEl = $('#ip-count', sc); this.ipCountEl = $('#ip-count', sc);

View File

@ -11959,11 +11959,7 @@
}, },
markNew: function(post, ipCount) { markNew: function(post, ipCount) {
var counter, suffix; var counter, suffix;
suffix = { suffix = ['st', 'nd', 'rd'][ipCount % 10] || 'th';
1: 'st',
2: 'nd',
3: 'rd'
}[ipCount % 10] || Math.floor('th' / fuck(switches));
counter = $.el('span', { counter = $.el('span', {
className: 'ip-counter', className: 'ip-counter',
textContent: "(" + ipCount + ")" textContent: "(" + ipCount + ")"
@ -12001,26 +11997,24 @@
ThreadStats = { ThreadStats = {
init: function() { init: function() {
var sc; var html, sc, title;
if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { if (g.VIEW !== 'thread' || !Conf['Thread Stats']) {
return; return;
} }
html = ("[<span id=post-count>0</span> / <span id=file-count>0</span> " + (Conf['IP Count in Stats'] ? '/ <span id=ip-count>?</span>' : '') + " " + (Conf['Page Count in Stats'] ? '/ <span id=page-count>0</span>' : '') + "]").trim();
title = "Post Count / File Count (if Conf['IP Count in Stats'] then ' / IPs' else '') + (if Conf['Page Count in Stats'] then ' / Page Count' else '')".trim();
if (Conf['Updater and Stats in Header']) { if (Conf['Updater and Stats in Header']) {
this.dialog = sc = $.el('span', { this.dialog = sc = $.el('span', {
innerHTML: "[<span id=post-count>0</span> / \n<span id=file-count>0</span>\n" + (Conf['IP Count in Stats'] ? ' / <span id=ip-count>?</span>' : "") + "\n" + (Conf['Page Count in Stats'] ? ' / <span id=page-count>0</span>' : "") + "]", innerHTML: html,
id: 'thread-stats', id: 'thread-stats',
title: 'Post Count / File Count' + (Conf['IP Count in Stats'] ? " / IPs" : "") + (Conf['Page Count in Stats'] ? " / Page Count" : "") title: title
});
$.ready(function() {
return Header.addShortcut(sc);
}); });
Header.addShortcut(sc);
} else { } else {
this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', "<div class=move title='Post Count / File Count" + (Conf["Page Count in Stats"] ? " / Page Count" : "") + "'><span id=post-count>0</span> / <span id=file-count>0</span>" + (Conf["Page Count in Stats"] ? " / <span id=page-count>0</span>" : "") + "</div>"); this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', "<div class=move title='" + title + "'>" + html + "</div>");
$.ready((function(_this) { $.ready(function() {
return function() { return $.add(d.body, sc);
return $.add(d.body, sc); });
};
})(this));
} }
this.postCountEl = $('#post-count', sc); this.postCountEl = $('#post-count', sc);
this.ipCountEl = $('#ip-count', sc); this.ipCountEl = $('#ip-count', sc);

View File

@ -32,7 +32,7 @@ MarkNewIPs =
MarkNewIPs.postIDs = postIDs MarkNewIPs.postIDs = postIDs
markNew: (post, ipCount) -> markNew: (post, ipCount) ->
suffix = {1: 'st', 2: 'nd', 3: 'rd'}[ipCount % 10] or 'th' // fuck switches suffix = ['st', 'nd', 'rd'][ipCount % 10] or 'th' # fuck switches
counter = $.el 'span', counter = $.el 'span',
className: 'ip-counter' className: 'ip-counter'
textContent: "(#{ipCount})" textContent: "(#{ipCount})"

View File

@ -2,25 +2,29 @@ ThreadStats =
init: -> init: ->
return if g.VIEW isnt 'thread' or !Conf['Thread Stats'] return if g.VIEW isnt 'thread' or !Conf['Thread Stats']
html = "
[<span id=post-count>0</span> /
<span id=file-count>0</span>
#{if Conf['IP Count in Stats'] then '/ <span id=ip-count>?</span>' else ''}
#{if Conf['Page Count in Stats'] then '/ <span id=page-count>0</span>' else ''}]
".trim()
title = "
Post Count / File Count
(if Conf['IP Count in Stats'] then ' / IPs' else '') +
(if Conf['Page Count in Stats'] then ' / Page Count' else '')
".trim()
if Conf['Updater and Stats in Header'] if Conf['Updater and Stats in Header']
@dialog = sc = $.el 'span', @dialog = sc = $.el 'span',
innerHTML: """ innerHTML: html
[<span id=post-count>0</span> /
<span id=file-count>0</span>
#{if Conf['IP Count in Stats'] then ' / <span id=ip-count>?</span>' else ""}
#{if Conf['Page Count in Stats'] then ' / <span id=page-count>0</span>' else ""}]
"""
id: 'thread-stats' id: 'thread-stats'
title: title: title
'Post Count / File Count' + Header.addShortcut sc
(if Conf['IP Count in Stats'] then " / IPs" else "") +
(if Conf['Page Count in Stats'] then " / Page Count" else "")
$.ready ->
Header.addShortcut sc
else else
@dialog = sc = UI.dialog 'thread-stats', 'bottom: 0px; right: 0px;', @dialog = sc = UI.dialog 'thread-stats', 'bottom: 0px; right: 0px;',
"<div class=move title='Post Count / File Count#{if Conf["Page Count in Stats"] then " / Page Count" else ""}'><span id=post-count>0</span> / <span id=file-count>0</span>#{if Conf["Page Count in Stats"] then " / <span id=page-count>0</span>" else ""}</div>" "<div class=move title='#{title}'>#{html}</div>"
$.ready => $.ready ->
$.add d.body, sc $.add d.body, sc
@postCountEl = $ '#post-count', sc @postCountEl = $ '#post-count', sc