Fix image archive redirection on direct links.

This commit is contained in:
Nicolas Stepien 2012-06-04 15:12:26 +02:00
parent d76c999101
commit a62ba9413d
2 changed files with 4 additions and 3 deletions

View File

@ -3614,8 +3614,8 @@
Redirect = {
init: function() {
var url;
url = location.hostname === 'images.4chan.org' ? this.image(location.href) : /^\d+$/.test(g.THREAD_ID) ? this.thread() : void 0;
var path, url;
url = location.hostname === 'images.4chan.org' ? (path = location.pathname.split('/'), this.image(path[1], path[3])) : /^\d+$/.test(g.THREAD_ID) ? this.thread() : void 0;
if (url) {
return location.href = url;
}

View File

@ -2763,7 +2763,8 @@ Redirect =
init: ->
url =
if location.hostname is 'images.4chan.org'
@image location.href
path = location.pathname.split '/'
@image path[1], path[3]
else if /^\d+$/.test g.THREAD_ID
@thread()
location.href = url if url