Make custom 'current' board links work on unlisted boards.
This commit is contained in:
parent
f80eb87dc6
commit
9693ea5821
@ -207,39 +207,47 @@ Header =
|
|||||||
g.BOARD.ID
|
g.BOARD.ID
|
||||||
else
|
else
|
||||||
t.match(/^[^-]+/)[0]
|
t.match(/^[^-]+/)[0]
|
||||||
for a in as
|
|
||||||
if a.textContent is boardID
|
|
||||||
a = a.cloneNode true
|
|
||||||
|
|
||||||
a.textContent = if /-title/.test(t) or /-replace/.test(t) and $.hasClass a, 'current'
|
for aOrig in as
|
||||||
a.title
|
if aOrig.textContent is boardID
|
||||||
else if /-full/.test t
|
a = aOrig.cloneNode true
|
||||||
"/#{boardID}/ - #{a.title}"
|
if !a
|
||||||
else if text
|
if /^current/.test t
|
||||||
text
|
a = $.el 'a',
|
||||||
else
|
href: "/#{boardID}/"
|
||||||
a.textContent
|
textContent: boardID
|
||||||
|
else
|
||||||
|
return $.tn t
|
||||||
|
|
||||||
if m = t.match /-(index|catalog)/
|
a.textContent = if /-title/.test(t) or /-replace/.test(t) and $.hasClass a, 'current'
|
||||||
a.dataset.only = m[1]
|
a.title or a.textContent
|
||||||
a.href = CatalogLinks[m[1]] boardID
|
else if /-full/.test t
|
||||||
$.addClass a, 'catalog' if m[1] is 'catalog'
|
"/#{boardID}/" + (if a.title then " - #{a.title}" else '')
|
||||||
|
else if text
|
||||||
|
text
|
||||||
|
else
|
||||||
|
a.textContent
|
||||||
|
|
||||||
if /-archive/.test t
|
if m = t.match /-(index|catalog)/
|
||||||
if href = Redirect.to 'board', {boardID}
|
a.dataset.only = m[1]
|
||||||
a.href = href
|
a.href = CatalogLinks[m[1]] boardID
|
||||||
else
|
$.addClass a, 'catalog' if m[1] is 'catalog'
|
||||||
return $.tn a.textContent
|
|
||||||
|
|
||||||
if /-expired/.test t
|
if /-archive/.test t
|
||||||
if boardID not in ['b', 'f']
|
if href = Redirect.to 'board', {boardID}
|
||||||
a.href = "/#{boardID}/archive"
|
a.href = href
|
||||||
else
|
else
|
||||||
return $.tn a.textContent
|
return $.tn a.textContent
|
||||||
|
|
||||||
|
if /-expired/.test t
|
||||||
|
if boardID not in ['b', 'f']
|
||||||
|
a.href = "/#{boardID}/archive"
|
||||||
|
else
|
||||||
|
return $.tn a.textContent
|
||||||
|
|
||||||
|
$.addClass a, 'navSmall' if boardID is '@'
|
||||||
|
return a
|
||||||
|
|
||||||
$.addClass a, 'navSmall' if boardID is '@'
|
|
||||||
return a
|
|
||||||
$.tn t
|
|
||||||
$.add list, nodes
|
$.add list, nodes
|
||||||
$.ready CatalogLinks.initBoardList
|
$.ready CatalogLinks.initBoardList
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user