From eeb6ee22a4581160a5a43208abf88d55d98f5d33 Mon Sep 17 00:00:00 2001 From: seaweedchan Date: Tue, 13 Aug 2013 00:41:04 -0700 Subject: [PATCH] Remove redundancy --- builds/4chan-X.user.js | 20 +------------------- builds/crx/script.js | 20 +------------------- src/General/Main.coffee | 13 ------------- 3 files changed, 2 insertions(+), 51 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 9e0fc2da3..74504016e 100755 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -10339,25 +10339,7 @@ Main = { init: function() { - var db, flatten, pathname, _i, _len, _ref; - pathname = location.pathname.split('/'); - g.BOARD = new Board(pathname[1]); - if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') { - return; - } - g.VIEW = (function() { - switch (pathname[2]) { - case 'res': - return 'thread'; - case 'catalog': - return 'catalog'; - default: - return 'index'; - } - })(); - if (g.VIEW === 'thread') { - g.THREADID = +pathname[3]; - } + var db, flatten, _i, _len; flatten = function(parent, obj) { var key, val; if (obj instanceof Array) { diff --git a/builds/crx/script.js b/builds/crx/script.js index 9a24d2b99..bcabbb5ce 100755 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -10324,25 +10324,7 @@ Main = { init: function() { - var db, flatten, pathname, _i, _len, _ref; - pathname = location.pathname.split('/'); - g.BOARD = new Board(pathname[1]); - if ((_ref = g.BOARD.ID) === 'z' || _ref === 'fk') { - return; - } - g.VIEW = (function() { - switch (pathname[2]) { - case 'res': - return 'thread'; - case 'catalog': - return 'catalog'; - default: - return 'index'; - } - })(); - if (g.VIEW === 'thread') { - g.THREADID = +pathname[3]; - } + var db, flatten, _i, _len; flatten = function(parent, obj) { var key, val; if (obj instanceof Array) { diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 996f17d97..000058db6 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -1,18 +1,5 @@ Main = init: -> - pathname = location.pathname.split '/' - g.BOARD = new Board pathname[1] - return if g.BOARD.ID in ['z', 'fk'] - g.VIEW = - switch pathname[2] - when 'res' - 'thread' - when 'catalog' - 'catalog' - else - 'index' - if g.VIEW is 'thread' - g.THREADID = +pathname[3] # flatten Config into Conf # and get saved or default values flatten = (parent, obj) ->