From dd4d979276e91fc0fc6fc13f4852c3e66c153173 Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Wed, 24 Jul 2013 22:01:48 -0700 Subject: [PATCH] Still being different for the sake of being difficult --- builds/4chan-X.user.js | 2 +- builds/crx/script.js | 2 +- src/General/lib/post.class | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 055d303ea..2e2ebc176 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -1005,7 +1005,7 @@ return; } fullID = "" + match[1] + "." + match[2]; - if (this.quotes.indexOf(fullID) === -1) { + if (!this.quotes.contains(fullID)) { return this.quotes.push(fullID); } }; diff --git a/builds/crx/script.js b/builds/crx/script.js index 16b927adf..a3911f014 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -1011,7 +1011,7 @@ return; } fullID = "" + match[1] + "." + match[2]; - if (this.quotes.indexOf(fullID) === -1) { + if (!this.quotes.contains(fullID)) { return this.quotes.push(fullID); } }; diff --git a/src/General/lib/post.class b/src/General/lib/post.class index a90cf6ce9..57fdddcf2 100644 --- a/src/General/lib/post.class +++ b/src/General/lib/post.class @@ -52,7 +52,6 @@ class Post threadID: @thread postID: @ID - @parseComment() @parseQuotes() @parseFile(that) @@ -87,7 +86,7 @@ class Post for quotelink in $$ '.quotelink', @nodes.comment @parseQuote quotelink return - + parseQuote: (quotelink) -> # Only add quotes that link to posts on an imageboard. # Don't add: @@ -107,10 +106,10 @@ class Post # Don't count capcode replies as quotes in OPs. (Admin/Mod/Dev Replies: ...) return if @isClone or !@isReply and $.hasClass quotelink.parentNode.parentNode, 'capcodeReplies' - + # ES6 Set when? fullID = "#{match[1]}.#{match[2]}" - @quotes.push fullID if @quotes.indexOf(fullID) is -1 + @quotes.push fullID unless @quotes.contains fullID parseFile: (that) -> return unless (fileEl = $ '.file', @nodes.post) and thumb = $ 'img[data-md5]', fileEl