diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 3610d40d3..393beed5b 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -13814,7 +13814,7 @@ return $.on(d, '4chanMainInit', Main.initStyle); }, initFeatures: function() { - var init, video; + var init; switch (location.hostname) { case 'a.4cdn.org': return; @@ -13822,20 +13822,20 @@ Report.init(); return; case 'i.4cdn.org': - if (Conf['Loop in New Tab'] && (video = $('video'))) { - Video.configure(video); - $.on(video, 'click', function() { - if (!video.controls) { - if (video.paused) { - return video.play(); - } else { - return video.pause(); - } - } - }); - } $.ready(function() { - var URL, pathname, _ref; + var URL, pathname, video, _ref; + if (Conf['Loop in New Tab'] && (video = $('video'))) { + Video.configure(video); + if (!video.controls) { + $.on(video, 'click', function() { + if (video.paused) { + return video.play(); + } else { + return video.pause(); + } + }); + } + } if (Conf['404 Redirect'] && ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found')) { Redirect.init(); pathname = location.pathname.split('/'); diff --git a/builds/crx/script.js b/builds/crx/script.js index 630f406ec..762d8dbd5 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -13832,7 +13832,7 @@ return $.on(d, '4chanMainInit', Main.initStyle); }, initFeatures: function() { - var init, video; + var init; switch (location.hostname) { case 'a.4cdn.org': return; @@ -13840,20 +13840,20 @@ Report.init(); return; case 'i.4cdn.org': - if (Conf['Loop in New Tab'] && (video = $('video'))) { - Video.configure(video); - $.on(video, 'click', function() { - if (!video.controls) { - if (video.paused) { - return video.play(); - } else { - return video.pause(); - } - } - }); - } $.ready(function() { - var URL, pathname, _ref; + var URL, pathname, video, _ref; + if (Conf['Loop in New Tab'] && (video = $('video'))) { + Video.configure(video); + if (!video.controls) { + $.on(video, 'click', function() { + if (video.paused) { + return video.play(); + } else { + return video.pause(); + } + }); + } + } if (Conf['404 Redirect'] && ((_ref = d.title) === '4chan - Temporarily Offline' || _ref === '4chan - 404 Not Found')) { Redirect.init(); pathname = location.pathname.split('/'); diff --git a/src/General/Main.coffee b/src/General/Main.coffee index 6bc4b3669..fd2feb74d 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -53,12 +53,12 @@ Main = Report.init() return when 'i.4cdn.org' - 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 -> + if Conf['Loop in New Tab'] and video = $ 'video' + Video.configure video + if !video.controls + $.on video, 'click', -> + if video.paused then video.play() else video.pause() if Conf['404 Redirect'] and d.title in ['4chan - Temporarily Offline', '4chan - 404 Not Found'] Redirect.init() pathname = location.pathname.split '/'