diff --git a/4chan_x.user.js b/4chan_x.user.js index 8e44b8ae0..7eeda2e87 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -20,7 +20,7 @@ // @icon https://github.com/MayhemYDG/4chan-x/raw/stable/img/icon.gif // ==/UserScript== -/* 4chan X Alpha - Version 3.0.0 - 2013-01-14 +/* 4chan X Alpha - Version 3.0.0 - 2013-01-15 * http://mayhemydg.github.com/4chan-x/ * * Copyright (c) 2009-2011 James Campos @@ -43,7 +43,7 @@ */ (function() { - var $, $$, Anonymize, AutoGIF, Board, Build, Clone, Conf, Config, FileInfo, Get, ImageHover, Main, Post, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, Quotify, Redirect, RevealSpoilers, Sauce, Thread, ThreadUpdater, Time, UI, d, g, unitTesting, _base, + var $, $$, Anonymize, AutoGIF, Board, Build, Clone, Conf, Config, FileInfo, Get, ImageHover, Main, Post, QuoteBacklink, QuoteCT, QuoteInline, QuoteOP, QuotePreview, Quotify, Redirect, RevealSpoilers, Sauce, Thread, ThreadUpdater, Time, UI, d, g, _base, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; @@ -171,9 +171,7 @@ imageFit: 'fit width' }; - unitTesting = !!window.QUnit; - - if (!(/^(boards|images|sys)\.4chan\.org$/.test(location.hostname) || unitTesting)) { + if (!/^(boards|images|sys)\.4chan\.org$/.test(location.hostname)) { return; } @@ -2617,10 +2615,6 @@ val = Conf[key]; Conf[key] = $.get(key, val); } - if (unitTesting) { - Main.initUnitTesting(); - return; - } pathname = location.pathname.split('/'); g.BOARD = new Board(pathname[1]); g.VIEW = (function() { @@ -2657,39 +2651,6 @@ }); } }, - initUnitTesting: function() { - window.x = { - Conf: Conf, - g: g, - UI: UI, - $: $, - Board: Board, - Thread: Thread, - Post: Post, - Clone: Clone, - Main: Main, - Redirect: Redirect, - Build: Build, - Get: Get, - Quotify: Quotify, - QuoteInline: QuoteInline, - QuotePreview: QuotePreview, - QuoteBacklink: QuoteBacklink, - QuoteOP: QuoteOP, - QuoteCT: QuoteCT, - Anonymize: Anonymize, - Time: Time, - FileInfo: FileInfo, - Sauce: Sauce, - RevealSpoilers: RevealSpoilers, - AutoGIF: AutoGIF, - ImageHover: ImageHover, - ThreadUpdater: ThreadUpdater - }; - g.BOARD = new Board('a'); - g.REPLY = true; - return g.THREAD = '123456789'; - }, initHeader: function() { $.addStyle(Main.css); Main.header = $.el('div', { diff --git a/package.json b/package.json index 45c842da1..21d640a82 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "grunt-contrib-clean": "0.3.x", "grunt-contrib-coffee": "0.3.x", "grunt-exec": "0.3.x", - "grunt-image-embed": "0.0.x", + "grunt-image-embed": "0.2.x", "qunitjs": "1.x.x" }, "license": "MIT", diff --git a/src/globals.coffee b/src/globals.coffee index 2f86bbc11..3240504f0 100644 --- a/src/globals.coffee +++ b/src/globals.coffee @@ -1,8 +1,6 @@ -unitTesting = !!window.QUnit - # Opera doesn't support the @match metadata key, # return 4chan X here if we're not on 4chan. -return unless /^(boards|images|sys)\.4chan\.org$/.test(location.hostname) or unitTesting +return unless /^(boards|images|sys)\.4chan\.org$/.test location.hostname Conf = {} d = document diff --git a/src/main.coffee b/src/main.coffee index 62a07ad70..a2fea6c8f 100644 --- a/src/main.coffee +++ b/src/main.coffee @@ -277,10 +277,6 @@ Main = for key, val of Conf Conf[key] = $.get key, val - if unitTesting - Main.initUnitTesting() - return - pathname = location.pathname.split '/' g.BOARD = new Board pathname[1] g.VIEW = @@ -308,43 +304,6 @@ Main = location.href = url if url return - initUnitTesting: -> - window.x = - # globals.coffee - Conf: Conf - g: g - # ui.coffee - UI: UI - # $.coffee - $: $ - # main.coffee - Board: Board - Thread: Thread - Post: Post - Clone: Clone - Main: Main - # features.coffee - Redirect: Redirect - Build: Build - Get: Get - Quotify: Quotify - QuoteInline: QuoteInline - QuotePreview: QuotePreview - QuoteBacklink: QuoteBacklink - QuoteOP: QuoteOP - QuoteCT: QuoteCT - Anonymize: Anonymize - Time: Time - FileInfo: FileInfo - Sauce: Sauce - RevealSpoilers: RevealSpoilers - AutoGIF: AutoGIF - ImageHover: ImageHover - ThreadUpdater: ThreadUpdater - g.BOARD = new Board 'a' - g.REPLY = true - g.THREAD = '123456789' - initHeader: -> $.addStyle Main.css Main.header = $.el 'div',