Possibly fix 304 issues as reported by milkytiptoe. #932
This commit is contained in:
parent
e0a4f20615
commit
86f5844a6b
@ -3425,7 +3425,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
status = req.status;
|
status = req.status;
|
||||||
if (status !== 200) {
|
if (status !== 200 && status !== 304) {
|
||||||
if (url = Redirect.post(board, postID)) {
|
if (url = Redirect.post(board, postID)) {
|
||||||
$.cache(url, function() {
|
$.cache(url, function() {
|
||||||
return Get.archivedPost(this, board, postID, root, context);
|
return Get.archivedPost(this, board, postID, root, context);
|
||||||
@ -4788,9 +4788,10 @@
|
|||||||
return post.nodes.comment = post.nodes.shortComment;
|
return post.nodes.comment = post.nodes.shortComment;
|
||||||
},
|
},
|
||||||
parse: function(req, a, post) {
|
parse: function(req, a, post) {
|
||||||
var clone, comment, href, postObj, posts, quote, spoilerRange, _i, _j, _len, _len1, _ref;
|
var clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _len, _len1, _ref;
|
||||||
if (req.status !== 200) {
|
status = req.status;
|
||||||
a.textContent = "Error " + req.statusText + " (" + req.status + ")";
|
if (status !== 200 && status !== 304) {
|
||||||
|
a.textContent = "Error " + req.statusText + " (" + status + ")";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
posts = JSON.parse(req.response).posts;
|
posts = JSON.parse(req.response).posts;
|
||||||
@ -4933,12 +4934,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
parse: function(req, thread, a) {
|
parse: function(req, thread, a) {
|
||||||
var link, node, nodes, post, posts, replies, reply, spoilerRange, _i, _len;
|
var link, node, nodes, post, posts, replies, reply, spoilerRange, status, _i, _len;
|
||||||
if (a.textContent[0] === '+') {
|
if (a.textContent[0] === '+') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (req.status !== 200) {
|
status = req.status;
|
||||||
a.textContent = "Error " + req.statusText + " (" + req.status + ")";
|
if (status !== 200 && status !== 304) {
|
||||||
|
a.textContent = "Error " + req.statusText + " (" + status + ")";
|
||||||
$.off(a, 'click', ExpandThread.cb.toggle);
|
$.off(a, 'click', ExpandThread.cb.toggle);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@
|
|||||||
"grunt": "~0.4.0",
|
"grunt": "~0.4.0",
|
||||||
"grunt-bump": "~0.0.0",
|
"grunt-bump": "~0.0.0",
|
||||||
"grunt-contrib-clean": "~0.4.0",
|
"grunt-contrib-clean": "~0.4.0",
|
||||||
"grunt-contrib-coffee": "~0.4.0",
|
"grunt-contrib-coffee": "~0.5.0",
|
||||||
"grunt-contrib-concat": "~0.1.0",
|
"grunt-contrib-concat": "~0.1.0",
|
||||||
"grunt-contrib-watch": "~0.3.0",
|
"grunt-contrib-watch": "~0.3.0",
|
||||||
"grunt-exec": "~0.4.0"
|
"grunt-exec": "~0.4.0"
|
||||||
|
|||||||
@ -2138,7 +2138,7 @@ Get =
|
|||||||
return
|
return
|
||||||
|
|
||||||
{status} = req
|
{status} = req
|
||||||
if status isnt 200
|
if status not in [200, 304]
|
||||||
# The thread can die by the time we check a quote.
|
# The thread can die by the time we check a quote.
|
||||||
if url = Redirect.post board, postID
|
if url = Redirect.post board, postID
|
||||||
$.cache url, ->
|
$.cache url, ->
|
||||||
@ -3180,8 +3180,9 @@ ExpandComment =
|
|||||||
$.replace post.nodes.longComment, post.nodes.shortComment
|
$.replace post.nodes.longComment, post.nodes.shortComment
|
||||||
post.nodes.comment = post.nodes.shortComment
|
post.nodes.comment = post.nodes.shortComment
|
||||||
parse: (req, a, post) ->
|
parse: (req, a, post) ->
|
||||||
if req.status isnt 200
|
{status} = req
|
||||||
a.textContent = "Error #{req.statusText} (#{req.status})"
|
if status not in [200, 304]
|
||||||
|
a.textContent = "Error #{req.statusText} (#{status})"
|
||||||
return
|
return
|
||||||
|
|
||||||
posts = JSON.parse(req.response).posts
|
posts = JSON.parse(req.response).posts
|
||||||
@ -3279,9 +3280,9 @@ ExpandThread =
|
|||||||
|
|
||||||
parse: (req, thread, a) ->
|
parse: (req, thread, a) ->
|
||||||
return if a.textContent[0] is '+'
|
return if a.textContent[0] is '+'
|
||||||
|
{status} = req
|
||||||
if req.status isnt 200
|
if status not in [200, 304]
|
||||||
a.textContent = "Error #{req.statusText} (#{req.status})"
|
a.textContent = "Error #{req.statusText} (#{status})"
|
||||||
$.off a, 'click', ExpandThread.cb.toggle
|
$.off a, 'click', ExpandThread.cb.toggle
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user