Make bottom board list code work on Tinyboard/vichan sites.

This commit is contained in:
ccd0 2019-07-08 18:30:10 -07:00
parent f6c37ce57f
commit 4d9dae9095
4 changed files with 9 additions and 7 deletions

View File

@ -95,7 +95,7 @@ Header =
$.onExists doc, "#{Site.selectors.boardList} + *", Header.generateFullBoardList
Main.ready ->
if not (footer = $.id 'boardNavDesktopFoot')
if Site.software is 'yotsuba' and not (footer = $.id 'boardNavDesktopFoot')
return unless (absbot = $.id 'absbot')
footer = $.id('boardNavDesktop').cloneNode true
footer.id = 'boardNavDesktopFoot'
@ -103,10 +103,10 @@ Header =
$('#settingsWindowLink', footer).id = 'settingsWindowLinkBot'
$.before absbot, footer
$.globalEval 'window.cloneTopNav = function() {};'
if (a = $ "a[href*='/#{g.BOARD}/']", footer)
a.className = 'current'
Header.bottomBoardList = $ '.boardList', footer
CatalogLinks.setLinks Header.bottomBoardList
if (Header.bottomBoardList = $ Site.selectors.boardListBottom)
for a in $$ 'a', Header.bottomBoardList
a.className = 'current' if a.hostname is location.hostname and a.pathname.split('/')[1] is g.BOARD.ID
CatalogLinks.setLinks Header.bottomBoardList
if Site.software is 'yotsuba' and (g.VIEW is 'catalog' or !Conf['Disable Native Extension'])
cs = $.el 'a', href: 'javascript:;'

View File

@ -57,7 +57,7 @@ a[href="javascript:;"] {
#boardNavDesktop, #boardNavMobile {
display: none !important;
}
:root.hide-bottom-board-list #boardNavDesktopFoot {
:root.hide-bottom-board-list $site$boardListBottom {
display: none;
}
body.hasDropDownNav{
@ -366,7 +366,7 @@ audio.controls-added {
#toggleMsgBtn {
display: none !important;
}
.current {
#board-list .current {
font-weight: bold;
}
@media (min-width: 1300px) {

View File

@ -100,6 +100,7 @@ SW.tinyboard =
spoiler: '.spoiler'
quotelink: 'a[onclick^="highlightReply("]'
boardList: '.boardlist'
boardListBottom: '.boardlist.bottom'
styleSheet: '#stylesheet'
xpath:

View File

@ -48,6 +48,7 @@ SW.yotsuba =
spoiler: 's'
quotelink: ':not(pre) > .quotelink' # XXX https://github.com/4chan/4chan-JS/issues/77: 4chan currently creates quote links inside [code] tags; ignore them
boardList: '#boardNavDesktop > .boardList'
boardListBottom: '#boardNavDesktopFoot > .boardList'
styleSheet: 'link[title=switch]'
xpath: