diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index bbddd4f10..110c6975b 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -8815,7 +8815,7 @@ IDColor = { init: function() { - if (!Conf['Color User IDs']) { + if (g.VIEW === 'catalog' || !Conf['Color user IDs']) { return; } return Post.prototype.callbacks.push({ @@ -8826,9 +8826,11 @@ node: function() { var str, uid; - str = this.info.uniqueID; + if (this.isClone || !(str = this.info.uniqueID)) { + return; + } uid = $('.hand', this.nodes.uniqueID); - if (!(str && uid && uid.nodeName === 'SPAN')) { + if (!(uid && uid.nodeName === 'SPAN')) { return; } return uid.style.cssText = IDColor.css(IDColor.ids[str] || IDColor.compute(str)); @@ -8837,7 +8839,7 @@ compute: function(str) { var hash, rgb; - hash = this.hash(str); + hash = IDColor.hash(str); rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF]; rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125; this.ids[str] = rgb; diff --git a/builds/crx/script.js b/builds/crx/script.js index 1f5f1120d..b198cb92b 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -8802,7 +8802,7 @@ IDColor = { init: function() { - if (!Conf['Color User IDs']) { + if (g.VIEW === 'catalog' || !Conf['Color user IDs']) { return; } return Post.prototype.callbacks.push({ @@ -8813,9 +8813,11 @@ node: function() { var str, uid; - str = this.info.uniqueID; + if (this.isClone || !(str = this.info.uniqueID)) { + return; + } uid = $('.hand', this.nodes.uniqueID); - if (!(str && uid && uid.nodeName === 'SPAN')) { + if (!(uid && uid.nodeName === 'SPAN')) { return; } return uid.style.cssText = IDColor.css(IDColor.ids[str] || IDColor.compute(str)); @@ -8824,7 +8826,7 @@ compute: function(str) { var hash, rgb; - hash = this.hash(str); + hash = IDColor.hash(str); rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF]; rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125; this.ids[str] = rgb; diff --git a/src/Miscellaneous/ColorUserIDs.coffee b/src/Miscellaneous/ColorUserIDs.coffee index a0b442a17..754dd5add 100644 --- a/src/Miscellaneous/ColorUserIDs.coffee +++ b/src/Miscellaneous/ColorUserIDs.coffee @@ -1,21 +1,21 @@ IDColor = init: -> - return unless Conf['Color User IDs'] + return if g.VIEW is 'catalog' or !Conf['Color user IDs'] Post::callbacks.push name: 'Color User IDs' cb: @node node: -> - str = @info.uniqueID + return if @isClone or not str = @info.uniqueID uid = $ '.hand', @nodes.uniqueID - return unless str and uid and uid.nodeName is 'SPAN' + return unless uid and uid.nodeName is 'SPAN' uid.style.cssText = IDColor.css IDColor.ids[str] or IDColor.compute str ids: {} compute: (str) -> - hash = @hash str + hash = IDColor.hash str rgb = [ (hash >> 24) & 0xFF