Style fixes for the catalog.

4chan's integration of the catalog is terrible. I don't see myself supporting it any further.
This commit is contained in:
Nicolas Stepien 2013-02-12 23:37:31 +01:00
parent a9b427f0d2
commit 4e976a5594
3 changed files with 14 additions and 6 deletions

View File

@ -922,7 +922,7 @@
boardTitle = $.el('a', {
className: 'board-name',
innerHTML: "<span class=board-path>/" + g.BOARD + "/</span> - <span class=board-title>...</span>",
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);

View File

@ -25,7 +25,7 @@ Header =
boardTitle = $.el 'a',
className: 'board-name'
innerHTML: "<span class=board-path>/#{g.BOARD}/</span> - <span class=board-title>...</span>"
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) ->

View File

@ -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