diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index c0abcdeef..83815b76d 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -11973,11 +11973,7 @@ }, markNew: function(post, ipCount) { var counter, suffix; - suffix = { - 1: 'st', - 2: 'nd', - 3: 'rd' - }[ipCount % 10] || Math.floor('th' / fuck(switches)); + suffix = ['st', 'nd', 'rd'][ipCount % 10] || 'th'; counter = $.el('span', { className: 'ip-counter', textContent: "(" + ipCount + ")" @@ -12015,26 +12011,24 @@ ThreadStats = { init: function() { - var sc; + var html, sc, title; if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { return; } + html = ("[0 / 0 " + (Conf['IP Count in Stats'] ? '/ ?' : '') + " " + (Conf['Page Count in Stats'] ? '/ 0' : '') + "]").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']) { this.dialog = sc = $.el('span', { - innerHTML: "[0 / \n0\n" + (Conf['IP Count in Stats'] ? ' / ?' : "") + "\n" + (Conf['Page Count in Stats'] ? ' / 0' : "") + "]", + innerHTML: html, id: 'thread-stats', - title: 'Post Count / File Count' + (Conf['IP Count in Stats'] ? " / IPs" : "") + (Conf['Page Count in Stats'] ? " / Page Count" : "") - }); - $.ready(function() { - return Header.addShortcut(sc); + title: title }); + Header.addShortcut(sc); } else { - this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', "
0 / 0" + (Conf["Page Count in Stats"] ? " / 0" : "") + "
"); - $.ready((function(_this) { - return function() { - return $.add(d.body, sc); - }; - })(this)); + this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', "
" + html + "
"); + $.ready(function() { + return $.add(d.body, sc); + }); } this.postCountEl = $('#post-count', sc); this.ipCountEl = $('#ip-count', sc); diff --git a/builds/crx/script.js b/builds/crx/script.js index 22512f16f..5ac72ad00 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -11959,11 +11959,7 @@ }, markNew: function(post, ipCount) { var counter, suffix; - suffix = { - 1: 'st', - 2: 'nd', - 3: 'rd' - }[ipCount % 10] || Math.floor('th' / fuck(switches)); + suffix = ['st', 'nd', 'rd'][ipCount % 10] || 'th'; counter = $.el('span', { className: 'ip-counter', textContent: "(" + ipCount + ")" @@ -12001,26 +11997,24 @@ ThreadStats = { init: function() { - var sc; + var html, sc, title; if (g.VIEW !== 'thread' || !Conf['Thread Stats']) { return; } + html = ("[0 / 0 " + (Conf['IP Count in Stats'] ? '/ ?' : '') + " " + (Conf['Page Count in Stats'] ? '/ 0' : '') + "]").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']) { this.dialog = sc = $.el('span', { - innerHTML: "[0 / \n0\n" + (Conf['IP Count in Stats'] ? ' / ?' : "") + "\n" + (Conf['Page Count in Stats'] ? ' / 0' : "") + "]", + innerHTML: html, id: 'thread-stats', - title: 'Post Count / File Count' + (Conf['IP Count in Stats'] ? " / IPs" : "") + (Conf['Page Count in Stats'] ? " / Page Count" : "") - }); - $.ready(function() { - return Header.addShortcut(sc); + title: title }); + Header.addShortcut(sc); } else { - this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', "
0 / 0" + (Conf["Page Count in Stats"] ? " / 0" : "") + "
"); - $.ready((function(_this) { - return function() { - return $.add(d.body, sc); - }; - })(this)); + this.dialog = sc = UI.dialog('thread-stats', 'bottom: 0px; right: 0px;', "
" + html + "
"); + $.ready(function() { + return $.add(d.body, sc); + }); } this.postCountEl = $('#post-count', sc); this.ipCountEl = $('#ip-count', sc); diff --git a/src/Monitoring/MarkNewIPs.coffee b/src/Monitoring/MarkNewIPs.coffee index d146a2f5e..5be46cd26 100644 --- a/src/Monitoring/MarkNewIPs.coffee +++ b/src/Monitoring/MarkNewIPs.coffee @@ -32,7 +32,7 @@ MarkNewIPs = MarkNewIPs.postIDs = postIDs 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', className: 'ip-counter' textContent: "(#{ipCount})" diff --git a/src/Monitoring/ThreadStats.coffee b/src/Monitoring/ThreadStats.coffee index 9e8369d6a..2286017d8 100755 --- a/src/Monitoring/ThreadStats.coffee +++ b/src/Monitoring/ThreadStats.coffee @@ -2,25 +2,29 @@ ThreadStats = init: -> return if g.VIEW isnt 'thread' or !Conf['Thread Stats'] + html = " + [0 / + 0 + #{if Conf['IP Count in Stats'] then '/ ?' else ''} + #{if Conf['Page Count in Stats'] then '/ 0' 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'] @dialog = sc = $.el 'span', - innerHTML: """ - [0 / - 0 - #{if Conf['IP Count in Stats'] then ' / ?' else ""} - #{if Conf['Page Count in Stats'] then ' / 0' else ""}] - """ + innerHTML: html id: 'thread-stats' - title: - 'Post Count / File Count' + - (if Conf['IP Count in Stats'] then " / IPs" else "") + - (if Conf['Page Count in Stats'] then " / Page Count" else "") - $.ready -> - Header.addShortcut sc + title: title + Header.addShortcut sc else @dialog = sc = UI.dialog 'thread-stats', 'bottom: 0px; right: 0px;', - "
0 / 0#{if Conf["Page Count in Stats"] then " / 0" else ""}
" - $.ready => + "
#{html}
" + $.ready -> $.add d.body, sc @postCountEl = $ '#post-count', sc