Separate 'Remember Your Posts' from 'Mark Quotes of You'. #674

This commit is contained in:
ccd0 2015-12-15 23:20:28 -08:00
parent 45dac609db
commit 14298e1e30
6 changed files with 17 additions and 9 deletions

View File

@ -544,9 +544,14 @@ Config =
true
'Link dead quotes to the archives.'
]
'Remember Your Posts': [
true
'Remember your posting history.'
]
'Mark Quotes of You': [
true
'Add \'(You)\' to quotes linking to your posts.'
1
]
'Highlight Posts Quoting You': [
true
@ -555,7 +560,7 @@ Config =
]
'Highlight Own Posts': [
true
'Highlights own posts if Mark Quotes of You is enabled.'
'Highlights own posts.'
1
]
'Mark OP Quotes': [

View File

@ -339,6 +339,9 @@ Settings =
if compareString < '00001.00011.00020.00004' or compareString is '00001.00011.00021.00000'
if data['sauces']?
changes['sauces'] = (changes['sauces'] ? data['sauces']).replace /^#?\s*https:\/\/www\.google\.com\/searchbyimage\?image_url=%(?:IMG|URL)(?=$|;)/mg, '$&%3Fs.jpg'
if compareString < '00001.00011.00021.00003'
unless data['Remember Your Posts']?
changes['Remember Your Posts'] = data['Mark Quotes of You'] ? true
changes
loadSettings: (data, cb) ->

View File

@ -1,6 +1,6 @@
PostSuccessful =
init: ->
return unless Conf['Mark Quotes of You']
return unless Conf['Remember Your Posts']
$.ready @ready
ready: ->

View File

@ -24,8 +24,8 @@ QR =
init: ->
return unless Conf['Quick Reply']
if Conf['Mark Quotes of You']
$.sync 'Mark Quotes of You', (enabled) -> Conf['Mark Quotes of You'] = enabled
if Conf['Remember Your Posts']
$.sync 'Remember Your Posts', (enabled) -> Conf['Remember Your Posts'] = enabled
@db = new DataBoard 'yourPosts'
@posts = []
@ -769,8 +769,8 @@ QR =
threadID = +threadID or postID
isReply = threadID isnt postID
$.forceSync 'Mark Quotes of You'
if Conf['Mark Quotes of You']
$.forceSync 'Remember Your Posts'
if Conf['Remember Your Posts']
QR.db?.set
boardID: g.BOARD.ID
threadID: threadID

View File

@ -22,7 +22,7 @@ QuoteBacklink =
cb: @secondNode
firstNode: ->
return if @isClone or !@quotes.length or @isRebuilt
markYours = QR.db?.get {boardID: @board.ID, threadID: @thread.ID, postID: @ID}
markYours = Conf['Mark Quotes of You'] and QR.db?.get {boardID: @board.ID, threadID: @thread.ID, postID: @ID}
a = $.el 'a',
href: Build.postURL @board.ID, @thread.ID, @ID
className: if @isHidden then 'filtered backlink' else 'backlink'

View File

@ -1,6 +1,6 @@
QuoteYou =
init: ->
return unless g.VIEW in ['index', 'thread'] and Conf['Mark Quotes of You'] and Conf['Quick Reply']
return unless g.VIEW in ['index', 'thread'] and Conf['Remember Your Posts'] and Conf['Quick Reply']
if Conf['Highlight Own Posts']
$.addClass doc, 'highlight-own'
@ -27,7 +27,7 @@ QuoteYou =
return unless @quotes.length
for quotelink in @nodes.quotelinks when QR.db.get Get.postDataFromLink quotelink
$.add quotelink, $.tn QuoteYou.text
$.add quotelink, $.tn QuoteYou.text if Conf['Mark Quotes of You']
$.addClass quotelink, 'you'
$.addClass @nodes.root, 'quotesYou'
return