parent
aab8baddd0
commit
2249da91e8
@ -46,3 +46,6 @@ BoardConfig =
|
|||||||
return false unless Site.software is 'yotsuba'
|
return false unless Site.software is 'yotsuba'
|
||||||
boards = @boards or Conf['boardConfig'].boards
|
boards = @boards or Conf['boardConfig'].boards
|
||||||
boards and !boards[boardID].webm_audio
|
boards and !boards[boardID].webm_audio
|
||||||
|
|
||||||
|
title: (boardID) ->
|
||||||
|
(@boards or Conf['boardConfig'].boards)?[boardID]?.title or ''
|
||||||
|
|||||||
@ -189,13 +189,12 @@ Header =
|
|||||||
$.rmAll list
|
$.rmAll list
|
||||||
return unless boardnav
|
return unless boardnav
|
||||||
boardnav = boardnav.replace /(\r\n|\n|\r)/g, ' '
|
boardnav = boardnav.replace /(\r\n|\n|\r)/g, ' '
|
||||||
as = $$ '#full-board-list a[title]', Header.boardList
|
|
||||||
re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|(mode|sort|text):"[^"]+"(,"[^"]+")?))*|[^\w@]+/g
|
re = /[\w@]+(-(all|title|replace|full|index|catalog|archive|expired|(mode|sort|text):"[^"]+"(,"[^"]+")?))*|[^\w@]+/g
|
||||||
nodes = (Header.mapCustomNavigation t, as for t in boardnav.match re)
|
nodes = (Header.mapCustomNavigation(t) for t in boardnav.match re)
|
||||||
$.add list, nodes
|
$.add list, nodes
|
||||||
CatalogLinks.setLinks list
|
CatalogLinks.setLinks list
|
||||||
|
|
||||||
mapCustomNavigation: (t, as) ->
|
mapCustomNavigation: (t) ->
|
||||||
if /^[^\w@]/.test t
|
if /^[^\w@]/.test t
|
||||||
return $.tn t
|
return $.tn t
|
||||||
|
|
||||||
@ -246,12 +245,10 @@ Header =
|
|||||||
title: '4chan Twitter'
|
title: '4chan Twitter'
|
||||||
textContent: '@'
|
textContent: '@'
|
||||||
|
|
||||||
for a in as when a.textContent is boardID
|
|
||||||
return a.cloneNode true
|
|
||||||
|
|
||||||
a = $.el 'a',
|
a = $.el 'a',
|
||||||
href: "//boards.4chan.org/#{boardID}/"
|
href: "//boards.4chan.org/#{boardID}/"
|
||||||
textContent: boardID
|
textContent: boardID
|
||||||
|
title: BoardConfig.title(boardID)
|
||||||
a.href += g.VIEW if g.VIEW in ['catalog', 'archive']
|
a.href += g.VIEW if g.VIEW in ['catalog', 'archive']
|
||||||
a.className = 'current' if a.hostname is location.hostname and boardID is g.BOARD.ID
|
a.className = 'current' if a.hostname is location.hostname and boardID is g.BOARD.ID
|
||||||
a
|
a
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user