From 97b29d60b1efd194d15ffa8116a469bc3d947c06 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 25 Dec 2017 05:17:58 -0800 Subject: [PATCH] Custom board list fixes for multisite. --- src/General/Header.coffee | 20 +++++++++++++++----- src/Miscellaneous/CatalogLinks.coffee | 8 ++++---- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/General/Header.coffee b/src/General/Header.coffee index 8e99ecab1..27923d924 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -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. diff --git a/src/Miscellaneous/CatalogLinks.coffee b/src/Miscellaneous/CatalogLinks.coffee index 2993e7630..f3f18b9b7 100644 --- a/src/Miscellaneous/CatalogLinks.coffee +++ b/src/Miscellaneous/CatalogLinks.coffee @@ -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}/"