From fabd8873175f7ffd84f4516c98ca0568a99f6494 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 1 May 2012 15:52:28 +0200 Subject: [PATCH] Add a span in the reply hider. --- 4chan_x.user.js | 7 ++++--- script.coffee | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index d0aeb4da8..d31cb09ad 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -931,8 +931,8 @@ return; } button = post.el.previousElementSibling; - button.innerHTML = '[ - ]'; $.addClass(button, 'hide_reply_button'); + button.innerHTML = '[ - ]'; $.on(button.firstChild, 'click', ReplyHiding.toggle); if (post.id in g.hiddenReplies) { return ReplyHiding.hide(post.root.firstElementChild); @@ -969,7 +969,8 @@ button.hidden = true; return; } - return button.firstChild.textContent = "[ + ] " + ($('.nameBlock', button.nextElementSibling).textContent); + button.firstChild.firstChild.textContent = '[ + ]'; + return $.add(button.firstChild, $.tn(" " + ($('.nameBlock', button.nextElementSibling).textContent))); }, show: function(button) { $.removeClass(button, 'hidden_reply'); @@ -977,7 +978,7 @@ button.hidden = false; return; } - return button.firstChild.textContent = '[ - ]'; + return button.firstChild.innerHTML = '[ - ]'; } }; diff --git a/script.coffee b/script.coffee index 0ae63ce9f..7de768fdc 100644 --- a/script.coffee +++ b/script.coffee @@ -735,8 +735,8 @@ ReplyHiding = node: (post) -> return if post.isInlined or /\bop\b/.test post.class button = post.el.previousElementSibling - button.innerHTML = '[ - ]' $.addClass button, 'hide_reply_button' + button.innerHTML = '[ - ]' $.on button.firstChild, 'click', ReplyHiding.toggle if post.id of g.hiddenReplies @@ -766,7 +766,8 @@ ReplyHiding = button.hidden = true return - button.firstChild.textContent = "[ + ] #{$('.nameBlock', button.nextElementSibling).textContent}" + button.firstChild.firstChild.textContent = '[ + ]' + $.add button.firstChild, $.tn " #{$('.nameBlock', button.nextElementSibling).textContent}" show: (button) -> $.removeClass button, 'hidden_reply' @@ -775,7 +776,7 @@ ReplyHiding = button.hidden = false return - button.firstChild.textContent = '[ - ]' + button.firstChild.innerHTML = '[ - ]' Keybinds = init: ->