diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3c64ceeaa..f5e83939d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,11 +1,15 @@
-- Searching in the index is now possible and will show matched OPs by:
- - comment
- - subject
- - filename
- - name
- - tripcode
- - e-mail
-- The elapsed time since the last index refresh is now indicated at the top of the index.
+- More index navigation improvements:
+ - Searching in the index is now possible and will show matched OPs by:
+
+
comment
+
subject
+
filename
+
name
+
tripcode
+
e-mail
+
+ - The elapsed time since the last index refresh is now indicated at the top of the index.
+ - New setting: `Show replies`, enabled by default. Disable it to only show OPs in the index.
### 3.12.1 - *2013-11-04*
diff --git a/src/General/Build.coffee b/src/General/Build.coffee
index 6fe60021b..31fbea6a9 100644
--- a/src/General/Build.coffee
+++ b/src/General/Build.coffee
@@ -279,8 +279,13 @@ Build =
id: "t#{data.no}"
nodes = [if OP then OP.nodes.root else Build.postFromObject data, board.ID]
- if data.omitted_posts
- nodes.push Build.summary board.ID, data.no, data.omitted_posts, data.omitted_images
+ if data.omitted_posts or !Conf['Show Replies'] and data.replies
+ [posts, files] = if Conf['Show Replies']
+ [data.omitted_posts, data.omitted_images]
+ else
+ # XXX data.images is not accurate.
+ [data.replies, data.omitted_images + data.last_replies.filter((data) -> !!data.ext).length]
+ nodes.push Build.summary board.ID, data.no, posts, files
$.add root, nodes
root
diff --git a/src/General/Config.coffee b/src/General/Config.coffee
index e1818ec89..de55119ff 100644
--- a/src/General/Config.coffee
+++ b/src/General/Config.coffee
@@ -142,6 +142,7 @@ Config =
Index:
'Index Mode': 'paged'
'Index Sort': 'bump'
+ 'Show Replies': true
Header:
'Header auto-hide': false
'Bottom header': false
diff --git a/src/General/Index.coffee b/src/General/Index.coffee
index 437103501..251d6efe8 100644
--- a/src/General/Index.coffee
+++ b/src/General/Index.coffee
@@ -36,12 +36,19 @@ Index =
$.on input, 'change', $.cb.value
$.on input, 'change', @cb.sort
+ repliesEntry =
+ el: $.el 'label', innerHTML: ' Show replies'
+ input = repliesEntry.el.firstChild
+ input.checked = Conf['Show Replies']
+ $.on input, 'change', $.cb.checked
+ $.on input, 'change', @cb.replies
+
$.event 'AddMenuEntry',
type: 'header'
el: $.el 'span',
textContent: 'Index Navigation'
order: 90
- subEntries: [modeEntry, sortEntry]
+ subEntries: [modeEntry, sortEntry, repliesEntry]
$.addClass doc, 'index-loading'
@update()
@@ -85,6 +92,10 @@ Index =
sort: ->
Index.sort()
Index.buildIndex()
+ replies: ->
+ Index.buildThreads()
+ Index.sort()
+ Index.buildIndex()
popstate: (e) ->
pageNum = Index.getCurrentPage()
Index.pageLoad pageNum if Index.currentPage isnt pageNum
@@ -328,7 +339,7 @@ Index =
else
nodes = Index.sortedNodes
$.rmAll Index.root
- Index.buildReplies nodes
+ Index.buildReplies nodes if Conf['Show Replies']
$.event 'IndexBuild', nodes
$.add Index.root, nodes
diff --git a/src/Miscellaneous/ExpandThread.coffee b/src/Miscellaneous/ExpandThread.coffee
index 608572cf7..086f76d8d 100644
--- a/src/Miscellaneous/ExpandThread.coffee
+++ b/src/Miscellaneous/ExpandThread.coffee
@@ -50,16 +50,19 @@ ExpandThread =
a.textContent = ExpandThread.text '+', a.textContent.match(/\d+/g)... if a
return
- num = if thread.isSticky
- 1
- else switch g.BOARD.ID
- # XXX boards config
- when 'b', 'vg' then 3
- when 't' then 1
- else 5
+ replies = $$ '.thread > .replyContainer', threadRoot
+ if Conf['Show Replies']
+ num = if thread.isSticky
+ 1
+ else switch g.BOARD.ID
+ # XXX boards config
+ when 'b', 'vg' then 3
+ when 't' then 1
+ else 5
+ replies = replies[...-num]
postsCount = 0
filesCount = 0
- for reply in $$('.thread > .replyContainer', threadRoot)[...-num]
+ for reply in replies
# rm clones
inlined.click() while inlined = $ '.inlined', reply if Conf['Quote Inlining']
postsCount++