add Posts Per Minute
This commit is contained in:
parent
7742edd22c
commit
81b5d525ff
@ -403,6 +403,7 @@ Index =
|
|||||||
'creation-date': 'birth'
|
'creation-date': 'birth'
|
||||||
'reply-count': 'replycount'
|
'reply-count': 'replycount'
|
||||||
'file-count': 'filecount'
|
'file-count': 'filecount'
|
||||||
|
'posts-per-minute': 'activity'
|
||||||
|
|
||||||
processHash: ->
|
processHash: ->
|
||||||
# XXX https://bugzilla.mozilla.org/show_bug.cgi?id=483304
|
# XXX https://bugzilla.mozilla.org/show_bug.cgi?id=483304
|
||||||
@ -816,6 +817,7 @@ Index =
|
|||||||
sort: ->
|
sort: ->
|
||||||
{liveThreadIDs, liveThreadData} = Index
|
{liveThreadIDs, liveThreadData} = Index
|
||||||
return unless liveThreadData
|
return unless liveThreadData
|
||||||
|
tmp_time = new Date().getTime()/1000;
|
||||||
sortType = Index.currentSort.replace(/-rev$/, '')
|
sortType = Index.currentSort.replace(/-rev$/, '')
|
||||||
Index.sortedThreadIDs = switch sortType
|
Index.sortedThreadIDs = switch sortType
|
||||||
when 'lastreply', 'lastlong'
|
when 'lastreply', 'lastlong'
|
||||||
@ -841,6 +843,7 @@ Index =
|
|||||||
when 'birth' then [liveThreadIDs... ].sort (a, b) -> b - a
|
when 'birth' then [liveThreadIDs... ].sort (a, b) -> b - a
|
||||||
when 'replycount' then [liveThreadData...].sort((a, b) -> b.replies - a.replies).map (post) -> post.no
|
when 'replycount' then [liveThreadData...].sort((a, b) -> b.replies - a.replies).map (post) -> post.no
|
||||||
when 'filecount' then [liveThreadData...].sort((a, b) -> b.images - a.images ).map (post) -> post.no
|
when 'filecount' then [liveThreadData...].sort((a, b) -> b.images - a.images ).map (post) -> post.no
|
||||||
|
when 'activity' then [liveThreadData...].sort((a, b) -> (tmp_time-a.time)/a.replies - (tmp_time-b.time)/b.replies ).map (post) -> post.no
|
||||||
else liveThreadIDs
|
else liveThreadIDs
|
||||||
if /-rev$/.test(Index.currentSort)
|
if /-rev$/.test(Index.currentSort)
|
||||||
Index.sortedThreadIDs = [Index.sortedThreadIDs...].reverse()
|
Index.sortedThreadIDs = [Index.sortedThreadIDs...].reverse()
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
<option value="birth">Creation date</option>
|
<option value="birth">Creation date</option>
|
||||||
<option value="replycount">Reply count</option>
|
<option value="replycount">Reply count</option>
|
||||||
<option value="filecount">File count</option>
|
<option value="filecount">File count</option>
|
||||||
|
<option value="activity">Posts Per Minute</option>
|
||||||
</select>
|
</select>
|
||||||
<select id="index-size" name="Index Size">
|
<select id="index-size" name="Index Size">
|
||||||
<option disabled>Image Size</option>
|
<option disabled>Image Size</option>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user