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 = { Redirect = {
init: function() { init: function() {
var url; var path, url;
url = location.hostname === 'images.4chan.org' ? this.image(location.href) : /^\d+$/.test(g.THREAD_ID) ? this.thread() : void 0; 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) { if (url) {
return location.href = url; return location.href = url;
} }

View File

@ -2763,7 +2763,8 @@ Redirect =
init: -> init: ->
url = url =
if location.hostname is 'images.4chan.org' 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 else if /^\d+$/.test g.THREAD_ID
@thread() @thread()
location.href = url if url location.href = url if url