From 7c3fd1232c2c86eb37c3aa0bfdf37e4681a9f634 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 18 Feb 2013 01:40:44 +0100 Subject: [PATCH] I'm such a baka. --- 4chan_x.user.js | 13 +++++++------ src/config.coffee | 2 +- src/features.coffee | 9 +++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index fda9d6cfe..534650513 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -4276,7 +4276,7 @@ return post.nodes.comment = post.nodes.shortComment; }, parse: function(req, a, post) { - var clone, href, postObj, posts, quote, spoilerRange, _i, _j, _len, _len1, _ref; + var clone, comment, href, postObj, posts, quote, spoilerRange, _i, _j, _len, _len1, _ref; if (req.status !== 200) { a.textContent = "Error " + req.statusText + " (" + req.status + ")"; return; @@ -4295,7 +4295,8 @@ a.textContent = "Post No." + post + " not found."; return; } - clone = post.nodes.comment.cloneNode(false); + comment = post.nodes.comment; + clone = comment.cloneNode(false); clone.innerHTML = postObj.com; _ref = $$('.quotelink', clone); for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) { @@ -4306,6 +4307,9 @@ } quote.href = "/" + post.board + "/res/" + href; } + post.nodes.shortComment = comment; + $.replace(comment, clone); + post.nodes.comment = post.nodes.longComment = clone; post.parseComment(); post.parseQuotes(); if (Conf['Resurrect Quotes']) { @@ -4321,11 +4325,8 @@ QuoteOP.node.call(post); } if (Conf['Mark Cross-thread Quotes']) { - QuoteCT.node.call(post); + return QuoteCT.node.call(post); } - post.nodes.shortComment = post.nodes.comment; - $.replace(post.nodes.comment, clone); - return post.nodes.comment = post.nodes.longComment = clone; } }; diff --git a/src/config.coffee b/src/config.coffee index 49a571dae..0ccd265a6 100644 --- a/src/config.coffee +++ b/src/config.coffee @@ -151,7 +151,7 @@ Config = # Thread Navigation 'Next thread': ['Down', 'See next thread.'] 'Previous thread': ['Up', 'See previous thread.'] - 'Expand thread': ['Ctrl+e', 'Expand thread.'] + 'Expand thread': ['Ctrl+e', 'Expand thread.'] 'Open thread': ['o', 'Open thread in current tab.'] 'Open thread tab': ['Shift+o', 'Open thread in new tab.'] # Reply Navigation diff --git a/src/features.coffee b/src/features.coffee index 81c1e6487..226b4aa06 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -2704,12 +2704,16 @@ ExpandComment = a.textContent = "Post No.#{post} not found." return - clone = post.nodes.comment.cloneNode false + {comment} = post.nodes + clone = comment.cloneNode false clone.innerHTML = postObj.com for quote in $$ '.quotelink', clone href = quote.getAttribute 'href' continue if href[0] is '/' # Cross-board quote, or board link quote.href = "/#{post.board}/res/#{href}" # Fix pathnames + post.nodes.shortComment = comment + $.replace comment, clone + post.nodes.comment = post.nodes.longComment = clone post.parseComment() post.parseQuotes() if Conf['Resurrect Quotes'] @@ -2724,9 +2728,6 @@ ExpandComment = QuoteCT.node.call post # XXX g code # XXX sci math - post.nodes.shortComment = post.nodes.comment - $.replace post.nodes.comment, clone - post.nodes.comment = post.nodes.longComment = clone ExpandThread = init: ->