Couple small changes
This commit is contained in:
parent
2ea8441fd4
commit
0cc7b8ee29
@ -8815,7 +8815,7 @@
|
|||||||
|
|
||||||
IDColor = {
|
IDColor = {
|
||||||
init: function() {
|
init: function() {
|
||||||
if (!Conf['Color User IDs']) {
|
if (g.VIEW === 'catalog' || !Conf['Color user IDs']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return Post.prototype.callbacks.push({
|
return Post.prototype.callbacks.push({
|
||||||
@ -8826,9 +8826,11 @@
|
|||||||
node: function() {
|
node: function() {
|
||||||
var str, uid;
|
var str, uid;
|
||||||
|
|
||||||
str = this.info.uniqueID;
|
if (this.isClone || !(str = this.info.uniqueID)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
uid = $('.hand', this.nodes.uniqueID);
|
uid = $('.hand', this.nodes.uniqueID);
|
||||||
if (!(str && uid && uid.nodeName === 'SPAN')) {
|
if (!(uid && uid.nodeName === 'SPAN')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return uid.style.cssText = IDColor.css(IDColor.ids[str] || IDColor.compute(str));
|
return uid.style.cssText = IDColor.css(IDColor.ids[str] || IDColor.compute(str));
|
||||||
@ -8837,7 +8839,7 @@
|
|||||||
compute: function(str) {
|
compute: function(str) {
|
||||||
var hash, rgb;
|
var hash, rgb;
|
||||||
|
|
||||||
hash = this.hash(str);
|
hash = IDColor.hash(str);
|
||||||
rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
|
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;
|
rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125;
|
||||||
this.ids[str] = rgb;
|
this.ids[str] = rgb;
|
||||||
|
|||||||
@ -8802,7 +8802,7 @@
|
|||||||
|
|
||||||
IDColor = {
|
IDColor = {
|
||||||
init: function() {
|
init: function() {
|
||||||
if (!Conf['Color User IDs']) {
|
if (g.VIEW === 'catalog' || !Conf['Color user IDs']) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return Post.prototype.callbacks.push({
|
return Post.prototype.callbacks.push({
|
||||||
@ -8813,9 +8813,11 @@
|
|||||||
node: function() {
|
node: function() {
|
||||||
var str, uid;
|
var str, uid;
|
||||||
|
|
||||||
str = this.info.uniqueID;
|
if (this.isClone || !(str = this.info.uniqueID)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
uid = $('.hand', this.nodes.uniqueID);
|
uid = $('.hand', this.nodes.uniqueID);
|
||||||
if (!(str && uid && uid.nodeName === 'SPAN')) {
|
if (!(uid && uid.nodeName === 'SPAN')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
return uid.style.cssText = IDColor.css(IDColor.ids[str] || IDColor.compute(str));
|
return uid.style.cssText = IDColor.css(IDColor.ids[str] || IDColor.compute(str));
|
||||||
@ -8824,7 +8826,7 @@
|
|||||||
compute: function(str) {
|
compute: function(str) {
|
||||||
var hash, rgb;
|
var hash, rgb;
|
||||||
|
|
||||||
hash = this.hash(str);
|
hash = IDColor.hash(str);
|
||||||
rgb = [(hash >> 24) & 0xFF, (hash >> 16) & 0xFF, (hash >> 8) & 0xFF];
|
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;
|
rgb[3] = ((rgb[0] * 0.299) + (rgb[1] * 0.587) + (rgb[2] * 0.114)) > 125;
|
||||||
this.ids[str] = rgb;
|
this.ids[str] = rgb;
|
||||||
|
|||||||
@ -1,21 +1,21 @@
|
|||||||
IDColor =
|
IDColor =
|
||||||
init: ->
|
init: ->
|
||||||
return unless Conf['Color User IDs']
|
return if g.VIEW is 'catalog' or !Conf['Color user IDs']
|
||||||
|
|
||||||
Post::callbacks.push
|
Post::callbacks.push
|
||||||
name: 'Color User IDs'
|
name: 'Color User IDs'
|
||||||
cb: @node
|
cb: @node
|
||||||
|
|
||||||
node: ->
|
node: ->
|
||||||
str = @info.uniqueID
|
return if @isClone or not str = @info.uniqueID
|
||||||
uid = $ '.hand', @nodes.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
|
uid.style.cssText = IDColor.css IDColor.ids[str] or IDColor.compute str
|
||||||
|
|
||||||
ids: {}
|
ids: {}
|
||||||
|
|
||||||
compute: (str) ->
|
compute: (str) ->
|
||||||
hash = @hash str
|
hash = IDColor.hash str
|
||||||
|
|
||||||
rgb = [
|
rgb = [
|
||||||
(hash >> 24) & 0xFF
|
(hash >> 24) & 0xFF
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user