Fix redirection loop. #932

This commit is contained in:
Nicolas Stepien 2013-03-05 23:34:02 +01:00
parent cc842807c8
commit a45a9fe641
2 changed files with 12 additions and 10 deletions

View File

@ -7417,20 +7417,21 @@
}
},
initReady: function() {
var board, boardChild, errors, posts, thread, threadChild, threads, _i, _j, _len, _len1, _ref, _ref1;
if (!$.hasClass(doc, 'fourchan-x')) {
Main.initStyle();
}
var board, boardChild, errors, href, posts, thread, threadChild, threads, _i, _j, _len, _len1, _ref, _ref1;
if (d.title === '4chan - 404 Not Found') {
if (Conf['404 Redirect'] && g.VIEW === 'thread') {
location.href = Redirect.to({
href = Redirect.to({
board: g.BOARD,
threadID: g.THREAD,
postID: location.hash
});
location.href = href || ("/" + g.BOARD + "/");
}
return;
}
if (!$.hasClass(doc, 'fourchan-x')) {
Main.initStyle();
}
if (board = $('.board')) {
threads = [];
posts = [];

View File

@ -397,18 +397,19 @@ Main =
$.on mainStyleSheet, 'DOMAttrModified', setStyle
initReady: ->
unless $.hasClass doc, 'fourchan-x'
# Something might have gone wrong!
Main.initStyle()
if d.title is '4chan - 404 Not Found'
if Conf['404 Redirect'] and g.VIEW is 'thread'
location.href = Redirect.to
href = Redirect.to
board: g.BOARD
threadID: g.THREAD
postID: location.hash
location.href = href or "/#{g.BOARD}/"
return
unless $.hasClass doc, 'fourchan-x'
# Something might have gone wrong!
Main.initStyle()
if board = $ '.board'
threads = []
posts = []