Make IP count in thread stats optional.
This commit is contained in:
parent
94a59f52d9
commit
ea163382d6
@ -291,9 +291,13 @@ Config =
|
|||||||
true
|
true
|
||||||
'Display reply and image count.'
|
'Display reply and image count.'
|
||||||
]
|
]
|
||||||
|
'IP Count in Stats': [
|
||||||
|
true
|
||||||
|
'Display the unique IP count in the thread stats.'
|
||||||
|
]
|
||||||
'Page Count in Stats': [
|
'Page Count in Stats': [
|
||||||
true
|
true
|
||||||
'Display the page count in the thread stats as well.'
|
'Display the page count in the thread stats.'
|
||||||
]
|
]
|
||||||
'Updater and Stats in Header': [
|
'Updater and Stats in Header': [
|
||||||
true,
|
true,
|
||||||
|
|||||||
@ -2,19 +2,25 @@ ThreadStats =
|
|||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW isnt 'thread' or !Conf['Thread Stats']
|
return if g.VIEW isnt 'thread' or !Conf['Thread Stats']
|
||||||
|
|
||||||
countHTML = <%= html('<span id="post-count">?</span> / <span id="file-count">?</span> / <span id="ip-count">?</span>') %>
|
statsHTML = <%= html('<span id="post-count">?</span> / <span id="file-count">?</span>') %>
|
||||||
countHTML = <%= html('&{countHTML} / <span id="page-count">?</span>') %> if Conf['Page Count in Stats']
|
statsTitle = 'Post Count / File Count'
|
||||||
|
if Conf['IP Count in Stats']
|
||||||
|
statsHTML = <%= html('&{statsHTML} / <span id="ip-count">?</span>') %>
|
||||||
|
statsTitle += ' / IP Count'
|
||||||
|
if Conf['Page Count in Stats']
|
||||||
|
statsHTML = <%= html('&{statsHTML} / <span id="page-count">?</span>') %>
|
||||||
|
statsTitle += ' / Page Count'
|
||||||
|
|
||||||
if Conf['Updater and Stats in Header']
|
if Conf['Updater and Stats in Header']
|
||||||
@dialog = sc = $.el 'span',
|
@dialog = sc = $.el 'span',
|
||||||
id: 'thread-stats'
|
id: 'thread-stats'
|
||||||
title: 'Post Count / File Count / IP Count' + (if Conf["Page Count in Stats"] then " / Page Count" else "")
|
title: statsTitle
|
||||||
$.extend sc, countHTML
|
$.extend sc, statsHTML
|
||||||
$.ready ->
|
$.ready ->
|
||||||
Header.addShortcut sc
|
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;',
|
||||||
<%= html('<div class="move" title="Post Count / File Count / IP Count${Conf["Page Count in Stats"] ? " / Page Count" : ""}">&{countHTML}</div>') %>
|
<%= html('<div class="move" title="${statsTitle}">&{statsHTML}</div>') %>
|
||||||
$.ready =>
|
$.ready =>
|
||||||
$.add d.body, sc
|
$.add d.body, sc
|
||||||
|
|
||||||
@ -57,7 +63,8 @@ ThreadStats =
|
|||||||
{thread, postCountEl, fileCountEl, ipCountEl} = ThreadStats
|
{thread, postCountEl, fileCountEl, ipCountEl} = ThreadStats
|
||||||
postCountEl.textContent = postCount
|
postCountEl.textContent = postCount
|
||||||
fileCountEl.textContent = fileCount
|
fileCountEl.textContent = fileCount
|
||||||
ipCountEl.textContent = if ipCount? then ipCount else '?'
|
if Conf["IP Count in Stats"]
|
||||||
|
ipCountEl.textContent = if ipCount? then ipCount else '?'
|
||||||
(if thread.postLimit and !thread.isSticky then $.addClass else $.rmClass) postCountEl, 'warning'
|
(if thread.postLimit and !thread.isSticky then $.addClass else $.rmClass) postCountEl, 'warning'
|
||||||
(if thread.fileLimit and !thread.isSticky then $.addClass else $.rmClass) fileCountEl, 'warning'
|
(if thread.fileLimit and !thread.isSticky then $.addClass else $.rmClass) fileCountEl, 'warning'
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user