We need these g.'s ASAP.
This commit is contained in:
parent
8b7ab80069
commit
74f9df889a
@ -18,13 +18,6 @@ Main =
|
|||||||
Conf['archives'] = Redirect.archives
|
Conf['archives'] = Redirect.archives
|
||||||
$.get Conf, Main.initFeatures
|
$.get Conf, Main.initFeatures
|
||||||
|
|
||||||
$.on d, '4chanMainInit', Main.initStyle
|
|
||||||
$.asap (-> d.head and $('title', d.head) or d.readyState in ['interactive', 'complete']),
|
|
||||||
Main.initStyle
|
|
||||||
|
|
||||||
initFeatures: (items) ->
|
|
||||||
Conf = items
|
|
||||||
|
|
||||||
pathname = location.pathname.split '/'
|
pathname = location.pathname.split '/'
|
||||||
g.BOARD = new Board pathname[1]
|
g.BOARD = new Board pathname[1]
|
||||||
g.VIEW =
|
g.VIEW =
|
||||||
@ -38,6 +31,13 @@ Main =
|
|||||||
if g.VIEW is 'thread'
|
if g.VIEW is 'thread'
|
||||||
g.THREADID = +pathname[3]
|
g.THREADID = +pathname[3]
|
||||||
|
|
||||||
|
$.on d, '4chanMainInit', Main.initStyle
|
||||||
|
$.asap (-> d.head and $('title', d.head) or d.readyState in ['interactive', 'complete']),
|
||||||
|
Main.initStyle
|
||||||
|
|
||||||
|
initFeatures: (items) ->
|
||||||
|
Conf = items
|
||||||
|
|
||||||
switch location.hostname
|
switch location.hostname
|
||||||
when 'api.4chan.org'
|
when 'api.4chan.org'
|
||||||
return
|
return
|
||||||
@ -48,9 +48,10 @@ Main =
|
|||||||
$.ready ->
|
$.ready ->
|
||||||
if Conf['404 Redirect'] and d.title is '4chan - 404 Not Found'
|
if Conf['404 Redirect'] and d.title is '4chan - 404 Not Found'
|
||||||
Redirect.init()
|
Redirect.init()
|
||||||
|
pathname = location.pathname.split '/'
|
||||||
URL = Redirect.to 'file',
|
URL = Redirect.to 'file',
|
||||||
boardID: pathname[1]
|
boardID: g.BOARD.ID
|
||||||
filename: pathname[3]
|
filename: pathname[pathname.length - 1]
|
||||||
location.href = URL if URL
|
location.href = URL if URL
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user