diff --git a/4chan_x.user.js b/4chan_x.user.js index a4dad4a7e..274229c42 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -922,7 +922,7 @@ boardTitle = $.el('a', { className: 'board-name', innerHTML: "/" + g.BOARD + "/ - ...", - href: "/" + g.BOARD + "/" + href: "/" + g.BOARD + "/" + (g.VIEW === 'catalog' ? 'catalog' : '') }); boardList = $.el('span', { className: 'board-list', @@ -946,7 +946,7 @@ setBoardList: function() { var a, nav; if (nav = $.id('boardNavDesktop')) { - if (a = $("a[href$='/" + g.BOARD + "/']", nav)) { + if (a = $("a[href*='/" + g.BOARD + "/']", nav)) { a.className = 'current'; $('.board-title', Header.headerEl).textContent = a.title; } @@ -2449,7 +2449,7 @@ return this.input.alt = count; }, reload: function(focus) { - $.unsafeWindow.Recaptcha.reload('r'); + $.unsafeWindow.Recaptcha.reload('t'); if (focus) { return QR.captcha.input.focus(); } @@ -5119,6 +5119,10 @@ $.addClass(doc, $.engine); $.addClass(doc, 'fourchan-x'); $.addStyle(Main.css); + if (g.VIEW === 'catalog') { + $.addClass(doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace(/_+/g, '-')); + return; + } style = 'yotsuba-b'; mainStyleSheet = $('link[title=switch]', d.head); styleSheets = $$('link[rel="alternate stylesheet"]', d.head); diff --git a/src/features.coffee b/src/features.coffee index 04d5b677e..2ea742d45 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -25,7 +25,7 @@ Header = boardTitle = $.el 'a', className: 'board-name' innerHTML: "/#{g.BOARD}/ - ..." - href: "/#{g.BOARD}/" + href: "/#{g.BOARD}/#{if g.VIEW is 'catalog' then 'catalog' else ''}" boardList = $.el 'span', className: 'board-list' hidden: true @@ -43,7 +43,7 @@ Header = setBoardList: -> if nav = $.id 'boardNavDesktop' - if a = $ "a[href$='/#{g.BOARD}/']", nav + if a = $ "a[href*='/#{g.BOARD}/']", nav a.className = 'current' $('.board-title', Header.headerEl).textContent = a.title $.add $('.board-list', Header.headerEl), @@ -1263,7 +1263,7 @@ QR = @input.alt = count # For XTRM RICE. reload: (focus) -> # the 't' argument prevents the input from being focused - $.unsafeWindow.Recaptcha.reload 'r' + $.unsafeWindow.Recaptcha.reload 't' # Focus if we meant to. QR.captcha.input.focus() if focus keydown: (e) -> diff --git a/src/main.coffee b/src/main.coffee index 165cb3784..5ef3026cf 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -332,6 +332,10 @@ Main = $.addClass doc, 'fourchan-x' $.addStyle Main.css + if g.VIEW is 'catalog' + $.addClass doc, $.id('base-css').href.match(/catalog_(\w+)/)[1].replace('_new', '').replace /_+/g, '-' + return + style = 'yotsuba-b' mainStyleSheet = $ 'link[title=switch]', d.head styleSheets = $$ 'link[rel="alternate stylesheet"]', d.head