Fix bottom board list after 4chan change. #285

This commit is contained in:
ccd0 2015-01-11 13:40:01 -08:00
parent 859b2fba18
commit ca65e5ac76
2 changed files with 14 additions and 9 deletions

View File

@ -85,17 +85,25 @@ Header =
return unless Main.isThisPageLegit()
# Wait for #boardNavMobile instead of #boardNavDesktop,
# it might be incomplete otherwise.
$.asap (-> $.id('boardNavMobile') or d.readyState isnt 'loading'), Header.setBoardList
$.asap (-> $.id('boardNavMobile') or d.readyState isnt 'loading'), ->
Header.footer = footer = $.id('boardNavDesktop').cloneNode true
footer.id = 'boardNavDesktopFoot'
$.rm $('#navtopright', footer)
if a = $ "a[href*='/#{g.BOARD}/']", footer
a.className = 'current'
Header.setFooterVisibility Conf['Bottom Board List']
$.sync 'Bottom Board List', Header.setFooterVisibility
Main.ready ->
$.rm oldFooter if oldFooter = $.id 'boardNavDesktopFoot'
$.globalEval 'window.cloneTopNav = function() {};'
$.before $.id('absbot'), footer
Header.setBoardList()
$.prepend d.body, @bar
$.add d.body, Header.hover
@setBarPosition Conf['Bottom Header']
@
Main.ready =>
@footer = footer = $.id 'boardNavDesktopFoot'
if a = $ "a[href*='/#{g.BOARD}/']", footer
a.className = 'current'
if g.VIEW is 'catalog' or !Conf['Disable Native Extension']
cs = $.el 'a', href: 'javascript:;'
if g.VIEW is 'catalog'
@ -108,9 +116,6 @@ Header =
$.id('settingsWindowLink').click()
@addShortcut cs
Header.setFooterVisibility Conf['Bottom Board List']
$.sync 'Bottom Board List', Header.setFooterVisibility
@enableDesktopNotifications()
bar: $.el 'div',

View File

@ -53,7 +53,7 @@ CatalogLinks =
CatalogLinks.set @checked
set: (useCatalog) ->
for a in $$ """#board-list a:not([data-only]), #boardNavDesktopFoot a"""
for a in $$('a:not([data-only])', Header.boardList).concat $$('a', Header.footer)
continue if a.hostname not in ['boards.4chan.org', 'catalog.neet.tv', '4index.gropes.us'] or
!(board = a.pathname.split('/')[1]) or
board in ['f', 'status', '4chan'] or