Implement archive redirect for 'imgboard.php?res=' URLs.

This commit is contained in:
ccd0 2015-07-18 10:25:38 -07:00
parent a694eb51ad
commit e2a55997ce

View File

@ -75,6 +75,13 @@ Main =
when 'sys.4chan.org'
Report.init()
PostSuccessful.init() if g.VIEW is 'post'
if /\/imgboard\.php$/.test(location.pathname) and (match = location.search.match /\bres=(\d+)/)
$.ready ->
if $.id('errmsg')?.textContent is 'Error: Specified thread does not exist.'
Redirect.init()
Redirect.navigate Redirect.to 'thread',
boardID: g.BOARD.ID
postID: +match[1]
return
when 'i.4cdn.org'
$.asap (-> d.readyState isnt 'loading'), ->