diff --git a/4chan_x.user.js b/4chan_x.user.js index c34ae9210..7f26cc4f9 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3425,7 +3425,7 @@ return; } status = req.status; - if (status !== 200) { + if (status !== 200 && status !== 304) { if (url = Redirect.post(board, postID)) { $.cache(url, function() { return Get.archivedPost(this, board, postID, root, context); @@ -4788,9 +4788,10 @@ return post.nodes.comment = post.nodes.shortComment; }, parse: function(req, a, post) { - var clone, comment, href, postObj, posts, quote, spoilerRange, _i, _j, _len, _len1, _ref; - if (req.status !== 200) { - a.textContent = "Error " + req.statusText + " (" + req.status + ")"; + var clone, comment, href, postObj, posts, quote, spoilerRange, status, _i, _j, _len, _len1, _ref; + status = req.status; + if (status !== 200 && status !== 304) { + a.textContent = "Error " + req.statusText + " (" + status + ")"; return; } posts = JSON.parse(req.response).posts; @@ -4933,12 +4934,13 @@ } }, 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] === '+') { return; } - if (req.status !== 200) { - a.textContent = "Error " + req.statusText + " (" + req.status + ")"; + status = req.status; + if (status !== 200 && status !== 304) { + a.textContent = "Error " + req.statusText + " (" + status + ")"; $.off(a, 'click', ExpandThread.cb.toggle); return; } diff --git a/package.json b/package.json index 5f3ff68c4..9e92ac205 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "grunt": "~0.4.0", "grunt-bump": "~0.0.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-watch": "~0.3.0", "grunt-exec": "~0.4.0" diff --git a/src/features.coffee b/src/features.coffee index 183118492..b801a9476 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -2138,7 +2138,7 @@ Get = return {status} = req - if status isnt 200 + if status not in [200, 304] # The thread can die by the time we check a quote. if url = Redirect.post board, postID $.cache url, -> @@ -3180,8 +3180,9 @@ ExpandComment = $.replace post.nodes.longComment, post.nodes.shortComment post.nodes.comment = post.nodes.shortComment parse: (req, a, post) -> - if req.status isnt 200 - a.textContent = "Error #{req.statusText} (#{req.status})" + {status} = req + if status not in [200, 304] + a.textContent = "Error #{req.statusText} (#{status})" return posts = JSON.parse(req.response).posts @@ -3279,9 +3280,9 @@ ExpandThread = parse: (req, thread, a) -> return if a.textContent[0] is '+' - - if req.status isnt 200 - a.textContent = "Error #{req.statusText} (#{req.status})" + {status} = req + if status not in [200, 304] + a.textContent = "Error #{req.statusText} (#{status})" $.off a, 'click', ExpandThread.cb.toggle return