Add sort by last long reply.
This commit is contained in:
parent
f186044a4f
commit
9a3a7fc22b
@ -602,6 +602,14 @@ Index =
|
|||||||
b = num[num.length - 1] if (num = b.last_replies)
|
b = num[num.length - 1] if (num = b.last_replies)
|
||||||
b.no - a.no
|
b.no - a.no
|
||||||
).map (post) -> post.no
|
).map (post) -> post.no
|
||||||
|
when 'lastlong'
|
||||||
|
lastlong = (thread) ->
|
||||||
|
for r, i in (thread.last_replies or []) by -1
|
||||||
|
return r if r.com and Build.parseComment(r.com).replace(/[^a-z]/ig, '').length >= 100
|
||||||
|
thread
|
||||||
|
[liveThreadData...].sort((a, b) ->
|
||||||
|
lastlong(b).no - lastlong(a).no
|
||||||
|
).map (post) -> post.no
|
||||||
when 'bump' then liveThreadIDs
|
when 'bump' then liveThreadIDs
|
||||||
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
|
||||||
|
|||||||
@ -17,6 +17,7 @@
|
|||||||
<option disabled>Index Sort</option>
|
<option disabled>Index Sort</option>
|
||||||
<option value="bump">Bump order</option>
|
<option value="bump">Bump order</option>
|
||||||
<option value="lastreply">Last reply</option>
|
<option value="lastreply">Last reply</option>
|
||||||
|
<option value="lastlong">Last long reply</option>
|
||||||
<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>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user