Custom board list fixes for multisite.

This commit is contained in:
ccd0 2017-12-25 05:17:58 -08:00
parent 7115204dcf
commit 97b29d60b1
2 changed files with 19 additions and 9 deletions

View File

@ -227,7 +227,17 @@ Header =
return a
boardID = t.split('-')[0]
boardID = g.BOARD.ID if boardID is 'current'
if boardID is 'current'
if location.hostname is 'boards.4chan.org'
boardID = g.BOARD.ID
else
a = $.el 'a',
href: "/#{g.BOARD.ID}/"
textContent: text or g.BOARD.ID
className: 'current'
if /-(catalog|archive|expired)/.test(t)
a = a.firstChild # Its text node.
return a
a = do ->
if boardID is '@'
@ -240,13 +250,13 @@ Header =
return a.cloneNode true
a = $.el 'a',
href: "/#{boardID}/"
href: "//boards.4chan.org/#{boardID}/"
textContent: boardID
a.href += g.VIEW if g.VIEW in ['catalog', 'archive']
a.className = 'current' if boardID is g.BOARD.ID
a.className = 'current' if a.hostname is location.hostname and 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 a.hostname is location.hostname and boardID is g.BOARD.ID
a.title or a.textContent
else if /-full/.test t
("/#{boardID}/") + (if a.title then " - #{a.title}" else '')
@ -274,7 +284,7 @@ Header =
if /-expired/.test t
if boardID not in ['b', 'f', 'trash', 'bant']
a.href = "/#{boardID}/archive"
a.href = "//boards.4chan.org/#{boardID}/archive"
else
return a.firstChild # Its text node.

View File

@ -78,12 +78,12 @@ CatalogLinks =
if Conf['External Catalog'] and board in ['a', 'c', 'g', 'biz', 'k', 'm', 'o', 'p', 'v', 'vg', 'vr', 'w', 'wg', 'cm', '3', 'adv', 'an', 'asp', 'cgl', 'ck', 'co', 'diy', 'fa', 'fit', 'gd', 'int', 'jp', 'lit', 'mlp', 'mu', 'n', 'out', 'po', 'sci', 'sp', 'tg', 'toy', 'trv', 'tv', 'vp', 'wsg', 'x', 'f', 'pol', 's4s', 'lgbt']
"http://catalog.neet.tv/#{board}/"
else if Conf['JSON Index'] and Conf['Use <%= meta.name %> Catalog']
if g.BOARD.ID is board and g.VIEW is 'index' then '#catalog' else "/#{board}/#catalog"
if location.hostname is 'boards.4chan.org' and g.BOARD.ID is board and g.VIEW is 'index' then '#catalog' else "//boards.4chan.org/#{board}/#catalog"
else
"/#{board}/catalog"
"//boards.4chan.org/#{board}/catalog"
index: (board=g.BOARD.ID) ->
if Conf['JSON Index'] and board isnt 'f'
if g.BOARD.ID is board and g.VIEW is 'index' then '#index' else "/#{board}/#index"
if location.hostname is 'boards.4chan.org' and g.BOARD.ID is board and g.VIEW is 'index' then '#index' else "//boards.4chan.org/#{board}/#index"
else
"/#{board}/"
"//boards.4chan.org/#{board}/"