diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 26a197f7a..29132b8ec 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -6245,7 +6245,7 @@ ImageExpand.contract(post); src = this.src.split('/'); if (src[2] === 'images.4chan.org') { - URL = Redirect.to('image', { + URL = Redirect.to('file', { boardID: src[3], filename: src[5] }); @@ -6385,7 +6385,7 @@ post = g.posts[this.dataset.fullid]; src = this.src.split('/'); if (src[2] === 'images.4chan.org') { - URL = Redirect.to('image', { + URL = Redirect.to('file', { boardID: src[3], filename: src[5].replace(/\?.+$/, '') }); @@ -7754,7 +7754,7 @@ post: {}, file: {}, init: function() { - var archive, arr, boardID, data, id, name, type, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3; + var archive, arr, boardID, data, id, name, type, _i, _len, _ref, _ref1, _ref2, _ref3; _ref = Conf['selectedArchives']; for (boardID in _ref) { @@ -7775,11 +7775,11 @@ } } _ref2 = Redirect.archives; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - archive = _ref2[_i]; + for (name in _ref2) { + archive = _ref2[name]; _ref3 = archive.boards; - for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { - boardID = _ref3[_j]; + for (_i = 0, _len = _ref3.length; _i < _len; _i++) { + boardID = _ref3[_i]; if (!(boardID in Redirect.thread)) { Redirect.thread[boardID] = archive; } @@ -10052,7 +10052,8 @@ var url; if (Conf['404 Redirect'] && d.title === '4chan - 404 Not Found') { - url = Redirect.to('image', { + Redirect.init(); + url = Redirect.to('file', { boardID: pathname[1], filename: pathname[3] }); diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 7807e6d74..198f51b25 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -6254,7 +6254,7 @@ ImageExpand.contract(post); src = this.src.split('/'); if (src[2] === 'images.4chan.org') { - URL = Redirect.to('image', { + URL = Redirect.to('file', { boardID: src[3], filename: src[5] }); @@ -6394,7 +6394,7 @@ post = g.posts[this.dataset.fullid]; src = this.src.split('/'); if (src[2] === 'images.4chan.org') { - URL = Redirect.to('image', { + URL = Redirect.to('file', { boardID: src[3], filename: src[5].replace(/\?.+$/, '') }); @@ -7763,7 +7763,7 @@ post: {}, file: {}, init: function() { - var archive, arr, boardID, data, id, name, type, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3; + var archive, arr, boardID, data, id, name, type, _i, _len, _ref, _ref1, _ref2, _ref3; _ref = Conf['selectedArchives']; for (boardID in _ref) { @@ -7784,11 +7784,11 @@ } } _ref2 = Redirect.archives; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - archive = _ref2[_i]; + for (name in _ref2) { + archive = _ref2[name]; _ref3 = archive.boards; - for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { - boardID = _ref3[_j]; + for (_i = 0, _len = _ref3.length; _i < _len; _i++) { + boardID = _ref3[_i]; if (!(boardID in Redirect.thread)) { Redirect.thread[boardID] = archive; } @@ -10063,7 +10063,8 @@ var url; if (Conf['404 Redirect'] && d.title === '4chan - 404 Not Found') { - url = Redirect.to('image', { + Redirect.init(); + url = Redirect.to('file', { boardID: pathname[1], filename: pathname[3] }); diff --git a/builds/crx/script.js b/builds/crx/script.js index da8850daa..5d884ada0 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -6232,7 +6232,7 @@ ImageExpand.contract(post); src = this.src.split('/'); if (src[2] === 'images.4chan.org') { - URL = Redirect.to('image', { + URL = Redirect.to('file', { boardID: src[3], filename: src[5] }); @@ -6372,7 +6372,7 @@ post = g.posts[this.dataset.fullid]; src = this.src.split('/'); if (src[2] === 'images.4chan.org') { - URL = Redirect.to('image', { + URL = Redirect.to('file', { boardID: src[3], filename: src[5].replace(/\?.+$/, '') }); @@ -7746,7 +7746,7 @@ post: {}, file: {}, init: function() { - var archive, arr, boardID, data, id, name, type, _i, _j, _len, _len1, _ref, _ref1, _ref2, _ref3; + var archive, arr, boardID, data, id, name, type, _i, _len, _ref, _ref1, _ref2, _ref3; _ref = Conf['selectedArchives']; for (boardID in _ref) { @@ -7767,11 +7767,11 @@ } } _ref2 = Redirect.archives; - for (_i = 0, _len = _ref2.length; _i < _len; _i++) { - archive = _ref2[_i]; + for (name in _ref2) { + archive = _ref2[name]; _ref3 = archive.boards; - for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { - boardID = _ref3[_j]; + for (_i = 0, _len = _ref3.length; _i < _len; _i++) { + boardID = _ref3[_i]; if (!(boardID in Redirect.thread)) { Redirect.thread[boardID] = archive; } @@ -10044,7 +10044,8 @@ var url; if (Conf['404 Redirect'] && d.title === '4chan - 404 Not Found') { - url = Redirect.to('image', { + Redirect.init(); + url = Redirect.to('file', { boardID: pathname[1], filename: pathname[3] }); diff --git a/src/Archive/Redirect.coffee b/src/Archive/Redirect.coffee index c6669d478..5d26adb35 100644 --- a/src/Archive/Redirect.coffee +++ b/src/Archive/Redirect.coffee @@ -13,7 +13,7 @@ Redirect = else archive.boards Redirect[type][boardID] = archive if arr.contains boardID - for archive in Redirect.archives + for name, archive of Redirect.archives for boardID in archive.boards unless boardID of Redirect.thread Redirect.thread[boardID] = archive diff --git a/src/General/Main.coffee b/src/General/Main.coffee index a36d1f93b..0cfd6544a 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -46,7 +46,8 @@ Main = when 'images.4chan.org' $.ready -> if Conf['404 Redirect'] and d.title is '4chan - 404 Not Found' - url = Redirect.to 'image', + Redirect.init() + url = Redirect.to 'file', boardID: pathname[1] filename: pathname[3] location.href = url if url diff --git a/src/Images/ImageExpand.coffee b/src/Images/ImageExpand.coffee index 6d0f1d7ee..a2427365a 100644 --- a/src/Images/ImageExpand.coffee +++ b/src/Images/ImageExpand.coffee @@ -137,7 +137,7 @@ ImageExpand = src = @src.split '/' if src[2] is 'images.4chan.org' - URL = Redirect.to 'image', + URL = Redirect.to 'file', boardID: src[3] filename: src[5] if URL diff --git a/src/Images/ImageHover.coffee b/src/Images/ImageHover.coffee index f4f3a82d2..082aa4625 100644 --- a/src/Images/ImageHover.coffee +++ b/src/Images/ImageHover.coffee @@ -28,7 +28,7 @@ ImageHover = src = @src.split '/' if src[2] is 'images.4chan.org' - URL = Redirect.to 'image', + URL = Redirect.to 'file', boardID: src[3] filename: src[5].replace /\?.+$/, '' if URL