Merge branch 'v3'

Conflicts:
	LICENSE
	builds/crx/script.js
This commit is contained in:
Zixaphir 2013-08-13 15:13:13 -07:00
commit 175880a4bd
7 changed files with 80 additions and 70 deletions

View File

@ -1,5 +1,5 @@
/* /*
* appchan x - Version 2.3.2 - 2013-08-12 * appchan x - Version 2.3.2 - 2013-08-13
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE * https://github.com/zixaphir/appchan-x/blob/master/LICENSE

View File

@ -19,7 +19,7 @@
// @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAgMAAAAqbBEUAAAACVBMVEUAAGcAAABmzDNZt9VtAAAAAXRSTlMAQObYZgAAAHFJREFUKFOt0LENACEIBdBv4Qju4wgWanEj3D6OcIVMKaitYHEU/jwTCQj8W75kiVCSBvdQ5/AvfVHBin11BgdRq3ysBgfwBDRrj3MCIA+oAQaku/Q1cNctrAmyDl577tOThYt/Y1RBM4DgOHzM0HFTAyLukH/cmRnqAAAAAElFTkSuQmCC
// ==/UserScript== // ==/UserScript==
/* /*
* 4chan X - Version 1.2.25 - 2013-08-12 * 4chan X - Version 1.2.25 - 2013-08-13
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@ -142,7 +142,6 @@
}, },
'Linkification': { 'Linkification': {
'Linkify': [true, 'Convert text into links where applicable.'], 'Linkify': [true, 'Convert text into links where applicable.'],
'Allow False Positives': [false, 'Linkify everything, allowing more false positives but reducing missed links'],
'Embedding': [true, 'Embed supported services.'], 'Embedding': [true, 'Embed supported services.'],
'Auto-embed': [false, 'Auto-embed Linkify Embeds.'], 'Auto-embed': [false, 'Auto-embed Linkify Embeds.'],
'Link Title': [true, 'Replace the link of a supported site with its actual title. Currently Supported: YouTube, Vimeo, SoundCloud, and Github gists'] 'Link Title': [true, 'Replace the link of a supported site with its actual title. Currently Supported: YouTube, Vimeo, SoundCloud, and Github gists']
@ -4426,7 +4425,7 @@
if (g.VIEW === 'catalog' || !Conf['Linkify']) { if (g.VIEW === 'catalog' || !Conf['Linkify']) {
return; return;
} }
this.regString = Conf['Allow False Positives'] ? /([-a-z]+:\/\/|[a-z]{3,}\.[-a-z0-9]+\.[a-z]|[-a-z0-9]+\.[a-z]|[\d]+\.[\d]+\.[\d]+\.[\d]+\/|[a-z]{3,}:[a-z0-9?]|[^\s@]+@[a-z0-9.-]+\.[a-z0-9])/i : /(((magnet|mailto)\:|(www\.)|(news|(ht|f)tp(s?))\:\/\/){1})/i; this.regString = /(?:[a-z][-\w]+:([a-z\d%\/])|www\d{0,3}[.]|[-a-z\d.]+[.](com|net|org|jp|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi)|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i;
if (Conf['Comment Expansion']) { if (Conf['Comment Expansion']) {
ExpandComment.callbacks.push(this.node); ExpandComment.callbacks.push(this.node);
} }
@ -4458,8 +4457,8 @@
space = /[\s'"]/; space = /[\s'"]/;
snapshot = $.X('.//br|.//text()', this.nodes.comment); snapshot = $.X('.//br|.//text()', this.nodes.comment);
i = 0; i = 0;
links = [];
while (node = snapshot.snapshotItem(i++)) { while (node = snapshot.snapshotItem(i++)) {
links = [];
data = node.data; data = node.data;
if (node.parentElement.nodeName === "A" || !data) { if (node.parentElement.nodeName === "A" || !data) {
continue; continue;
@ -4475,7 +4474,7 @@
endNode = saved; endNode = saved;
length = saved.data.length; length = saved.data.length;
if (end = space.exec(saved.data)) { if (end = space.exec(saved.data)) {
length = end.index; test.lastIndex = length = end.index;
i--; i--;
break; break;
} }
@ -4487,22 +4486,23 @@
if (link = Linkify.regString.exec(text = range.toString())) { if (link = Linkify.regString.exec(text = range.toString())) {
if (lIndex = link.index) { if (lIndex = link.index) {
range.setStart(node, lIndex + index); range.setStart(node, lIndex + index);
text = text.slice(0, lIndex);
} }
links.push([range, text]); links.push([range, text]);
} }
break; break;
} else { } else {
if (link = Linkify.regString.exec(result[0])) { if (link = Linkify.regString.exec(result[0])) {
range = Linkify.makeRange(node, node, link.index, link.length); range = Linkify.makeRange(node, node, index + link.index, length + link.index);
links.push([range, link]); links.push([range, link]);
} }
} }
} }
_ref = links.reverse(); }
for (_i = 0, _len = _ref.length; _i < _len; _i++) { _ref = links.reverse();
range = _ref[_i]; for (_i = 0, _len = _ref.length; _i < _len; _i++) {
this.nodes.links.push(Linkify.makeLink(range, this)); range = _ref[_i];
} this.nodes.links.push(Linkify.makeLink(range, this));
} }
if (!(Conf['Embedding'] || Conf['Link Title'])) { if (!(Conf['Embedding'] || Conf['Link Title'])) {
return; return;
@ -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;

View File

@ -18,7 +18,7 @@
// ==/UserScript== // ==/UserScript==
/* /*
* appchan x - Version 2.3.2 - 2013-08-12 * appchan x - Version 2.3.2 - 2013-08-13
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE * https://github.com/zixaphir/appchan-x/blob/master/LICENSE
@ -143,7 +143,6 @@
}, },
'Linkification': { 'Linkification': {
'Linkify': [true, 'Convert text into links where applicable.'], 'Linkify': [true, 'Convert text into links where applicable.'],
'Allow False Positives': [false, 'Linkify everything, allowing more false positives but reducing missed links'],
'Embedding': [true, 'Embed supported services.'], 'Embedding': [true, 'Embed supported services.'],
'Auto-embed': [false, 'Auto-embed Linkify Embeds.'], 'Auto-embed': [false, 'Auto-embed Linkify Embeds.'],
'Link Title': [true, 'Replace the link of a supported site with its actual title. Currently Supported: YouTube, Vimeo, SoundCloud, and Github gists'] 'Link Title': [true, 'Replace the link of a supported site with its actual title. Currently Supported: YouTube, Vimeo, SoundCloud, and Github gists']
@ -6725,7 +6724,7 @@
if (g.VIEW === 'catalog' || !Conf['Linkify']) { if (g.VIEW === 'catalog' || !Conf['Linkify']) {
return; return;
} }
this.regString = Conf['Allow False Positives'] ? /([-a-z]+:\/\/|[a-z]{3,}\.[-a-z0-9]+\.[a-z]|[-a-z0-9]+\.[a-z]|[\d]+\.[\d]+\.[\d]+\.[\d]+\/|[a-z]{3,}:[a-z0-9?]|[^\s@]+@[a-z0-9.-]+\.[a-z0-9])/i : /(((magnet|mailto)\:|(www\.)|(news|(ht|f)tp(s?))\:\/\/){1})/i; this.regString = /(?:[a-z][-\w]+:([a-z\d%\/])|www\d{0,3}[.]|[-a-z\d.]+[.](com|net|org|jp|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi)|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i;
if (Conf['Comment Expansion']) { if (Conf['Comment Expansion']) {
ExpandComment.callbacks.push(this.node); ExpandComment.callbacks.push(this.node);
} }
@ -6757,8 +6756,8 @@
space = /[\s'"]/; space = /[\s'"]/;
snapshot = $.X('.//br|.//text()', this.nodes.comment); snapshot = $.X('.//br|.//text()', this.nodes.comment);
i = 0; i = 0;
links = [];
while (node = snapshot.snapshotItem(i++)) { while (node = snapshot.snapshotItem(i++)) {
links = [];
data = node.data; data = node.data;
if (node.parentElement.nodeName === "A" || !data) { if (node.parentElement.nodeName === "A" || !data) {
continue; continue;
@ -6774,7 +6773,7 @@
endNode = saved; endNode = saved;
length = saved.data.length; length = saved.data.length;
if (end = space.exec(saved.data)) { if (end = space.exec(saved.data)) {
length = end.index; test.lastIndex = length = end.index;
i--; i--;
break; break;
} }
@ -6786,22 +6785,23 @@
if (link = Linkify.regString.exec(text = range.toString())) { if (link = Linkify.regString.exec(text = range.toString())) {
if (lIndex = link.index) { if (lIndex = link.index) {
range.setStart(node, lIndex + index); range.setStart(node, lIndex + index);
text = text.slice(0, lIndex);
} }
links.push([range, text]); links.push([range, text]);
} }
break; break;
} else { } else {
if (link = Linkify.regString.exec(result[0])) { if (link = Linkify.regString.exec(result[0])) {
range = Linkify.makeRange(node, node, link.index, link.length); range = Linkify.makeRange(node, node, index + link.index, length + link.index);
links.push([range, link]); links.push([range, link]);
} }
} }
} }
_ref = links.reverse(); }
for (_i = 0, _len = _ref.length; _i < _len; _i++) { _ref = links.reverse();
range = _ref[_i]; for (_i = 0, _len = _ref.length; _i < _len; _i++) {
this.nodes.links.push(Linkify.makeLink(range, this)); range = _ref[_i];
} this.nodes.links.push(Linkify.makeLink(range, this));
} }
if (!(Conf['Embedding'] || Conf['Link Title'])) { if (!(Conf['Embedding'] || Conf['Link Title'])) {
return; return;
@ -12724,7 +12724,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({
@ -12735,9 +12735,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));
@ -12746,7 +12748,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;

View File

@ -1,6 +1,6 @@
// Generated by CoffeeScript // Generated by CoffeeScript
/* /*
* appchan x - Version 2.3.2 - 2013-08-12 * appchan x - Version 2.3.2 - 2013-08-13
* *
* Licensed under the MIT license. * Licensed under the MIT license.
* https://github.com/zixaphir/appchan-x/blob/master/LICENSE * https://github.com/zixaphir/appchan-x/blob/master/LICENSE
@ -126,7 +126,6 @@
}, },
'Linkification': { 'Linkification': {
'Linkify': [true, 'Convert text into links where applicable.'], 'Linkify': [true, 'Convert text into links where applicable.'],
'Allow False Positives': [false, 'Linkify everything, allowing more false positives but reducing missed links'],
'Embedding': [true, 'Embed supported services.'], 'Embedding': [true, 'Embed supported services.'],
'Auto-embed': [false, 'Auto-embed Linkify Embeds.'], 'Auto-embed': [false, 'Auto-embed Linkify Embeds.'],
'Link Title': [true, 'Replace the link of a supported site with its actual title. Currently Supported: YouTube, Vimeo, SoundCloud, and Github gists'] 'Link Title': [true, 'Replace the link of a supported site with its actual title. Currently Supported: YouTube, Vimeo, SoundCloud, and Github gists']
@ -6733,7 +6732,7 @@
if (g.VIEW === 'catalog' || !Conf['Linkify']) { if (g.VIEW === 'catalog' || !Conf['Linkify']) {
return; return;
} }
this.regString = Conf['Allow False Positives'] ? /([-a-z]+:\/\/|[a-z]{3,}\.[-a-z0-9]+\.[a-z]|[-a-z0-9]+\.[a-z]|[\d]+\.[\d]+\.[\d]+\.[\d]+\/|[a-z]{3,}:[a-z0-9?]|[^\s@]+@[a-z0-9.-]+\.[a-z0-9])/i : /(((magnet|mailto)\:|(www\.)|(news|(ht|f)tp(s?))\:\/\/){1})/i; this.regString = /(?:[a-z][-\w]+:([a-z\d%\/])|www\d{0,3}[.]|[-a-z\d.]+[.](com|net|org|jp|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi)|[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}|[-\w\d.@]+@[a-z\d.-]+\.[a-z\d])/i;
if (Conf['Comment Expansion']) { if (Conf['Comment Expansion']) {
ExpandComment.callbacks.push(this.node); ExpandComment.callbacks.push(this.node);
} }
@ -6765,8 +6764,8 @@
space = /[\s'"]/; space = /[\s'"]/;
snapshot = $.X('.//br|.//text()', this.nodes.comment); snapshot = $.X('.//br|.//text()', this.nodes.comment);
i = 0; i = 0;
links = [];
while (node = snapshot.snapshotItem(i++)) { while (node = snapshot.snapshotItem(i++)) {
links = [];
data = node.data; data = node.data;
if (node.parentElement.nodeName === "A" || !data) { if (node.parentElement.nodeName === "A" || !data) {
continue; continue;
@ -6782,7 +6781,7 @@
endNode = saved; endNode = saved;
length = saved.data.length; length = saved.data.length;
if (end = space.exec(saved.data)) { if (end = space.exec(saved.data)) {
length = end.index; test.lastIndex = length = end.index;
i--; i--;
break; break;
} }
@ -6794,22 +6793,23 @@
if (link = Linkify.regString.exec(text = range.toString())) { if (link = Linkify.regString.exec(text = range.toString())) {
if (lIndex = link.index) { if (lIndex = link.index) {
range.setStart(node, lIndex + index); range.setStart(node, lIndex + index);
text = text.slice(0, lIndex);
} }
links.push([range, text]); links.push([range, text]);
} }
break; break;
} else { } else {
if (link = Linkify.regString.exec(result[0])) { if (link = Linkify.regString.exec(result[0])) {
range = Linkify.makeRange(node, node, link.index, link.length); range = Linkify.makeRange(node, node, index + link.index, length + link.index);
links.push([range, link]); links.push([range, link]);
} }
} }
} }
_ref = links.reverse(); }
for (_i = 0, _len = _ref.length; _i < _len; _i++) { _ref = links.reverse();
range = _ref[_i]; for (_i = 0, _len = _ref.length; _i < _len; _i++) {
this.nodes.links.push(Linkify.makeLink(range, this)); range = _ref[_i];
} this.nodes.links.push(Linkify.makeLink(range, this));
} }
if (!(Conf['Embedding'] || Conf['Link Title'])) { if (!(Conf['Embedding'] || Conf['Link Title'])) {
return; return;
@ -12713,7 +12713,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({
@ -12724,9 +12724,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));
@ -12735,7 +12737,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;

View File

@ -71,10 +71,6 @@ Config =
true true
'Convert text into links where applicable.' 'Convert text into links where applicable.'
] ]
'Allow False Positives': [
false
'Linkify everything, allowing more false positives but reducing missed links'
]
'Embedding': [ 'Embedding': [
true true
'Embed supported services.' 'Embed supported services.'

View File

@ -2,22 +2,27 @@ Linkify =
init: -> init: ->
return if g.VIEW is 'catalog' or not Conf['Linkify'] return if g.VIEW is 'catalog' or not Conf['Linkify']
@regString = if Conf['Allow False Positives'] @regString =
///( ///(
[-a-z]+:// # http, magnet, ftp, etc
?:[a-z][-\w]+:(
[a-z\d%/]
)
| |
[a-z]{3,}\.[-a-z0-9]+\.[a-z] www\d{0,3}[.]
| |
[-a-z0-9]+\.[a-z] # This should account for virtually all links posted without www or http:
# If it misses any, screw it. No, I will not add canv.as
[-a-z\d.]+[.](
com|net|org|jp|uk|ru|be|tv|xxx|edu|gov|cd|es|de|se|tk|dk|io|fm|fi
)
| |
[\d]+\.[\d]+\.[\d]+\.[\d]+/ # IPv4 Addresses
[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}\.[\d]{1,3}
| |
[a-z]{3,}:[a-z0-9?] # E-mails
| [-\w\d.@]+@[a-z\d.-]+\.[a-z\d]
[^\s@]+@[a-z0-9.-]+\.[a-z0-9]
)///i )///i
else
/(((magnet|mailto)\:|(www\.)|(news|(ht|f)tp(s?))\:\/\/){1})/i
if Conf['Comment Expansion'] if Conf['Comment Expansion']
ExpandComment.callbacks.push @node ExpandComment.callbacks.push @node
@ -45,14 +50,15 @@ Linkify =
snapshot = $.X './/br|.//text()', @nodes.comment snapshot = $.X './/br|.//text()', @nodes.comment
i = 0 i = 0
links = []
while node = snapshot.snapshotItem i++ while node = snapshot.snapshotItem i++
links = []
{data} = node {data} = node
continue if node.parentElement.nodeName is "A" or not data continue if node.parentElement.nodeName is "A" or not data
while result = test.exec data while result = test.exec data
{index} = result {index} = result
endNode = node endNode = node
# End of node, not necessarily end of space-delimited string
if (length = index + result[0].length) is data.length if (length = index + result[0].length) is data.length
while (saved = snapshot.snapshotItem i++) while (saved = snapshot.snapshotItem i++)
@ -62,25 +68,27 @@ Linkify =
{length} = saved.data {length} = saved.data
if end = space.exec saved.data if end = space.exec saved.data
length = end.index # Set our snapshot and regex to start on this node at this position when the loop resumes
test.lastIndex = length = end.index
i-- i--
break break
if length is endNode.data.length then test.lastIndex = 0 test.lastIndex = 0 if length is endNode.data.length
range = Linkify.makeRange node, endNode, index, length range = Linkify.makeRange node, endNode, index, length
if link = Linkify.regString.exec text = range.toString() if link = Linkify.regString.exec text = range.toString()
if lIndex = link.index if lIndex = link.index
range.setStart node, lIndex + index range.setStart node, lIndex + index
text = text[...lIndex]
links.push [range, text] links.push [range, text]
break break
else else
if link = Linkify.regString.exec result[0] if link = Linkify.regString.exec result[0]
range = Linkify.makeRange node, node, link.index, link.length range = Linkify.makeRange node, node, index + link.index, length + link.index
links.push [range, link] links.push [range, link]
for range in links.reverse() for range in links.reverse()
@nodes.links.push Linkify.makeLink range, @ @nodes.links.push Linkify.makeLink range, @
return unless Conf['Embedding'] or Conf['Link Title'] return unless Conf['Embedding'] or Conf['Link Title']

View File

@ -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