Auto Embed.
This commit is contained in:
parent
c0a63a9e24
commit
8512efade6
@ -69,6 +69,7 @@
|
|||||||
'Linkification': {
|
'Linkification': {
|
||||||
'Linkify': [true, 'Convert text into links where applicable.'],
|
'Linkify': [true, 'Convert text into links where applicable.'],
|
||||||
'Embedding': [true, 'Embed supported services.'],
|
'Embedding': [true, 'Embed supported services.'],
|
||||||
|
'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']
|
'Link Title': [true, 'Replace the link of a supported site with its actual title. Currently Supported: YouTube, Vimeo, SoundCloud']
|
||||||
},
|
},
|
||||||
'Filtering': {
|
'Filtering': {
|
||||||
@ -11070,7 +11071,7 @@
|
|||||||
regString: /(\b([a-z]+:\/\/|[a-z]{3,}\.[-a-z0-9]+\.[a-z]+|[-a-z0-9]+\.[a-z]|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-z]{3,}:[a-z0-9?]|[a-z0-9._%+-:]+@[a-z0-9.-]+\.[a-z0-9])[^\s'"]+)/gi,
|
regString: /(\b([a-z]+:\/\/|[a-z]{3,}\.[-a-z0-9]+\.[a-z]+|[-a-z0-9]+\.[a-z]|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-z]{3,}:[a-z0-9?]|[a-z0-9._%+-:]+@[a-z0-9.-]+\.[a-z0-9])[^\s'"]+)/gi,
|
||||||
cypher: $.el('div'),
|
cypher: $.el('div'),
|
||||||
node: function() {
|
node: function() {
|
||||||
var a, child, cypher, cypherText, data, embedder, i, index, len, link, links, lookahead, name, next, node, nodes, snapshot, spoiler, text, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2;
|
var a, child, cypher, cypherText, data, embed, embedder, embeds, i, index, len, link, links, lookahead, name, next, node, nodes, snapshot, spoiler, text, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2;
|
||||||
|
|
||||||
if (this.isClone && Conf['Embedding']) {
|
if (this.isClone && Conf['Embedding']) {
|
||||||
_ref = $$('.embedder', this.nodes.comment);
|
_ref = $$('.embedder', this.nodes.comment);
|
||||||
@ -11146,6 +11147,13 @@
|
|||||||
}
|
}
|
||||||
$.replace(node, nodes);
|
$.replace(node, nodes);
|
||||||
}
|
}
|
||||||
|
if (Conf['Auto-embed']) {
|
||||||
|
embeds = $$('.embedder', this.nodes.comment);
|
||||||
|
for (_m = 0, _len4 = embeds.length; _m < _len4; _m++) {
|
||||||
|
embed = embeds[_m];
|
||||||
|
embed.click();
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
toggle: function() {
|
toggle: function() {
|
||||||
var el, embed, items, style, type, url;
|
var el, embed, items, style, type, url;
|
||||||
@ -11170,7 +11178,7 @@
|
|||||||
'embedHeight': Config['embedHeight']
|
'embedHeight': Config['embedHeight']
|
||||||
};
|
};
|
||||||
$.get(items, function(items) {
|
$.get(items, function(items) {
|
||||||
return el.style.cssText = "border: 0; width: " + item[0] + "px; height: " + item[1] + "px";
|
return el.style.cssText = "border: 0; width: " + items['embedWidth'] + "px; height: " + items['embedHeight'] + "px";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.textContent = '(unembed)';
|
this.textContent = '(unembed)';
|
||||||
@ -11272,7 +11280,7 @@
|
|||||||
if (!Conf['Embedding']) {
|
if (!Conf['Embedding']) {
|
||||||
return [a];
|
return [a];
|
||||||
}
|
}
|
||||||
titles = [];
|
titles = {};
|
||||||
callbacks = function() {
|
callbacks = function() {
|
||||||
var title;
|
var title;
|
||||||
|
|
||||||
|
|||||||
@ -69,6 +69,7 @@
|
|||||||
'Linkification': {
|
'Linkification': {
|
||||||
'Linkify': [true, 'Convert text into links where applicable.'],
|
'Linkify': [true, 'Convert text into links where applicable.'],
|
||||||
'Embedding': [true, 'Embed supported services.'],
|
'Embedding': [true, 'Embed supported services.'],
|
||||||
|
'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']
|
'Link Title': [true, 'Replace the link of a supported site with its actual title. Currently Supported: YouTube, Vimeo, SoundCloud']
|
||||||
},
|
},
|
||||||
'Filtering': {
|
'Filtering': {
|
||||||
@ -11061,7 +11062,7 @@
|
|||||||
regString: /(\b([a-z]+:\/\/|[a-z]{3,}\.[-a-z0-9]+\.[a-z]+|[-a-z0-9]+\.[a-z]|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-z]{3,}:[a-z0-9?]|[a-z0-9._%+-:]+@[a-z0-9.-]+\.[a-z0-9])[^\s'"]+)/gi,
|
regString: /(\b([a-z]+:\/\/|[a-z]{3,}\.[-a-z0-9]+\.[a-z]+|[-a-z0-9]+\.[a-z]|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-z]{3,}:[a-z0-9?]|[a-z0-9._%+-:]+@[a-z0-9.-]+\.[a-z0-9])[^\s'"]+)/gi,
|
||||||
cypher: $.el('div'),
|
cypher: $.el('div'),
|
||||||
node: function() {
|
node: function() {
|
||||||
var a, child, cypher, cypherText, data, embedder, i, index, len, link, links, lookahead, name, next, node, nodes, snapshot, spoiler, text, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2;
|
var a, child, cypher, cypherText, data, embed, embedder, embeds, i, index, len, link, links, lookahead, name, next, node, nodes, snapshot, spoiler, text, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2;
|
||||||
|
|
||||||
if (this.isClone && Conf['Embedding']) {
|
if (this.isClone && Conf['Embedding']) {
|
||||||
_ref = $$('.embedder', this.nodes.comment);
|
_ref = $$('.embedder', this.nodes.comment);
|
||||||
@ -11137,6 +11138,13 @@
|
|||||||
}
|
}
|
||||||
$.replace(node, nodes);
|
$.replace(node, nodes);
|
||||||
}
|
}
|
||||||
|
if (Conf['Auto-embed']) {
|
||||||
|
embeds = $$('.embedder', this.nodes.comment);
|
||||||
|
for (_m = 0, _len4 = embeds.length; _m < _len4; _m++) {
|
||||||
|
embed = embeds[_m];
|
||||||
|
embed.click();
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
toggle: function() {
|
toggle: function() {
|
||||||
var el, embed, items, style, type, url;
|
var el, embed, items, style, type, url;
|
||||||
@ -11161,7 +11169,7 @@
|
|||||||
'embedHeight': Config['embedHeight']
|
'embedHeight': Config['embedHeight']
|
||||||
};
|
};
|
||||||
$.get(items, function(items) {
|
$.get(items, function(items) {
|
||||||
return el.style.cssText = "border: 0; width: " + item[0] + "px; height: " + item[1] + "px";
|
return el.style.cssText = "border: 0; width: " + items['embedWidth'] + "px; height: " + items['embedHeight'] + "px";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.textContent = '(unembed)';
|
this.textContent = '(unembed)';
|
||||||
@ -11263,7 +11271,7 @@
|
|||||||
if (!Conf['Embedding']) {
|
if (!Conf['Embedding']) {
|
||||||
return [a];
|
return [a];
|
||||||
}
|
}
|
||||||
titles = [];
|
titles = {};
|
||||||
callbacks = function() {
|
callbacks = function() {
|
||||||
var title;
|
var title;
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
BIN
builds/crx.crx
BIN
builds/crx.crx
Binary file not shown.
@ -48,6 +48,7 @@
|
|||||||
'Linkification': {
|
'Linkification': {
|
||||||
'Linkify': [true, 'Convert text into links where applicable.'],
|
'Linkify': [true, 'Convert text into links where applicable.'],
|
||||||
'Embedding': [true, 'Embed supported services.'],
|
'Embedding': [true, 'Embed supported services.'],
|
||||||
|
'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']
|
'Link Title': [true, 'Replace the link of a supported site with its actual title. Currently Supported: YouTube, Vimeo, SoundCloud']
|
||||||
},
|
},
|
||||||
'Filtering': {
|
'Filtering': {
|
||||||
@ -11011,7 +11012,7 @@
|
|||||||
regString: /(\b([a-z]+:\/\/|[a-z]{3,}\.[-a-z0-9]+\.[a-z]+|[-a-z0-9]+\.[a-z]|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-z]{3,}:[a-z0-9?]|[a-z0-9._%+-:]+@[a-z0-9.-]+\.[a-z0-9])[^\s'"]+)/gi,
|
regString: /(\b([a-z]+:\/\/|[a-z]{3,}\.[-a-z0-9]+\.[a-z]+|[-a-z0-9]+\.[a-z]|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[a-z]{3,}:[a-z0-9?]|[a-z0-9._%+-:]+@[a-z0-9.-]+\.[a-z0-9])[^\s'"]+)/gi,
|
||||||
cypher: $.el('div'),
|
cypher: $.el('div'),
|
||||||
node: function() {
|
node: function() {
|
||||||
var a, child, cypher, cypherText, data, embedder, i, index, len, link, links, lookahead, name, next, node, nodes, snapshot, spoiler, text, _i, _j, _k, _l, _len, _len1, _len2, _len3, _ref, _ref1, _ref2;
|
var a, child, cypher, cypherText, data, embed, embedder, embeds, i, index, len, link, links, lookahead, name, next, node, nodes, snapshot, spoiler, text, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _m, _ref, _ref1, _ref2;
|
||||||
|
|
||||||
if (this.isClone && Conf['Embedding']) {
|
if (this.isClone && Conf['Embedding']) {
|
||||||
_ref = $$('.embedder', this.nodes.comment);
|
_ref = $$('.embedder', this.nodes.comment);
|
||||||
@ -11087,6 +11088,13 @@
|
|||||||
}
|
}
|
||||||
$.replace(node, nodes);
|
$.replace(node, nodes);
|
||||||
}
|
}
|
||||||
|
if (Conf['Auto-embed']) {
|
||||||
|
embeds = $$('.embedder', this.nodes.comment);
|
||||||
|
for (_m = 0, _len4 = embeds.length; _m < _len4; _m++) {
|
||||||
|
embed = embeds[_m];
|
||||||
|
embed.click();
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
toggle: function() {
|
toggle: function() {
|
||||||
var el, embed, items, style, type, url;
|
var el, embed, items, style, type, url;
|
||||||
@ -11111,7 +11119,7 @@
|
|||||||
'embedHeight': Config['embedHeight']
|
'embedHeight': Config['embedHeight']
|
||||||
};
|
};
|
||||||
$.get(items, function(items) {
|
$.get(items, function(items) {
|
||||||
return el.style.cssText = "border: 0; width: " + item[0] + "px; height: " + item[1] + "px";
|
return el.style.cssText = "border: 0; width: " + items['embedWidth'] + "px; height: " + items['embedHeight'] + "px";
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.textContent = '(unembed)';
|
this.textContent = '(unembed)';
|
||||||
@ -11213,7 +11221,7 @@
|
|||||||
if (!Conf['Embedding']) {
|
if (!Conf['Embedding']) {
|
||||||
return [a];
|
return [a];
|
||||||
}
|
}
|
||||||
titles = [];
|
titles = {};
|
||||||
callbacks = function() {
|
callbacks = function() {
|
||||||
var title;
|
var title;
|
||||||
|
|
||||||
|
|||||||
@ -71,6 +71,10 @@ Config =
|
|||||||
true
|
true
|
||||||
'Embed supported services.'
|
'Embed supported services.'
|
||||||
]
|
]
|
||||||
|
'Auto-embed': [
|
||||||
|
false
|
||||||
|
'Auto-embed Linkify Embeds.'
|
||||||
|
]
|
||||||
'Link Title': [
|
'Link Title': [
|
||||||
true
|
true
|
||||||
'Replace the link of a supported site with its actual title. Currently Supported: YouTube, Vimeo, SoundCloud'
|
'Replace the link of a supported site with its actual title. Currently Supported: YouTube, Vimeo, SoundCloud'
|
||||||
|
|||||||
@ -4037,6 +4037,11 @@ Linkify =
|
|||||||
$.add nodes, child
|
$.add nodes, child
|
||||||
|
|
||||||
$.replace node, nodes
|
$.replace node, nodes
|
||||||
|
|
||||||
|
if Conf['Auto-embed']
|
||||||
|
embeds = $$ '.embedder', @nodes.comment
|
||||||
|
for embed in embeds
|
||||||
|
embed.click()
|
||||||
return
|
return
|
||||||
|
|
||||||
toggle: ->
|
toggle: ->
|
||||||
@ -4068,7 +4073,7 @@ Linkify =
|
|||||||
'embedWidth': Config['embedWidth']
|
'embedWidth': Config['embedWidth']
|
||||||
'embedHeight': Config['embedHeight']
|
'embedHeight': Config['embedHeight']
|
||||||
$.get items, (items) ->
|
$.get items, (items) ->
|
||||||
el.style.cssText = "border: 0; width: #{item[0]}px; height: #{item[1]}px"
|
el.style.cssText = "border: 0; width: #{items['embedWidth']}px; height: #{items['embedHeight']}px"
|
||||||
|
|
||||||
@textContent = '(unembed)'
|
@textContent = '(unembed)'
|
||||||
|
|
||||||
@ -4136,7 +4141,7 @@ Linkify =
|
|||||||
|
|
||||||
embedder: (a) ->
|
embedder: (a) ->
|
||||||
return [a] unless Conf['Embedding']
|
return [a] unless Conf['Embedding']
|
||||||
titles = []
|
titles = {}
|
||||||
|
|
||||||
callbacks = ->
|
callbacks = ->
|
||||||
a.textContent = switch @status
|
a.textContent = switch @status
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user