Drop HTML in custom board titles.

This could be useful, but the fact that it's been broken almost
since its creation indicates nobody's actually using it.

As with the file info formatting, I'll mention it on the changelog
and add it back with better security if someone actually wants to
use it.
This commit is contained in:
ccd0 2014-05-13 15:03:10 -07:00
parent 0415828e27
commit 6ce8bef709

View File

@ -46,12 +46,10 @@ Banner =
return @blur() if !e.shiftKey and e.keyCode is 13 return @blur() if !e.shiftKey and e.keyCode is 13
focus: -> focus: ->
@textContent = @innerHTML
string = "#{g.BOARD}.#{@className}" string = "#{g.BOARD}.#{@className}"
string2 = "#{string}.orig" string2 = "#{string}.orig"
items = {title: @innerHTML} items = {title: @textContent}
items[string] = '' items[string] = ''
items[string2] = false items[string2] = false
@ -62,25 +60,24 @@ Banner =
return return
blur: -> blur: ->
@innerHTML = @textContent
@contentEditable = false @contentEditable = false
$.set "#{g.BOARD}.#{@className}", @textContent $.set "#{g.BOARD}.#{@className}", @textContent
custom: (child) -> custom: (child) ->
cachedTest = child.innerHTML cachedTest = child.textContent
string = "#{g.BOARD}.#{child.className}" string = "#{g.BOARD}.#{child.className}"
$.on child, 'click keydown focus blur', (e) -> Banner.cb[e.type].apply @, [e] $.on child, 'click keydown focus blur', (e) -> Banner.cb[e.type].apply @, [e]
$.get string, cachedTest, (item) -> $.get string, cachedTest, (item) ->
return unless title = item[string] return unless title = item[string]
return child.innerHTML = title if Conf['Persistent Custom Board Titles'] return child.textContent = title if Conf['Persistent Custom Board Titles']
string2 = "#{string}.orig" string2 = "#{string}.orig"
$.get string2, cachedTest, (itemb) -> $.get string2, cachedTest, (itemb) ->
if cachedTest is itemb[string2] if cachedTest is itemb[string2]
child.innerHTML = title child.textContent = title
else else
$.set string, cachedTest $.set string, cachedTest
$.set string2, cachedTest $.set string2, cachedTest