From 93c78e2d5488e629db81d417a4beaaeed4072267 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Sat, 11 Jan 2014 10:56:48 -0700 Subject: [PATCH] I like that just a little bit better. --- builds/4chan-X.user.js | 8 ++++---- builds/crx/script.js | 8 ++++---- src/General/Navigate.coffee | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index a25ea4cc2..27ca13d90 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -11997,7 +11997,7 @@ g.BOARD = new Board(boardID); req = null; onload = function(e) { - var board, findStyle, mainStyleSheet, newStyleSheet, sfw, style, type, _ref; + var board, findStyle, mainStyleSheet, newStyleSheet, sfw, style; if (e.type === 'abort') { req.onloadend = null; return; @@ -12037,10 +12037,10 @@ style = d.cookie.match(new RegExp("" + type + "\_style\=([^;]+)")); return [(style ? style[1] : base), "" + type + "_style"]; }; - _ref = findStyle(sfw ? [ws, 'Yotsuba B New'] : [nws, 'Yotsuba New']), style = _ref[0], type = _ref[1]; - $.globalEval("var style_group = '" + type + "'"); + style = findStyle(sfw ? [ws, 'Yotsuba B New'] : [nws, 'Yotsuba New']); + $.globalEval("var style_group = '" + style[1] + "'"); mainStyleSheet = $('link[title=switch]', d.head); - newStyleSheet = $("link[title='" + style + "']", d.head); + newStyleSheet = $("link[title='" + style[0] + "']", d.head); Favicon.SFW = sfw; Favicon.el.href = "//s.4cdn.org/image/favicon" + (sfw ? '-ws' : '') + ".ico"; $.add(d.head, Favicon.el); diff --git a/builds/crx/script.js b/builds/crx/script.js index 34bea2b40..3b58a2a6a 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -11986,7 +11986,7 @@ g.BOARD = new Board(boardID); req = null; onload = function(e) { - var board, findStyle, mainStyleSheet, newStyleSheet, sfw, style, type, _ref; + var board, findStyle, mainStyleSheet, newStyleSheet, sfw, style; if (e.type === 'abort') { req.onloadend = null; return; @@ -12026,10 +12026,10 @@ style = d.cookie.match(new RegExp("" + type + "\_style\=([^;]+)")); return [(style ? style[1] : base), "" + type + "_style"]; }; - _ref = findStyle(sfw ? [ws, 'Yotsuba B New'] : [nws, 'Yotsuba New']), style = _ref[0], type = _ref[1]; - $.globalEval("var style_group = '" + type + "'"); + style = findStyle(sfw ? [ws, 'Yotsuba B New'] : [nws, 'Yotsuba New']); + $.globalEval("var style_group = '" + style[1] + "'"); mainStyleSheet = $('link[title=switch]', d.head); - newStyleSheet = $("link[title='" + style + "']", d.head); + newStyleSheet = $("link[title='" + style[0] + "']", d.head); Favicon.SFW = sfw; Favicon.el.href = "//s.4cdn.org/image/favicon" + (sfw ? '-ws' : '') + ".ico"; $.add(d.head, Favicon.el); diff --git a/src/General/Navigate.coffee b/src/General/Navigate.coffee index 04cde2188..df7fb141c 100644 --- a/src/General/Navigate.coffee +++ b/src/General/Navigate.coffee @@ -140,15 +140,15 @@ Navigate = style = d.cookie.match new RegExp "#{type}\_style\=([^;]+)" return [(if style then style[1] else base), "#{type}_style"] - [style, type] = findStyle if sfw + style = findStyle if sfw [ws, 'Yotsuba B New'] else [nws, 'Yotsuba New'] - $.globalEval "var style_group = '#{type}'" + $.globalEval "var style_group = '#{style[1]}'" - mainStyleSheet = $ 'link[title=switch]', d.head - newStyleSheet = $ "link[title='#{style}']", d.head + mainStyleSheet = $ 'link[title=switch]', d.head + newStyleSheet = $ "link[title='#{style[0]}']", d.head Favicon.SFW = sfw Favicon.el.href = "//s.4cdn.org/image/favicon#{if sfw then '-ws' else ''}.ico"