From 55f817e32c10ef2690185e5985f635f7c2563c2b Mon Sep 17 00:00:00 2001 From: Jordan Bates Date: Thu, 9 May 2013 07:55:10 -0700 Subject: [PATCH] Move class adding out of node --- builds/4chan-X.js | 12 ++++++------ builds/4chan-X.user.js | 12 ++++++------ builds/crx/script.js | 12 ++++++------ src/Quotelinks/QuoteYou.coffee | 12 ++++++------ 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/builds/4chan-X.js b/builds/4chan-X.js index 7dfba200f..77cb6feec 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -4106,6 +4106,12 @@ if (g.VIEW === 'catalog' || !Conf['Mark Quotes of You'] || !Conf['Quick Reply']) { return; } + if (Conf['Highlight Own Posts']) { + $.addClass(doc, 'highlight-own'); + } + if (Conf['Highlight Posts Quoting You']) { + $.addClass(doc, 'highlight-you'); + } this.text = '\u00A0(You)'; return Post.prototype.callbacks.push({ name: 'Mark Quotes of You', @@ -4121,12 +4127,6 @@ if (this.info.yours) { $.addClass(this.nodes.root, 'yourPost'); } - if (Conf['Highlight Own Posts']) { - $.addClass(doc, 'highlight-own'); - } - if (Conf['Highlight Posts Quoting You']) { - $.addClass(doc, 'highlight-you'); - } if (!(quotes = this.quotes).length) { return; } diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 7cd8d9f9d..7da08d867 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -4102,6 +4102,12 @@ if (g.VIEW === 'catalog' || !Conf['Mark Quotes of You'] || !Conf['Quick Reply']) { return; } + if (Conf['Highlight Own Posts']) { + $.addClass(doc, 'highlight-own'); + } + if (Conf['Highlight Posts Quoting You']) { + $.addClass(doc, 'highlight-you'); + } this.text = '\u00A0(You)'; return Post.prototype.callbacks.push({ name: 'Mark Quotes of You', @@ -4117,12 +4123,6 @@ if (this.info.yours) { $.addClass(this.nodes.root, 'yourPost'); } - if (Conf['Highlight Own Posts']) { - $.addClass(doc, 'highlight-own'); - } - if (Conf['Highlight Posts Quoting You']) { - $.addClass(doc, 'highlight-you'); - } if (!(quotes = this.quotes).length) { return; } diff --git a/builds/crx/script.js b/builds/crx/script.js index 73039924d..98c916834 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -4105,6 +4105,12 @@ if (g.VIEW === 'catalog' || !Conf['Mark Quotes of You'] || !Conf['Quick Reply']) { return; } + if (Conf['Highlight Own Posts']) { + $.addClass(doc, 'highlight-own'); + } + if (Conf['Highlight Posts Quoting You']) { + $.addClass(doc, 'highlight-you'); + } this.text = '\u00A0(You)'; return Post.prototype.callbacks.push({ name: 'Mark Quotes of You', @@ -4120,12 +4126,6 @@ if (this.info.yours) { $.addClass(this.nodes.root, 'yourPost'); } - if (Conf['Highlight Own Posts']) { - $.addClass(doc, 'highlight-own'); - } - if (Conf['Highlight Posts Quoting You']) { - $.addClass(doc, 'highlight-you'); - } if (!(quotes = this.quotes).length) { return; } diff --git a/src/Quotelinks/QuoteYou.coffee b/src/Quotelinks/QuoteYou.coffee index 0570ddb03..ff37044cd 100644 --- a/src/Quotelinks/QuoteYou.coffee +++ b/src/Quotelinks/QuoteYou.coffee @@ -2,6 +2,12 @@ QuoteYou = init: -> return if g.VIEW is 'catalog' or !Conf['Mark Quotes of You'] or !Conf['Quick Reply'] + if Conf['Highlight Own Posts'] + $.addClass doc, 'highlight-own' + + if Conf['Highlight Posts Quoting You'] + $.addClass doc, 'highlight-you' + # \u00A0 is nbsp @text = '\u00A0(You)' Post::callbacks.push @@ -14,12 +20,6 @@ QuoteYou = if @info.yours $.addClass @nodes.root, 'yourPost' - if Conf['Highlight Own Posts'] - $.addClass doc, 'highlight-own' - - if Conf['Highlight Posts Quoting You'] - $.addClass doc, 'highlight-you' - # Stop there if there's no quotes in that post. return unless (quotes = @quotes).length {quotelinks} = @nodes