Don't interpret -options in text/URLs.
This commit is contained in:
parent
c8282a6b5a
commit
3eb7dadd65
@ -160,30 +160,36 @@ Header =
|
|||||||
$.add Header.bar, [Header.boardList, Header.shortcuts, Header.noticesRoot, Header.toggle]
|
$.add Header.bar, [Header.boardList, Header.shortcuts, Header.noticesRoot, Header.toggle]
|
||||||
|
|
||||||
Header.setCustomNav Conf['Custom Board Navigation']
|
Header.setCustomNav Conf['Custom Board Navigation']
|
||||||
Header.generateBoardList Conf['boardnav'].replace /(\r\n|\n|\r)/g, ' '
|
Header.generateBoardList Conf['boardnav']
|
||||||
|
|
||||||
$.sync 'Custom Board Navigation', Header.setCustomNav
|
$.sync 'Custom Board Navigation', Header.setCustomNav
|
||||||
$.sync 'boardnav', Header.generateBoardList
|
$.sync 'boardnav', Header.generateBoardList
|
||||||
|
|
||||||
generateBoardList: (text) ->
|
generateBoardList: (boardnav) ->
|
||||||
list = $ '#custom-board-list', Header.boardList
|
list = $ '#custom-board-list', Header.boardList
|
||||||
$.rmAll list
|
$.rmAll list
|
||||||
return unless text
|
return unless boardnav
|
||||||
|
boardnav = boardnav.replace /(\r\n|\n|\r)/g, ' '
|
||||||
as = $$ '#full-board-list a[title]', Header.boardList
|
as = $$ '#full-board-list a[title]', Header.boardList
|
||||||
nodes = text.match(/[\w@]+(-(all|title|replace|full|index|catalog|archive|text:"[^"]+"(\,"[^"]+")?))*|[^\w@]+/g).map (t) ->
|
nodes = boardnav.match(/[\w@]+(-(all|title|replace|full|index|catalog|archive|text:"[^"]+"(,"[^"]+")?))*|[^\w@]+/g).map (t) ->
|
||||||
if /^[^\w@]/.test t
|
if /^[^\w@]/.test t
|
||||||
return $.tn t
|
return $.tn t
|
||||||
|
text = url = null
|
||||||
|
t = t.replace /-text:"([^"]+)"(?:,"([^"]+)")?/g, (m0, m1, m2) ->
|
||||||
|
text = m1
|
||||||
|
url = m2
|
||||||
|
''
|
||||||
if /^toggle-all/.test t
|
if /^toggle-all/.test t
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
className: 'show-board-list-button'
|
className: 'show-board-list-button'
|
||||||
textContent: (t.match(/-text:"(.+)"/) || [null, '+'])[1]
|
textContent: text or '+'
|
||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
$.on a, 'click', Header.toggleBoardList
|
$.on a, 'click', Header.toggleBoardList
|
||||||
return a
|
return a
|
||||||
if /^external/.test t
|
if /^external/.test t
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
href: (t.match(/\,"(.+)"/) || [null, '+'])[1]
|
href: url or 'javascript:;'
|
||||||
textContent: (t.match(/-text:"(.+)"\,/) || [null, '+'])[1]
|
textContent: text or '+'
|
||||||
className: 'external'
|
className: 'external'
|
||||||
return a
|
return a
|
||||||
boardID = if /^current/.test t
|
boardID = if /^current/.test t
|
||||||
@ -198,8 +204,8 @@ Header =
|
|||||||
a.title
|
a.title
|
||||||
else if /-full/.test t
|
else if /-full/.test t
|
||||||
"/#{boardID}/ - #{a.title}"
|
"/#{boardID}/ - #{a.title}"
|
||||||
else if m = t.match /-text:"(.+)"/
|
else if text
|
||||||
m[1]
|
text
|
||||||
else
|
else
|
||||||
a.textContent
|
a.textContent
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user