Fix custom navigation for unlisted board links (e.g. /qa/) and the 4chan Twitter link. #309
This commit is contained in:
parent
8c17090b3d
commit
aa1d2cda7f
@ -220,16 +220,22 @@ Header =
|
|||||||
boardID = t.split('-')[0]
|
boardID = t.split('-')[0]
|
||||||
boardID = g.BOARD.ID if boardID is 'current'
|
boardID = g.BOARD.ID if boardID is 'current'
|
||||||
|
|
||||||
for aOrig in as
|
a = do ->
|
||||||
if aOrig.textContent is boardID
|
if boardID is '@'
|
||||||
a = aOrig.cloneNode true
|
return $.el 'a',
|
||||||
if !a
|
href: 'https://twitter.com/4chan'
|
||||||
if /^current/.test t
|
title: '4chan Twitter'
|
||||||
a = $.el 'a',
|
textContent: '@'
|
||||||
href: "/#{boardID}/"
|
|
||||||
textContent: boardID
|
for a in as when a.textContent is boardID
|
||||||
else
|
return a.cloneNode true
|
||||||
return $.tn t
|
|
||||||
|
a = $.el 'a',
|
||||||
|
href: "/#{boardID}/"
|
||||||
|
textContent: boardID
|
||||||
|
a.href += g.VIEW if g.VIEW in ['catalog', 'archive']
|
||||||
|
a.className = 'current' if boardID is g.BOARD.ID
|
||||||
|
a
|
||||||
|
|
||||||
a.textContent = if /-title/.test(t) or /-replace/.test(t) and boardID is g.BOARD.ID
|
a.textContent = if /-title/.test(t) or /-replace/.test(t) and boardID is g.BOARD.ID
|
||||||
a.title or a.textContent
|
a.title or a.textContent
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user