From a1a4caa06d9d67268364fdc79f28dee5f5524855 Mon Sep 17 00:00:00 2001 From: No Face Date: Thu, 23 Feb 2012 23:20:38 +0100 Subject: [PATCH 1/4] Fix stubs if poster has unique ID. --- 4chan_x.user.js | 5 +++-- script.coffee | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 96fe9a2cf..a679ee75e 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -895,16 +895,17 @@ return $.set("hiddenReplies/" + g.BOARD + "/", g.hiddenReplies); }, hideHide: function(reply) { - var div, name, table, trip, _ref; + var div, name, table, trip, uid, _ref; table = reply.parentNode.parentNode.parentNode; if (table.hidden) return; table.hidden = true; if (conf['Show Stubs']) { name = $('.commentpostername', reply).textContent; + uid = $('.posteruid', reply).textContent; trip = ((_ref = $('.postertrip', reply)) != null ? _ref.textContent : void 0) || ''; div = $.el('div', { className: 'stub', - innerHTML: "[ + ] " + name + " " + trip + "" + innerHTML: "[ + ] " + name + " " + uid + " " + trip + "" }); $.on($('a', div), 'click', replyHiding.cb.show); return $.before(table, div); diff --git a/script.coffee b/script.coffee index 23d9f3d27..d869ff73e 100644 --- a/script.coffee +++ b/script.coffee @@ -746,11 +746,12 @@ replyHiding = if conf['Show Stubs'] name = $('.commentpostername', reply).textContent + uid = $('.posteruid', reply).textContent trip = $('.postertrip', reply)?.textContent or '' div = $.el 'div', className: 'stub' - innerHTML: "[ + ] #{name} #{trip}" + innerHTML: "[ + ] #{name} #{uid} #{trip}" $.on $('a', div), 'click', replyHiding.cb.show $.before table, div From 51f7440b042cc25a0f9b7a392baa10ebcbfc1bfb Mon Sep 17 00:00:00 2001 From: No Face Date: Thu, 23 Feb 2012 23:40:39 +0100 Subject: [PATCH 2/4] That's better. --- 4chan_x.user.js | 6 +++--- script.coffee | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index a679ee75e..2cdba2ff1 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -895,14 +895,14 @@ return $.set("hiddenReplies/" + g.BOARD + "/", g.hiddenReplies); }, hideHide: function(reply) { - var div, name, table, trip, uid, _ref; + var div, name, table, trip, uid, _ref, _ref2; table = reply.parentNode.parentNode.parentNode; if (table.hidden) return; table.hidden = true; if (conf['Show Stubs']) { name = $('.commentpostername', reply).textContent; - uid = $('.posteruid', reply).textContent; - trip = ((_ref = $('.postertrip', reply)) != null ? _ref.textContent : void 0) || ''; + uid = ((_ref = $('.posteruid', reply)) != null ? _ref.textContent : void 0) || ''; + trip = ((_ref2 = $('.postertrip', reply)) != null ? _ref2.textContent : void 0) || ''; div = $.el('div', { className: 'stub', innerHTML: "[ + ] " + name + " " + uid + " " + trip + "" diff --git a/script.coffee b/script.coffee index d869ff73e..b1e3a30a0 100644 --- a/script.coffee +++ b/script.coffee @@ -746,7 +746,7 @@ replyHiding = if conf['Show Stubs'] name = $('.commentpostername', reply).textContent - uid = $('.posteruid', reply).textContent + uid = $('.posteruid', reply)?.textContent or '' trip = $('.postertrip', reply)?.textContent or '' div = $.el 'div', From 679848bda36486ef99377055dfa5dbce631a2211 Mon Sep 17 00:00:00 2001 From: No Face Date: Thu, 23 Feb 2012 23:50:31 +0100 Subject: [PATCH 3/4] Thread too. --- 4chan_x.user.js | 7 ++++--- script.coffee | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 2cdba2ff1..d04e83047 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2399,7 +2399,7 @@ return $.set("hiddenThreads/" + g.BOARD + "/", hiddenThreads); }, hideHide: function(thread) { - var a, div, name, num, span, text, trip, _ref; + var a, div, name, num, span, text, trip, uid, _ref, _ref2; if (conf['Show Stubs']) { if (/stub/.test(thread.className)) return; if (span = $('.omittedposts', thread)) { @@ -2410,9 +2410,10 @@ num += $$('table', thread).length; text = num === 1 ? "1 reply" : "" + num + " replies"; name = $('.postername', thread).textContent; - trip = ((_ref = $('.postername + .postertrip', thread)) != null ? _ref.textContent : void 0) || ''; + uid = ((_ref = $('.posteruid', thread)) != null ? _ref.textContent : void 0) || ''; + trip = ((_ref2 = $('.postername + .postertrip', thread)) != null ? _ref2.textContent : void 0) || ''; a = $.el('a', { - innerHTML: "[ + ] " + name + trip + " (" + text + ")", + innerHTML: "[ + ] " + name + uid + trip + " (" + text + ")", href: 'javascript:;' }); $.on(a, 'click', threadHiding.cb.show); diff --git a/script.coffee b/script.coffee index b1e3a30a0..441c0583a 100644 --- a/script.coffee +++ b/script.coffee @@ -1973,10 +1973,11 @@ threadHiding = num += $$('table', thread).length text = if num is 1 then "1 reply" else "#{num} replies" name = $('.postername', thread).textContent + uid = $('.posteruid', thread)?.textContent or '' trip = $('.postername + .postertrip', thread)?.textContent or '' a = $.el 'a', - innerHTML: "[ + ] #{name}#{trip} (#{text})" + innerHTML: "[ + ] #{name}#{uid}#{trip} (#{text})" href: 'javascript:;' $.on a, 'click', threadHiding.cb.show From 2792d4cbe94c01a4f3e5ae2bd044366ba5ab12d5 Mon Sep 17 00:00:00 2001 From: No Face Date: Thu, 23 Feb 2012 23:54:38 +0100 Subject: [PATCH 4/4] Update changelog. --- changelog | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog b/changelog index 3d16fc0b2..efc106bf1 100644 --- a/changelog +++ b/changelog @@ -1,6 +1,7 @@ master - noface Update imagelimit for mlp. + Fix stubs if poster has unique ID. 2.27.1 - Mayhem