From 2249da91e8f637cb33283f8dd37261b1028f7561 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Wed, 24 Jan 2018 10:52:40 -0800 Subject: [PATCH] Fix g-full text in custom board list. #1774 Also addresses #384, #642. --- src/General/BoardConfig.coffee | 3 +++ src/General/Header.coffee | 9 +++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/General/BoardConfig.coffee b/src/General/BoardConfig.coffee index da7353867..3e854ab87 100644 --- a/src/General/BoardConfig.coffee +++ b/src/General/BoardConfig.coffee @@ -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 '' diff --git a/src/General/Header.coffee b/src/General/Header.coffee index 27923d924..13c2255e0 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -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