Make 'Threading' checkbox persistent. #340

This commit is contained in:
ccd0 2016-04-02 22:17:42 -07:00
parent f8124c4489
commit ea2b28f9b1
3 changed files with 14 additions and 6 deletions

View File

@ -573,8 +573,8 @@ Config =
'Add \'(Cross-thread)\' to cross-threads quotes.'
]
'Quote Threading': [
false
'Thread conversations.'
true
'Add option in header menu to thread conversations.'
]
imageExpansion:
@ -1013,6 +1013,8 @@ Config =
customCooldown: 0
customCooldownEnabled: true
'Thread Quotes': false
replyPruning:
'Prune Replies': false
'Max Replies': 1000

View File

@ -354,6 +354,9 @@ Settings =
if data['Oekaki Links']? and not data['Edit Link']?
set 'Edit Link', data['Oekaki Links']
set 'Inline Cross-thread Quotes Only', true unless data['Inline Cross-thread Quotes Only']?
if compareString < '00001.00011.00030.00000'
if data['Quote Threading']
set 'Thread Quotes', true
changes
loadSettings: (data, cb) ->

View File

@ -6,9 +6,8 @@ QuoteThreading =
init: ->
return unless Conf['Quote Threading'] and g.VIEW is 'thread'
@enabled = true
@controls = $.el 'span',
<%= html('<label><input id="threadingControl" type="checkbox" checked> Threading</label>') %>
<%= html('<label><input id="threadingControl" type="checkbox"> Threading</label>') %>
@threadNewLink = $.el 'span',
className: 'brackets-wrap threadnewlink'
@ -16,6 +15,7 @@ QuoteThreading =
$.extend @threadNewLink, <%= html('<a href="javascript:;">Thread New Posts</a>') %>
@input = $('input', @controls)
@input.checked = Conf['Thread Quotes']
$.on @input, 'change', @rethread
$.on @threadNewLink.firstElementChild, 'click', @rethread
@ -68,7 +68,7 @@ QuoteThreading =
posts
insert: (post) ->
return false unless QuoteThreading.enabled and
return false unless Conf['Thread Quotes'] and
(parent = QuoteThreading.parent[post.fullID]) and
!QuoteThreading.inserted[post.fullID]
@ -114,7 +114,10 @@ QuoteThreading =
QuoteThreading.threadNewLink.hidden = true
if QuoteThreading.enabled = QuoteThreading.input.checked
Conf['Thread Quotes'] = QuoteThreading.input.checked
$.set 'Thread Quotes', Conf['Thread Quotes']
if Conf['Thread Quotes']
posts.forEach QuoteThreading.insert
else
nodes = []