Fix g-full text in custom board list. #1774

Also addresses #384, #642.
This commit is contained in:
ccd0 2018-01-24 10:52:40 -08:00
parent aab8baddd0
commit 2249da91e8
2 changed files with 6 additions and 6 deletions

View File

@ -46,3 +46,6 @@ BoardConfig =
return false unless Site.software is 'yotsuba'
boards = @boards or Conf['boardConfig'].boards
boards and !boards[boardID].webm_audio
title: (boardID) ->
(@boards or Conf['boardConfig'].boards)?[boardID]?.title or ''

View File

@ -189,13 +189,12 @@ Header =
$.rmAll list
return unless boardnav
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
nodes = (Header.mapCustomNavigation t, as for t in boardnav.match re)
nodes = (Header.mapCustomNavigation(t) for t in boardnav.match re)
$.add list, nodes
CatalogLinks.setLinks list
mapCustomNavigation: (t, as) ->
mapCustomNavigation: (t) ->
if /^[^\w@]/.test t
return $.tn t
@ -246,12 +245,10 @@ Header =
title: '4chan Twitter'
textContent: '@'
for a in as when a.textContent is boardID
return a.cloneNode true
a = $.el 'a',
href: "//boards.4chan.org/#{boardID}/"
textContent: boardID
title: BoardConfig.title(boardID)
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