better solution to the loading problem
This commit is contained in:
parent
200723d742
commit
8fb98b785a
@ -50,12 +50,7 @@ Main =
|
|||||||
Report.init()
|
Report.init()
|
||||||
return
|
return
|
||||||
when 'i.4cdn.org'
|
when 'i.4cdn.org'
|
||||||
if Conf['Loop in New Tab'] and document.body and video = $ 'video'
|
onReady = ->
|
||||||
Video.configure video
|
|
||||||
$.on video, 'click', ->
|
|
||||||
if !video.controls
|
|
||||||
if video.paused then video.play() else video.pause()
|
|
||||||
$.ready ->
|
|
||||||
if Conf['404 Redirect'] and d.title in ['4chan - Temporarily Offline', '4chan - 404 Not Found']
|
if Conf['404 Redirect'] and d.title in ['4chan - Temporarily Offline', '4chan - 404 Not Found']
|
||||||
Redirect.init()
|
Redirect.init()
|
||||||
pathname = location.pathname.split '/'
|
pathname = location.pathname.split '/'
|
||||||
@ -63,6 +58,12 @@ Main =
|
|||||||
boardID: g.BOARD.ID
|
boardID: g.BOARD.ID
|
||||||
filename: pathname[pathname.length - 1]
|
filename: pathname[pathname.length - 1]
|
||||||
location.replace URL if URL
|
location.replace URL if URL
|
||||||
|
else if Conf['Loop in New Tab'] and video = $ 'video'
|
||||||
|
Video.configure video
|
||||||
|
$.on video, 'click', ->
|
||||||
|
if !video.controls
|
||||||
|
if video.paused then video.play() else video.pause()
|
||||||
|
$.ready onReady, true
|
||||||
return
|
return
|
||||||
|
|
||||||
# c.time 'All initializations'
|
# c.time 'All initializations'
|
||||||
|
|||||||
@ -16,9 +16,9 @@ $.DAY = 24 *
|
|||||||
$.id = (id) ->
|
$.id = (id) ->
|
||||||
d.getElementById id
|
d.getElementById id
|
||||||
|
|
||||||
$.ready = (fc) ->
|
$.ready = (fc, immediate) ->
|
||||||
unless d.readyState is 'loading'
|
unless d.readyState is 'loading'
|
||||||
$.queueTask fc
|
if immediate then fc() else $.queueTask fc
|
||||||
return
|
return
|
||||||
cb = ->
|
cb = ->
|
||||||
$.off d, 'DOMContentLoaded', cb
|
$.off d, 'DOMContentLoaded', cb
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user