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

View File

@ -354,6 +354,9 @@ Settings =
if data['Oekaki Links']? and not data['Edit Link']? if data['Oekaki Links']? and not data['Edit Link']?
set 'Edit Link', data['Oekaki Links'] set 'Edit Link', data['Oekaki Links']
set 'Inline Cross-thread Quotes Only', true unless data['Inline Cross-thread Quotes Only']? 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 changes
loadSettings: (data, cb) -> loadSettings: (data, cb) ->

View File

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