Lets stop filling syntactical fields with non-meta-data
This commit is contained in:
parent
250323d304
commit
c44014b19e
@ -4428,21 +4428,28 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
embed: function(data) {
|
embed: function(data) {
|
||||||
var embed, key, link, options, uid;
|
var embed, href, key, link, name, options, uid, value, _ref;
|
||||||
|
|
||||||
key = data[0], uid = data[1], options = data[2], link = data[3];
|
key = data[0], uid = data[1], options = data[2], link = data[3];
|
||||||
|
href = link.href;
|
||||||
embed = $.el('a', {
|
embed = $.el('a', {
|
||||||
name: uid,
|
|
||||||
option: options,
|
|
||||||
className: 'embedder',
|
className: 'embedder',
|
||||||
href: 'javascript:;',
|
href: 'javascript:;',
|
||||||
textContent: '(embed)'
|
textContent: '(embed)'
|
||||||
});
|
});
|
||||||
embed.dataset.service = key;
|
_ref = {
|
||||||
embed.dataset.originalurl = link.href;
|
key: key,
|
||||||
$.addClass(link, "" + embed.dataset.service);
|
href: href,
|
||||||
|
uid: uid,
|
||||||
|
options: options
|
||||||
|
};
|
||||||
|
for (name in _ref) {
|
||||||
|
value = _ref[name];
|
||||||
|
embed.dataset[name] = value;
|
||||||
|
}
|
||||||
|
$.addClass(link, "" + embed.dataset.key);
|
||||||
$.on(embed, 'click', Linkify.cb.toggle);
|
$.on(embed, 'click', Linkify.cb.toggle);
|
||||||
return $.after(link, [$.tn(' '), embed]);
|
$.after(link, [$.tn(' '), embed]);
|
||||||
},
|
},
|
||||||
title: function(data) {
|
title: function(data) {
|
||||||
var err, key, link, options, service, title, titles, uid;
|
var err, key, link, options, service, title, titles, uid;
|
||||||
@ -4488,23 +4495,24 @@
|
|||||||
embed: function(a) {
|
embed: function(a) {
|
||||||
var el, style, type;
|
var el, style, type;
|
||||||
|
|
||||||
el = (type = Linkify.types[a.dataset.service]).el.call(a);
|
el = (type = Linkify.types[a.dataset.key]).el.call(a);
|
||||||
el.style.cssText = (style = type.style) ? style : "border: 0; width: 640px; height: 390px";
|
el.style.cssText = (style = type.style) ? style : "border: 0; width: 640px; height: 390px";
|
||||||
a.textContent = '(unembed)';
|
a.textContent = '(unembed)';
|
||||||
return el;
|
return el;
|
||||||
},
|
},
|
||||||
unembed: function(a) {
|
unembed: function(a) {
|
||||||
var el, url;
|
var el, href;
|
||||||
|
|
||||||
|
href = a.dataset.href;
|
||||||
el = $.el('a', {
|
el = $.el('a', {
|
||||||
rel: 'nofollow noreferrer',
|
rel: 'nofollow noreferrer',
|
||||||
target: 'blank',
|
target: 'blank',
|
||||||
className: 'linkify',
|
className: 'linkify',
|
||||||
href: url = a.dataset.originalurl,
|
href: href,
|
||||||
textContent: a.dataset.title || url
|
textContent: a.dataset.title || href
|
||||||
});
|
});
|
||||||
a.textContent = '(embed)';
|
a.textContent = '(embed)';
|
||||||
$.addClass(el, "" + a.dataset.service);
|
$.addClass(el, "" + a.dataset.key);
|
||||||
return el;
|
return el;
|
||||||
},
|
},
|
||||||
title: function(data) {
|
title: function(data) {
|
||||||
@ -4538,7 +4546,7 @@
|
|||||||
return $.el('audio', {
|
return $.el('audio', {
|
||||||
controls: 'controls',
|
controls: 'controls',
|
||||||
preload: 'auto',
|
preload: 'auto',
|
||||||
src: this.name
|
src: this.dataset.uid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4548,7 +4556,7 @@
|
|||||||
var div;
|
var div;
|
||||||
|
|
||||||
return div = $.el('iframe', {
|
return div = $.el('iframe', {
|
||||||
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js"
|
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.dataset.uid + ".js"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@ -4572,7 +4580,7 @@
|
|||||||
style: 'border: 0; width: auto; height: auto;',
|
style: 'border: 0; width: auto; height: auto;',
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('div', {
|
return $.el('div', {
|
||||||
innerHTML: "<a target=_blank href='" + this.dataset.originalurl + "'><img src='" + this.dataset.originalurl + "'></a>"
|
innerHTML: "<a target=_blank href='" + this.dataset.href + "'><img src='" + this.dataset.href + "'></a>"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4580,7 +4588,7 @@
|
|||||||
regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/,
|
regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/,
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('iframe', {
|
return $.el('iframe', {
|
||||||
src: "http://paste.installgentoo.com/view/embed/" + this.name
|
src: "http://paste.installgentoo.com/view/embed/" + this.dataset.uid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4588,7 +4596,7 @@
|
|||||||
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/,
|
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/,
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('object', {
|
return $.el('object', {
|
||||||
innerHTML: "<embed src='http://www.liveleak.com/e/" + this.name + "?autostart=true' wmode='opaque' width='640' height='390' pluginspage='http://get.adobe.com/flashplayer/' type='application/x-shockwave-flash'></embed>"
|
innerHTML: "<embed src='http://www.liveleak.com/e/" + this.dataset.uid + "?autostart=true' wmode='opaque' width='640' height='390' pluginspage='http://get.adobe.com/flashplayer/' type='application/x-shockwave-flash'></embed>"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4598,7 +4606,7 @@
|
|||||||
var div;
|
var div;
|
||||||
|
|
||||||
return div = $.el('iframe', {
|
return div = $.el('iframe', {
|
||||||
src: "http://pastebin.com/embed_iframe.php?i=" + this.name
|
src: "http://pastebin.com/embed_iframe.php?i=" + this.dataset.uid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4612,7 +4620,7 @@
|
|||||||
className: "soundcloud",
|
className: "soundcloud",
|
||||||
name: "soundcloud"
|
name: "soundcloud"
|
||||||
});
|
});
|
||||||
$.ajax("//soundcloud.com/oembed?show_artwork=false&&maxwidth=500px&show_comments=false&format=json&url=https://www.soundcloud.com/" + this.name, {
|
$.ajax("//soundcloud.com/oembed?show_artwork=false&&maxwidth=500px&show_comments=false&format=json&url=https://www.soundcloud.com/" + this.dataset.uid, {
|
||||||
div: div,
|
div: div,
|
||||||
onloadend: function() {
|
onloadend: function() {
|
||||||
return this.div.innerHTML = JSON.parse(this.responseText).html;
|
return this.div.innerHTML = JSON.parse(this.responseText).html;
|
||||||
@ -4634,7 +4642,7 @@
|
|||||||
style: 'border: 0; width: 150px; height: 45px;',
|
style: 'border: 0; width: 150px; height: 45px;',
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('object', {
|
return $.el('object', {
|
||||||
innerHTML: "<embed src='http://vocaroo.com/player.swf?playMediaID=" + (this.name.replace(/^i\//, '')) + "&autoplay=0' wmode='opaque' width='150' height='45' pluginspage='http://get.adobe.com/flashplayer/' type='application/x-shockwave-flash'></embed>"
|
innerHTML: "<embed src='http://vocaroo.com/player.swf?playMediaID=" + (this.dataset.uid.replace(/^i\//, '')) + "&autoplay=0' wmode='opaque' width='150' height='45' pluginspage='http://get.adobe.com/flashplayer/' type='application/x-shockwave-flash'></embed>"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4642,7 +4650,7 @@
|
|||||||
regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/,
|
regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/,
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('iframe', {
|
return $.el('iframe', {
|
||||||
src: "//player.vimeo.com/video/" + this.name + "?wmode=opaque"
|
src: "//player.vimeo.com/video/" + this.dataset.uid + "?wmode=opaque"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@ -4659,7 +4667,7 @@
|
|||||||
style: 'border: none; width: 500px; height: 500px;',
|
style: 'border: none; width: 500px; height: 500px;',
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('iframe', {
|
return $.el('iframe', {
|
||||||
src: "https://vine.co/" + this.name + "/card"
|
src: "https://vine.co/" + this.dataset.uid + "/card"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4667,7 +4675,7 @@
|
|||||||
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/,
|
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/,
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('iframe', {
|
return $.el('iframe', {
|
||||||
src: "//www.youtube.com/embed/" + this.name + (this.option ? '#' + this.option : '') + "?wmode=opaque"
|
src: "//www.youtube.com/embed/" + this.dataset.uid + (this.dataset.option ? '#' + this.dataset.option : '') + "?wmode=opaque"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
|
|||||||
@ -4433,21 +4433,28 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
embed: function(data) {
|
embed: function(data) {
|
||||||
var embed, key, link, options, uid;
|
var embed, href, key, link, name, options, uid, value, _ref;
|
||||||
|
|
||||||
key = data[0], uid = data[1], options = data[2], link = data[3];
|
key = data[0], uid = data[1], options = data[2], link = data[3];
|
||||||
|
href = link.href;
|
||||||
embed = $.el('a', {
|
embed = $.el('a', {
|
||||||
name: uid,
|
|
||||||
option: options,
|
|
||||||
className: 'embedder',
|
className: 'embedder',
|
||||||
href: 'javascript:;',
|
href: 'javascript:;',
|
||||||
textContent: '(embed)'
|
textContent: '(embed)'
|
||||||
});
|
});
|
||||||
embed.dataset.service = key;
|
_ref = {
|
||||||
embed.dataset.originalurl = link.href;
|
key: key,
|
||||||
$.addClass(link, "" + embed.dataset.service);
|
href: href,
|
||||||
|
uid: uid,
|
||||||
|
options: options
|
||||||
|
};
|
||||||
|
for (name in _ref) {
|
||||||
|
value = _ref[name];
|
||||||
|
embed.dataset[name] = value;
|
||||||
|
}
|
||||||
|
$.addClass(link, "" + embed.dataset.key);
|
||||||
$.on(embed, 'click', Linkify.cb.toggle);
|
$.on(embed, 'click', Linkify.cb.toggle);
|
||||||
return $.after(link, [$.tn(' '), embed]);
|
$.after(link, [$.tn(' '), embed]);
|
||||||
},
|
},
|
||||||
title: function(data) {
|
title: function(data) {
|
||||||
var err, key, link, options, service, title, titles, uid;
|
var err, key, link, options, service, title, titles, uid;
|
||||||
@ -4493,23 +4500,24 @@
|
|||||||
embed: function(a) {
|
embed: function(a) {
|
||||||
var el, style, type;
|
var el, style, type;
|
||||||
|
|
||||||
el = (type = Linkify.types[a.dataset.service]).el.call(a);
|
el = (type = Linkify.types[a.dataset.key]).el.call(a);
|
||||||
el.style.cssText = (style = type.style) ? style : "border: 0; width: 640px; height: 390px";
|
el.style.cssText = (style = type.style) ? style : "border: 0; width: 640px; height: 390px";
|
||||||
a.textContent = '(unembed)';
|
a.textContent = '(unembed)';
|
||||||
return el;
|
return el;
|
||||||
},
|
},
|
||||||
unembed: function(a) {
|
unembed: function(a) {
|
||||||
var el, url;
|
var el, href;
|
||||||
|
|
||||||
|
href = a.dataset.href;
|
||||||
el = $.el('a', {
|
el = $.el('a', {
|
||||||
rel: 'nofollow noreferrer',
|
rel: 'nofollow noreferrer',
|
||||||
target: 'blank',
|
target: 'blank',
|
||||||
className: 'linkify',
|
className: 'linkify',
|
||||||
href: url = a.dataset.originalurl,
|
href: href,
|
||||||
textContent: a.dataset.title || url
|
textContent: a.dataset.title || href
|
||||||
});
|
});
|
||||||
a.textContent = '(embed)';
|
a.textContent = '(embed)';
|
||||||
$.addClass(el, "" + a.dataset.service);
|
$.addClass(el, "" + a.dataset.key);
|
||||||
return el;
|
return el;
|
||||||
},
|
},
|
||||||
title: function(data) {
|
title: function(data) {
|
||||||
@ -4543,7 +4551,7 @@
|
|||||||
return $.el('audio', {
|
return $.el('audio', {
|
||||||
controls: 'controls',
|
controls: 'controls',
|
||||||
preload: 'auto',
|
preload: 'auto',
|
||||||
src: this.name
|
src: this.dataset.uid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4553,7 +4561,7 @@
|
|||||||
var div;
|
var div;
|
||||||
|
|
||||||
return div = $.el('iframe', {
|
return div = $.el('iframe', {
|
||||||
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js"
|
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.dataset.uid + ".js"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@ -4577,7 +4585,7 @@
|
|||||||
style: 'border: 0; width: auto; height: auto;',
|
style: 'border: 0; width: auto; height: auto;',
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('div', {
|
return $.el('div', {
|
||||||
innerHTML: "<a target=_blank href='" + this.dataset.originalurl + "'><img src='" + this.dataset.originalurl + "'></a>"
|
innerHTML: "<a target=_blank href='" + this.dataset.href + "'><img src='" + this.dataset.href + "'></a>"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4585,7 +4593,7 @@
|
|||||||
regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/,
|
regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/,
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('iframe', {
|
return $.el('iframe', {
|
||||||
src: "http://paste.installgentoo.com/view/embed/" + this.name
|
src: "http://paste.installgentoo.com/view/embed/" + this.dataset.uid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4593,7 +4601,7 @@
|
|||||||
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/,
|
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/,
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('object', {
|
return $.el('object', {
|
||||||
innerHTML: "<embed src='http://www.liveleak.com/e/" + this.name + "?autostart=true' wmode='opaque' width='640' height='390' pluginspage='http://get.adobe.com/flashplayer/' type='application/x-shockwave-flash'></embed>"
|
innerHTML: "<embed src='http://www.liveleak.com/e/" + this.dataset.uid + "?autostart=true' wmode='opaque' width='640' height='390' pluginspage='http://get.adobe.com/flashplayer/' type='application/x-shockwave-flash'></embed>"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4603,7 +4611,7 @@
|
|||||||
var div;
|
var div;
|
||||||
|
|
||||||
return div = $.el('iframe', {
|
return div = $.el('iframe', {
|
||||||
src: "http://pastebin.com/embed_iframe.php?i=" + this.name
|
src: "http://pastebin.com/embed_iframe.php?i=" + this.dataset.uid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4617,7 +4625,7 @@
|
|||||||
className: "soundcloud",
|
className: "soundcloud",
|
||||||
name: "soundcloud"
|
name: "soundcloud"
|
||||||
});
|
});
|
||||||
$.ajax("//soundcloud.com/oembed?show_artwork=false&&maxwidth=500px&show_comments=false&format=json&url=https://www.soundcloud.com/" + this.name, {
|
$.ajax("//soundcloud.com/oembed?show_artwork=false&&maxwidth=500px&show_comments=false&format=json&url=https://www.soundcloud.com/" + this.dataset.uid, {
|
||||||
div: div,
|
div: div,
|
||||||
onloadend: function() {
|
onloadend: function() {
|
||||||
return this.div.innerHTML = JSON.parse(this.responseText).html;
|
return this.div.innerHTML = JSON.parse(this.responseText).html;
|
||||||
@ -4639,7 +4647,7 @@
|
|||||||
style: 'border: 0; width: 150px; height: 45px;',
|
style: 'border: 0; width: 150px; height: 45px;',
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('object', {
|
return $.el('object', {
|
||||||
innerHTML: "<embed src='http://vocaroo.com/player.swf?playMediaID=" + (this.name.replace(/^i\//, '')) + "&autoplay=0' wmode='opaque' width='150' height='45' pluginspage='http://get.adobe.com/flashplayer/' type='application/x-shockwave-flash'></embed>"
|
innerHTML: "<embed src='http://vocaroo.com/player.swf?playMediaID=" + (this.dataset.uid.replace(/^i\//, '')) + "&autoplay=0' wmode='opaque' width='150' height='45' pluginspage='http://get.adobe.com/flashplayer/' type='application/x-shockwave-flash'></embed>"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4647,7 +4655,7 @@
|
|||||||
regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/,
|
regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/,
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('iframe', {
|
return $.el('iframe', {
|
||||||
src: "//player.vimeo.com/video/" + this.name + "?wmode=opaque"
|
src: "//player.vimeo.com/video/" + this.dataset.uid + "?wmode=opaque"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@ -4664,7 +4672,7 @@
|
|||||||
style: 'border: none; width: 500px; height: 500px;',
|
style: 'border: none; width: 500px; height: 500px;',
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('iframe', {
|
return $.el('iframe', {
|
||||||
src: "https://vine.co/" + this.name + "/card"
|
src: "https://vine.co/" + this.dataset.uid + "/card"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -4672,7 +4680,7 @@
|
|||||||
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/,
|
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/,
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('iframe', {
|
return $.el('iframe', {
|
||||||
src: "//www.youtube.com/embed/" + this.name + (this.option ? '#' + this.option : '') + "?wmode=opaque"
|
src: "//www.youtube.com/embed/" + this.dataset.uid + (this.dataset.option ? '#' + this.dataset.option : '') + "?wmode=opaque"
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
|
|||||||
@ -137,20 +137,20 @@ Linkify =
|
|||||||
|
|
||||||
embed: (data) ->
|
embed: (data) ->
|
||||||
[key, uid, options, link] = data
|
[key, uid, options, link] = data
|
||||||
|
href = link.href
|
||||||
embed = $.el 'a',
|
embed = $.el 'a',
|
||||||
name: uid
|
|
||||||
option: options
|
|
||||||
className: 'embedder'
|
className: 'embedder'
|
||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
textContent: '(embed)'
|
textContent: '(embed)'
|
||||||
|
|
||||||
embed.dataset.service = key
|
for name, value of {key, href, uid, options}
|
||||||
embed.dataset.originalurl = link.href
|
embed.dataset[name] = value
|
||||||
|
|
||||||
$.addClass link, "#{embed.dataset.service}"
|
$.addClass link, "#{embed.dataset.key}"
|
||||||
|
|
||||||
$.on embed, 'click', Linkify.cb.toggle
|
$.on embed, 'click', Linkify.cb.toggle
|
||||||
$.after link, [$.tn(' '), embed]
|
$.after link, [$.tn(' '), embed]
|
||||||
|
return
|
||||||
|
|
||||||
title: (data) ->
|
title: (data) ->
|
||||||
[key, uid, options, link] = data
|
[key, uid, options, link] = data
|
||||||
@ -190,7 +190,7 @@ Linkify =
|
|||||||
|
|
||||||
embed: (a) ->
|
embed: (a) ->
|
||||||
# We create an element to embed
|
# We create an element to embed
|
||||||
el = (type = Linkify.types[a.dataset.service]).el.call a
|
el = (type = Linkify.types[a.dataset.key]).el.call a
|
||||||
|
|
||||||
# Set style values.
|
# Set style values.
|
||||||
el.style.cssText = if style = type.style
|
el.style.cssText = if style = type.style
|
||||||
@ -204,15 +204,16 @@ Linkify =
|
|||||||
|
|
||||||
unembed: (a) ->
|
unembed: (a) ->
|
||||||
# Recreate the original link.
|
# Recreate the original link.
|
||||||
|
{href} = a.dataset
|
||||||
el = $.el 'a',
|
el = $.el 'a',
|
||||||
rel: 'nofollow noreferrer'
|
rel: 'nofollow noreferrer'
|
||||||
target: 'blank'
|
target: 'blank'
|
||||||
className: 'linkify'
|
className: 'linkify'
|
||||||
href: url = a.dataset.originalurl
|
href: href
|
||||||
textContent: a.dataset.title or url
|
textContent: a.dataset.title or href
|
||||||
|
|
||||||
a.textContent = '(embed)'
|
a.textContent = '(embed)'
|
||||||
$.addClass el, "#{a.dataset.service}"
|
$.addClass el, "#{a.dataset.key}"
|
||||||
|
|
||||||
return el
|
return el
|
||||||
|
|
||||||
@ -239,14 +240,14 @@ Linkify =
|
|||||||
$.el 'audio',
|
$.el 'audio',
|
||||||
controls: 'controls'
|
controls: 'controls'
|
||||||
preload: 'auto'
|
preload: 'auto'
|
||||||
src: @name
|
src: @dataset.uid
|
||||||
|
|
||||||
gist:
|
gist:
|
||||||
regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/
|
regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/
|
||||||
el: ->
|
el: ->
|
||||||
div = $.el 'iframe',
|
div = $.el 'iframe',
|
||||||
# Github doesn't allow embedding straight from the site, so we use an external site to bypass that.
|
# Github doesn't allow embedding straight from the site, so we use an external site to bypass that.
|
||||||
src: "http://www.purplegene.com/script?url=https://gist.github.com/#{@name}.js"
|
src: "http://www.purplegene.com/script?url=https://gist.github.com/#{@dataset.uid}.js"
|
||||||
title:
|
title:
|
||||||
api: (uid) -> "https://api.github.com/gists/#{uid}"
|
api: (uid) -> "https://api.github.com/gists/#{uid}"
|
||||||
text: ->
|
text: ->
|
||||||
@ -258,25 +259,25 @@ Linkify =
|
|||||||
style: 'border: 0; width: auto; height: auto;'
|
style: 'border: 0; width: auto; height: auto;'
|
||||||
el: ->
|
el: ->
|
||||||
$.el 'div',
|
$.el 'div',
|
||||||
innerHTML: "<a target=_blank href='#{@dataset.originalurl}'><img src='#{@dataset.originalurl}'></a>"
|
innerHTML: "<a target=_blank href='#{@dataset.href}'><img src='#{@dataset.href}'></a>"
|
||||||
|
|
||||||
InstallGentoo:
|
InstallGentoo:
|
||||||
regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/
|
regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/
|
||||||
el: ->
|
el: ->
|
||||||
$.el 'iframe',
|
$.el 'iframe',
|
||||||
src: "http://paste.installgentoo.com/view/embed/#{@name}"
|
src: "http://paste.installgentoo.com/view/embed/#{@dataset.uid}"
|
||||||
|
|
||||||
LiveLeak:
|
LiveLeak:
|
||||||
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/
|
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/
|
||||||
el: ->
|
el: ->
|
||||||
$.el 'object',
|
$.el 'object',
|
||||||
innerHTML: "<embed src='http://www.liveleak.com/e/#{@name}?autostart=true' wmode='opaque' width='640' height='390' pluginspage='http://get.adobe.com/flashplayer/' type='application/x-shockwave-flash'></embed>"
|
innerHTML: "<embed src='http://www.liveleak.com/e/#{@dataset.uid}?autostart=true' wmode='opaque' width='640' height='390' pluginspage='http://get.adobe.com/flashplayer/' type='application/x-shockwave-flash'></embed>"
|
||||||
|
|
||||||
pastebin:
|
pastebin:
|
||||||
regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/
|
regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/
|
||||||
el: ->
|
el: ->
|
||||||
div = $.el 'iframe',
|
div = $.el 'iframe',
|
||||||
src: "http://pastebin.com/embed_iframe.php?i=#{@name}"
|
src: "http://pastebin.com/embed_iframe.php?i=#{@dataset.uid}"
|
||||||
|
|
||||||
SoundCloud:
|
SoundCloud:
|
||||||
regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/
|
regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/
|
||||||
@ -286,7 +287,7 @@ Linkify =
|
|||||||
className: "soundcloud"
|
className: "soundcloud"
|
||||||
name: "soundcloud"
|
name: "soundcloud"
|
||||||
$.ajax(
|
$.ajax(
|
||||||
"//soundcloud.com/oembed?show_artwork=false&&maxwidth=500px&show_comments=false&format=json&url=https://www.soundcloud.com/#{@name}"
|
"//soundcloud.com/oembed?show_artwork=false&&maxwidth=500px&show_comments=false&format=json&url=https://www.soundcloud.com/#{@dataset.uid}"
|
||||||
div: div
|
div: div
|
||||||
onloadend: ->
|
onloadend: ->
|
||||||
@div.innerHTML = JSON.parse(@responseText).html
|
@div.innerHTML = JSON.parse(@responseText).html
|
||||||
@ -315,13 +316,13 @@ Linkify =
|
|||||||
style: 'border: 0; width: 150px; height: 45px;'
|
style: 'border: 0; width: 150px; height: 45px;'
|
||||||
el: ->
|
el: ->
|
||||||
$.el 'object',
|
$.el 'object',
|
||||||
innerHTML: "<embed src='http://vocaroo.com/player.swf?playMediaID=#{@name.replace /^i\//, ''}&autoplay=0' wmode='opaque' width='150' height='45' pluginspage='http://get.adobe.com/flashplayer/' type='application/x-shockwave-flash'></embed>"
|
innerHTML: "<embed src='http://vocaroo.com/player.swf?playMediaID=#{@dataset.uid.replace /^i\//, ''}&autoplay=0' wmode='opaque' width='150' height='45' pluginspage='http://get.adobe.com/flashplayer/' type='application/x-shockwave-flash'></embed>"
|
||||||
|
|
||||||
Vimeo:
|
Vimeo:
|
||||||
regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/
|
regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/
|
||||||
el: ->
|
el: ->
|
||||||
$.el 'iframe',
|
$.el 'iframe',
|
||||||
src: "//player.vimeo.com/video/#{@name}?wmode=opaque"
|
src: "//player.vimeo.com/video/#{@dataset.uid}?wmode=opaque"
|
||||||
title:
|
title:
|
||||||
api: (uid) -> "https://vimeo.com/api/oembed.json?url=http://vimeo.com/#{uid}"
|
api: (uid) -> "https://vimeo.com/api/oembed.json?url=http://vimeo.com/#{uid}"
|
||||||
text: -> JSON.parse(@responseText).title
|
text: -> JSON.parse(@responseText).title
|
||||||
@ -331,13 +332,13 @@ Linkify =
|
|||||||
style: 'border: none; width: 500px; height: 500px;'
|
style: 'border: none; width: 500px; height: 500px;'
|
||||||
el: ->
|
el: ->
|
||||||
$.el 'iframe',
|
$.el 'iframe',
|
||||||
src: "https://vine.co/#{@name}/card"
|
src: "https://vine.co/#{@dataset.uid}/card"
|
||||||
|
|
||||||
YouTube:
|
YouTube:
|
||||||
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/
|
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/
|
||||||
el: ->
|
el: ->
|
||||||
$.el 'iframe',
|
$.el 'iframe',
|
||||||
src: "//www.youtube.com/embed/#{@name}#{if @option then '#' + @option else ''}?wmode=opaque"
|
src: "//www.youtube.com/embed/#{@dataset.uid}#{if @dataset.option then '#' + @dataset.option else ''}?wmode=opaque"
|
||||||
title:
|
title:
|
||||||
api: (uid) -> "https://gdata.youtube.com/feeds/api/videos/#{uid}?alt=json&fields=title/text(),yt:noembed,app:control/yt:state/@reasonCode"
|
api: (uid) -> "https://gdata.youtube.com/feeds/api/videos/#{uid}?alt=json&fields=title/text(),yt:noembed,app:control/yt:state/@reasonCode"
|
||||||
text: -> JSON.parse(@responseText).entry.title.$t
|
text: -> JSON.parse(@responseText).entry.title.$t
|
||||||
Loading…
x
Reference in New Issue
Block a user