From e4c8bd7ee626508f8952182bd02d320297114429 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Fri, 7 Mar 2014 18:57:00 -0700 Subject: [PATCH] Fix Get.threadExcerpt --- builds/4chan-X.user.js | 6 +++--- builds/crx/script.js | 6 +++--- src/General/Get.coffee | 8 +++----- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 40b15b26d..2fdd6e9ec 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -3828,9 +3828,9 @@ threadExcerpt: function(thread) { var OP, excerpt, _ref; OP = thread.OP; - excerpt = ("/" + thread.board + "/ - ") + (((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || OP.getNameBlock()); - if (excerpt.length > 73) { - excerpt = "" + excerpt.slice(0, 70) + "..."; + excerpt = ((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || OP.getNameBlock(); + if (excerpt.length > 70) { + excerpt = "" + excerpt.slice(0, 67) + "..."; } return "/" + thread.board + "/ - " + excerpt; }, diff --git a/builds/crx/script.js b/builds/crx/script.js index 0934e6236..4e829fb90 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -3887,9 +3887,9 @@ threadExcerpt: function(thread) { var OP, excerpt, _ref; OP = thread.OP; - excerpt = ("/" + thread.board + "/ - ") + (((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || OP.getNameBlock()); - if (excerpt.length > 73) { - excerpt = "" + excerpt.slice(0, 70) + "..."; + excerpt = ((_ref = OP.info.subject) != null ? _ref.trim() : void 0) || OP.info.comment.replace(/\n+/g, ' // ') || OP.getNameBlock(); + if (excerpt.length > 70) { + excerpt = "" + excerpt.slice(0, 67) + "..."; } return "/" + thread.board + "/ - " + excerpt; }, diff --git a/src/General/Get.coffee b/src/General/Get.coffee index 70932fbda..d8176a7ee 100755 --- a/src/General/Get.coffee +++ b/src/General/Get.coffee @@ -1,13 +1,11 @@ Get = threadExcerpt: (thread) -> {OP} = thread - excerpt = "/#{thread.board}/ - " + ( - OP.info.subject?.trim() or + excerpt = OP.info.subject?.trim() or OP.info.comment.replace(/\n+/g, ' // ') or OP.getNameBlock() - ) - if excerpt.length > 73 - excerpt = "#{excerpt[...70]}..." + if excerpt.length > 70 + excerpt = "#{excerpt[...67]}..." "/#{thread.board}/ - #{excerpt}" threadFromRoot: (root) -> g.threads["#{g.BOARD}.#{root.id[1..]}"]