diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 393beed5b..e4fd91bab 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -13824,18 +13824,6 @@ case 'i.4cdn.org': $.ready(function() { 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('/'); @@ -13846,6 +13834,17 @@ if (URL) { return location.replace(URL); } + } else if (Conf['Loop in New Tab'] && (video = $('video'))) { + Video.configure(video); + if (!video.controls) { + return $.on(video, 'click', function() { + if (video.paused) { + return video.play(); + } else { + return video.pause(); + } + }); + } } }); return; diff --git a/builds/crx/script.js b/builds/crx/script.js index 762d8dbd5..835c725e6 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -13842,18 +13842,6 @@ case 'i.4cdn.org': $.ready(function() { 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('/'); @@ -13864,6 +13852,17 @@ if (URL) { return location.replace(URL); } + } else if (Conf['Loop in New Tab'] && (video = $('video'))) { + Video.configure(video); + if (!video.controls) { + return $.on(video, 'click', function() { + if (video.paused) { + return video.play(); + } else { + return video.pause(); + } + }); + } } }); return; diff --git a/src/General/Main.coffee b/src/General/Main.coffee index fd2feb74d..436f83b5e 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -54,11 +54,6 @@ Main = return when 'i.4cdn.org' $.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 '/' @@ -66,6 +61,11 @@ Main = boardID: g.BOARD.ID filename: pathname[pathname.length - 1] location.replace URL if URL + else 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() return # c.time 'All initializations'