From 371cf05b68247fcd52439950fcc00e555bc52123 Mon Sep 17 00:00:00 2001 From: Mayhem Date: Fri, 17 May 2013 22:02:16 +0200 Subject: [PATCH] Set the g's even sooner. --- src/General/Main.coffee | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 2fea223c6..3191dc148 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -1,5 +1,19 @@ Main = init: (items) -> + pathname = location.pathname.split '/' + g.BOARD = new Board pathname[1] + return if g.BOARD.ID is 'z' + 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) -> @@ -18,20 +32,6 @@ Main = Conf['archives'] = Redirect.archives $.get Conf, Main.initFeatures - pathname = location.pathname.split '/' - g.BOARD = new Board pathname[1] - return if g.BOARD.ID is 'z' - g.VIEW = - switch pathname[2] - when 'res' - 'thread' - when 'catalog' - 'catalog' - else - 'index' - if g.VIEW is 'thread' - g.THREADID = +pathname[3] - $.on d, '4chanMainInit', Main.initStyle $.asap (-> d.head and $('title', d.head) or d.readyState in ['interactive', 'complete']), Main.initStyle