Vine
This commit is contained in:
parent
d2eef4c4c5
commit
250323d304
@ -4532,55 +4532,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
types: {
|
types: {
|
||||||
YouTube: {
|
|
||||||
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/,
|
|
||||||
el: function() {
|
|
||||||
return $.el('iframe', {
|
|
||||||
src: "//www.youtube.com/embed/" + this.name + (this.option ? '#' + this.option : '') + "?wmode=opaque"
|
|
||||||
});
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
api: function(uid) {
|
|
||||||
return "https://gdata.youtube.com/feeds/api/videos/" + uid + "?alt=json&fields=title/text(),yt:noembed,app:control/yt:state/@reasonCode";
|
|
||||||
},
|
|
||||||
text: function() {
|
|
||||||
return JSON.parse(this.responseText).entry.title.$t;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Vocaroo: {
|
|
||||||
regExp: /.*(?:vocaroo.com\/)([^#\&\?]*).*/,
|
|
||||||
style: 'border: 0; width: 150px; height: 45px;',
|
|
||||||
el: function() {
|
|
||||||
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>"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Vimeo: {
|
|
||||||
regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/,
|
|
||||||
el: function() {
|
|
||||||
return $.el('iframe', {
|
|
||||||
src: "//player.vimeo.com/video/" + this.name + "?wmode=opaque"
|
|
||||||
});
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
api: function(uid) {
|
|
||||||
return "https://vimeo.com/api/oembed.json?url=http://vimeo.com/" + uid;
|
|
||||||
},
|
|
||||||
text: function() {
|
|
||||||
return JSON.parse(this.responseText).title;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
LiveLeak: {
|
|
||||||
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/,
|
|
||||||
el: function() {
|
|
||||||
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>"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
audio: {
|
audio: {
|
||||||
regExp: /(.*\.(mp3|ogg|wav))$/,
|
regExp: /(.*\.(mp3|ogg|wav))$/,
|
||||||
el: function() {
|
el: function() {
|
||||||
@ -4591,6 +4542,31 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
gist: {
|
||||||
|
regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/,
|
||||||
|
el: function() {
|
||||||
|
var div;
|
||||||
|
|
||||||
|
return div = $.el('iframe', {
|
||||||
|
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js"
|
||||||
|
});
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
api: function(uid) {
|
||||||
|
return "https://api.github.com/gists/" + uid;
|
||||||
|
},
|
||||||
|
text: function() {
|
||||||
|
var file, response;
|
||||||
|
|
||||||
|
response = JSON.parse(this.responseText).files;
|
||||||
|
for (file in response) {
|
||||||
|
if (response.hasOwnProperty(file)) {
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
image: {
|
image: {
|
||||||
regExp: /(http|www).*\.(gif|png|jpg|jpeg|bmp)$/,
|
regExp: /(http|www).*\.(gif|png|jpg|jpeg|bmp)$/,
|
||||||
style: 'border: 0; width: auto; height: auto;',
|
style: 'border: 0; width: auto; height: auto;',
|
||||||
@ -4600,6 +4576,32 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
InstallGentoo: {
|
||||||
|
regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/,
|
||||||
|
el: function() {
|
||||||
|
return $.el('iframe', {
|
||||||
|
src: "http://paste.installgentoo.com/view/embed/" + this.name
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
LiveLeak: {
|
||||||
|
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/,
|
||||||
|
el: function() {
|
||||||
|
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>"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pastebin: {
|
||||||
|
regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/,
|
||||||
|
el: function() {
|
||||||
|
var div;
|
||||||
|
|
||||||
|
return div = $.el('iframe', {
|
||||||
|
src: "http://pastebin.com/embed_iframe.php?i=" + this.name
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
SoundCloud: {
|
SoundCloud: {
|
||||||
regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/,
|
regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/,
|
||||||
style: 'height: auto; width: 500px; display: inline-block;',
|
style: 'height: auto; width: 500px; display: inline-block;',
|
||||||
@ -4627,48 +4629,55 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pastebin: {
|
Vocaroo: {
|
||||||
regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/,
|
regExp: /.*(?:vocaroo.com\/)([^#\&\?]*).*/,
|
||||||
|
style: 'border: 0; width: 150px; height: 45px;',
|
||||||
el: function() {
|
el: function() {
|
||||||
var div;
|
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>"
|
||||||
return div = $.el('iframe', {
|
|
||||||
src: "http://pastebin.com/embed_iframe.php?i=" + this.name
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
gist: {
|
Vimeo: {
|
||||||
regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/,
|
regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/,
|
||||||
el: function() {
|
el: function() {
|
||||||
var div;
|
return $.el('iframe', {
|
||||||
|
src: "//player.vimeo.com/video/" + this.name + "?wmode=opaque"
|
||||||
return div = $.el('iframe', {
|
|
||||||
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js"
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
api: function(uid) {
|
api: function(uid) {
|
||||||
return "https://api.github.com/gists/" + uid;
|
return "https://vimeo.com/api/oembed.json?url=http://vimeo.com/" + uid;
|
||||||
},
|
},
|
||||||
text: function() {
|
text: function() {
|
||||||
var file, response;
|
return JSON.parse(this.responseText).title;
|
||||||
|
|
||||||
response = JSON.parse(this.responseText).files;
|
|
||||||
for (file in response) {
|
|
||||||
if (response.hasOwnProperty(file)) {
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
InstallGentoo: {
|
Vine: {
|
||||||
regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/,
|
regExp: /.*(?:vine.co\/)([^#\&\?]*).*/,
|
||||||
|
style: 'border: none; width: 500px; height: 500px;',
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('iframe', {
|
return $.el('iframe', {
|
||||||
src: "http://paste.installgentoo.com/view/embed/" + this.name
|
src: "https://vine.co/" + this.name + "/card"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
YouTube: {
|
||||||
|
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/,
|
||||||
|
el: function() {
|
||||||
|
return $.el('iframe', {
|
||||||
|
src: "//www.youtube.com/embed/" + this.name + (this.option ? '#' + this.option : '') + "?wmode=opaque"
|
||||||
|
});
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
api: function(uid) {
|
||||||
|
return "https://gdata.youtube.com/feeds/api/videos/" + uid + "?alt=json&fields=title/text(),yt:noembed,app:control/yt:state/@reasonCode";
|
||||||
|
},
|
||||||
|
text: function() {
|
||||||
|
return JSON.parse(this.responseText).entry.title.$t;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -4537,55 +4537,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
types: {
|
types: {
|
||||||
YouTube: {
|
|
||||||
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/,
|
|
||||||
el: function() {
|
|
||||||
return $.el('iframe', {
|
|
||||||
src: "//www.youtube.com/embed/" + this.name + (this.option ? '#' + this.option : '') + "?wmode=opaque"
|
|
||||||
});
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
api: function(uid) {
|
|
||||||
return "https://gdata.youtube.com/feeds/api/videos/" + uid + "?alt=json&fields=title/text(),yt:noembed,app:control/yt:state/@reasonCode";
|
|
||||||
},
|
|
||||||
text: function() {
|
|
||||||
return JSON.parse(this.responseText).entry.title.$t;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Vocaroo: {
|
|
||||||
regExp: /.*(?:vocaroo.com\/)([^#\&\?]*).*/,
|
|
||||||
style: 'border: 0; width: 150px; height: 45px;',
|
|
||||||
el: function() {
|
|
||||||
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>"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Vimeo: {
|
|
||||||
regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/,
|
|
||||||
el: function() {
|
|
||||||
return $.el('iframe', {
|
|
||||||
src: "//player.vimeo.com/video/" + this.name + "?wmode=opaque"
|
|
||||||
});
|
|
||||||
},
|
|
||||||
title: {
|
|
||||||
api: function(uid) {
|
|
||||||
return "https://vimeo.com/api/oembed.json?url=http://vimeo.com/" + uid;
|
|
||||||
},
|
|
||||||
text: function() {
|
|
||||||
return JSON.parse(this.responseText).title;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
LiveLeak: {
|
|
||||||
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/,
|
|
||||||
el: function() {
|
|
||||||
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>"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
audio: {
|
audio: {
|
||||||
regExp: /(.*\.(mp3|ogg|wav))$/,
|
regExp: /(.*\.(mp3|ogg|wav))$/,
|
||||||
el: function() {
|
el: function() {
|
||||||
@ -4596,6 +4547,31 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
gist: {
|
||||||
|
regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/,
|
||||||
|
el: function() {
|
||||||
|
var div;
|
||||||
|
|
||||||
|
return div = $.el('iframe', {
|
||||||
|
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js"
|
||||||
|
});
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
api: function(uid) {
|
||||||
|
return "https://api.github.com/gists/" + uid;
|
||||||
|
},
|
||||||
|
text: function() {
|
||||||
|
var file, response;
|
||||||
|
|
||||||
|
response = JSON.parse(this.responseText).files;
|
||||||
|
for (file in response) {
|
||||||
|
if (response.hasOwnProperty(file)) {
|
||||||
|
return file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
image: {
|
image: {
|
||||||
regExp: /(http|www).*\.(gif|png|jpg|jpeg|bmp)$/,
|
regExp: /(http|www).*\.(gif|png|jpg|jpeg|bmp)$/,
|
||||||
style: 'border: 0; width: auto; height: auto;',
|
style: 'border: 0; width: auto; height: auto;',
|
||||||
@ -4605,6 +4581,32 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
InstallGentoo: {
|
||||||
|
regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/,
|
||||||
|
el: function() {
|
||||||
|
return $.el('iframe', {
|
||||||
|
src: "http://paste.installgentoo.com/view/embed/" + this.name
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
LiveLeak: {
|
||||||
|
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/,
|
||||||
|
el: function() {
|
||||||
|
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>"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
pastebin: {
|
||||||
|
regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/,
|
||||||
|
el: function() {
|
||||||
|
var div;
|
||||||
|
|
||||||
|
return div = $.el('iframe', {
|
||||||
|
src: "http://pastebin.com/embed_iframe.php?i=" + this.name
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
SoundCloud: {
|
SoundCloud: {
|
||||||
regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/,
|
regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/,
|
||||||
style: 'height: auto; width: 500px; display: inline-block;',
|
style: 'height: auto; width: 500px; display: inline-block;',
|
||||||
@ -4632,48 +4634,55 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pastebin: {
|
Vocaroo: {
|
||||||
regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/,
|
regExp: /.*(?:vocaroo.com\/)([^#\&\?]*).*/,
|
||||||
|
style: 'border: 0; width: 150px; height: 45px;',
|
||||||
el: function() {
|
el: function() {
|
||||||
var div;
|
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>"
|
||||||
return div = $.el('iframe', {
|
|
||||||
src: "http://pastebin.com/embed_iframe.php?i=" + this.name
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
gist: {
|
Vimeo: {
|
||||||
regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/,
|
regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/,
|
||||||
el: function() {
|
el: function() {
|
||||||
var div;
|
return $.el('iframe', {
|
||||||
|
src: "//player.vimeo.com/video/" + this.name + "?wmode=opaque"
|
||||||
return div = $.el('iframe', {
|
|
||||||
src: "http://www.purplegene.com/script?url=https://gist.github.com/" + this.name + ".js"
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
api: function(uid) {
|
api: function(uid) {
|
||||||
return "https://api.github.com/gists/" + uid;
|
return "https://vimeo.com/api/oembed.json?url=http://vimeo.com/" + uid;
|
||||||
},
|
},
|
||||||
text: function() {
|
text: function() {
|
||||||
var file, response;
|
return JSON.parse(this.responseText).title;
|
||||||
|
|
||||||
response = JSON.parse(this.responseText).files;
|
|
||||||
for (file in response) {
|
|
||||||
if (response.hasOwnProperty(file)) {
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
InstallGentoo: {
|
Vine: {
|
||||||
regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/,
|
regExp: /.*(?:vine.co\/)([^#\&\?]*).*/,
|
||||||
|
style: 'border: none; width: 500px; height: 500px;',
|
||||||
el: function() {
|
el: function() {
|
||||||
return $.el('iframe', {
|
return $.el('iframe', {
|
||||||
src: "http://paste.installgentoo.com/view/embed/" + this.name
|
src: "https://vine.co/" + this.name + "/card"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
YouTube: {
|
||||||
|
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/,
|
||||||
|
el: function() {
|
||||||
|
return $.el('iframe', {
|
||||||
|
src: "//www.youtube.com/embed/" + this.name + (this.option ? '#' + this.option : '') + "?wmode=opaque"
|
||||||
|
});
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
api: function(uid) {
|
||||||
|
return "https://gdata.youtube.com/feeds/api/videos/" + uid + "?alt=json&fields=title/text(),yt:noembed,app:control/yt:state/@reasonCode";
|
||||||
|
},
|
||||||
|
text: function() {
|
||||||
|
return JSON.parse(this.responseText).entry.title.$t;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -233,52 +233,51 @@ Linkify =
|
|||||||
"[#{key}] #{@status}'d"
|
"[#{key}] #{@status}'d"
|
||||||
|
|
||||||
types:
|
types:
|
||||||
YouTube:
|
|
||||||
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/
|
|
||||||
el: ->
|
|
||||||
$.el 'iframe',
|
|
||||||
src: "//www.youtube.com/embed/#{@name}#{if @option then '#' + @option else ''}?wmode=opaque"
|
|
||||||
title:
|
|
||||||
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
|
|
||||||
|
|
||||||
Vocaroo:
|
|
||||||
regExp: /.*(?:vocaroo.com\/)([^#\&\?]*).*/
|
|
||||||
style: 'border: 0; width: 150px; height: 45px;'
|
|
||||||
el: ->
|
|
||||||
$.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>"
|
|
||||||
|
|
||||||
Vimeo:
|
|
||||||
regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/
|
|
||||||
el: ->
|
|
||||||
$.el 'iframe',
|
|
||||||
src: "//player.vimeo.com/video/#{@name}?wmode=opaque"
|
|
||||||
title:
|
|
||||||
api: (uid) -> "https://vimeo.com/api/oembed.json?url=http://vimeo.com/#{uid}"
|
|
||||||
text: -> JSON.parse(@responseText).title
|
|
||||||
|
|
||||||
LiveLeak:
|
|
||||||
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/
|
|
||||||
el: ->
|
|
||||||
$.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>"
|
|
||||||
|
|
||||||
audio:
|
audio:
|
||||||
regExp: /(.*\.(mp3|ogg|wav))$/
|
regExp: /(.*\.(mp3|ogg|wav))$/
|
||||||
el: ->
|
el: ->
|
||||||
$.el 'audio',
|
$.el 'audio',
|
||||||
controls: 'controls'
|
controls: 'controls'
|
||||||
preload: 'auto'
|
preload: 'auto'
|
||||||
src: @name
|
src: @name
|
||||||
|
|
||||||
|
gist:
|
||||||
|
regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/
|
||||||
|
el: ->
|
||||||
|
div = $.el 'iframe',
|
||||||
|
# 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"
|
||||||
|
title:
|
||||||
|
api: (uid) -> "https://api.github.com/gists/#{uid}"
|
||||||
|
text: ->
|
||||||
|
response = JSON.parse(@responseText).files
|
||||||
|
return file for file of response when response.hasOwnProperty file
|
||||||
|
|
||||||
image:
|
image:
|
||||||
regExp: /(http|www).*\.(gif|png|jpg|jpeg|bmp)$/
|
regExp: /(http|www).*\.(gif|png|jpg|jpeg|bmp)$/
|
||||||
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.originalurl}'><img src='#{@dataset.originalurl}'></a>"
|
||||||
|
|
||||||
|
InstallGentoo:
|
||||||
|
regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/
|
||||||
|
el: ->
|
||||||
|
$.el 'iframe',
|
||||||
|
src: "http://paste.installgentoo.com/view/embed/#{@name}"
|
||||||
|
|
||||||
|
LiveLeak:
|
||||||
|
regExp: /.*(?:liveleak.com\/view.+i=)([0-9a-z_]+)/
|
||||||
|
el: ->
|
||||||
|
$.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>"
|
||||||
|
|
||||||
|
pastebin:
|
||||||
|
regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/
|
||||||
|
el: ->
|
||||||
|
div = $.el 'iframe',
|
||||||
|
src: "http://pastebin.com/embed_iframe.php?i=#{@name}"
|
||||||
|
|
||||||
SoundCloud:
|
SoundCloud:
|
||||||
regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/
|
regExp: /.*(?:soundcloud.com\/|snd.sc\/)([^#\&\?]*).*/
|
||||||
style: 'height: auto; width: 500px; display: inline-block;'
|
style: 'height: auto; width: 500px; display: inline-block;'
|
||||||
@ -297,26 +296,48 @@ Linkify =
|
|||||||
api: (uid) -> "//soundcloud.com/oembed?show_artwork=false&&maxwidth=500px&show_comments=false&format=json&url=https://www.soundcloud.com/#{uid}"
|
api: (uid) -> "//soundcloud.com/oembed?show_artwork=false&&maxwidth=500px&show_comments=false&format=json&url=https://www.soundcloud.com/#{uid}"
|
||||||
text: -> JSON.parse(@responseText).title
|
text: -> JSON.parse(@responseText).title
|
||||||
|
|
||||||
pastebin:
|
# WIP
|
||||||
regExp: /.*(?:pastebin.com\/(?!u\/))([^#\&\?]*).*/
|
#
|
||||||
el: ->
|
# TwitchTV:
|
||||||
div = $.el 'iframe',
|
# regExp: /twitch\.tv\/(\w+)\/(?:b\/)?(\d+)/i
|
||||||
src: "http://pastebin.com/embed_iframe.php?i=#{@name}"
|
# style: "border: none; width: 640px; height: 360px;"
|
||||||
|
# el: ->
|
||||||
|
# [_, channel, archive] = @result
|
||||||
|
# el = $.el 'object',
|
||||||
|
# data: 'http://www.twitch.tv/widgets/archive_embed_player.swf'
|
||||||
|
# innerHTML: """
|
||||||
|
#<param name='allowFullScreen' value='true' />
|
||||||
|
#<param name='flashvars' value='channel=#{channel}&start_volume=25&auto_play=false&archive_id=#{archive}' />
|
||||||
|
#"""
|
||||||
|
|
||||||
gist:
|
Vocaroo:
|
||||||
regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/
|
regExp: /.*(?:vocaroo.com\/)([^#\&\?]*).*/
|
||||||
|
style: 'border: 0; width: 150px; height: 45px;'
|
||||||
el: ->
|
el: ->
|
||||||
div = $.el 'iframe',
|
$.el 'object',
|
||||||
# Github doesn't allow embedding straight from the site, so we use an external site to bypass that.
|
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>"
|
||||||
src: "http://www.purplegene.com/script?url=https://gist.github.com/#{@name}.js"
|
|
||||||
title:
|
|
||||||
api: (uid) -> "https://api.github.com/gists/#{uid}"
|
|
||||||
text: ->
|
|
||||||
response = JSON.parse(@responseText).files
|
|
||||||
return file for file of response when response.hasOwnProperty file
|
|
||||||
|
|
||||||
InstallGentoo:
|
Vimeo:
|
||||||
regExp: /.*(?:paste.installgentoo.com\/view\/)([0-9a-z_]+)/
|
regExp: /.*(?:vimeo.com\/)([^#\&\?]*).*/
|
||||||
el: ->
|
el: ->
|
||||||
$.el 'iframe',
|
$.el 'iframe',
|
||||||
src: "http://paste.installgentoo.com/view/embed/#{@name}"
|
src: "//player.vimeo.com/video/#{@name}?wmode=opaque"
|
||||||
|
title:
|
||||||
|
api: (uid) -> "https://vimeo.com/api/oembed.json?url=http://vimeo.com/#{uid}"
|
||||||
|
text: -> JSON.parse(@responseText).title
|
||||||
|
|
||||||
|
Vine:
|
||||||
|
regExp: /.*(?:vine.co\/)([^#\&\?]*).*/
|
||||||
|
style: 'border: none; width: 500px; height: 500px;'
|
||||||
|
el: ->
|
||||||
|
$.el 'iframe',
|
||||||
|
src: "https://vine.co/#{@name}/card"
|
||||||
|
|
||||||
|
YouTube:
|
||||||
|
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/
|
||||||
|
el: ->
|
||||||
|
$.el 'iframe',
|
||||||
|
src: "//www.youtube.com/embed/#{@name}#{if @option then '#' + @option else ''}?wmode=opaque"
|
||||||
|
title:
|
||||||
|
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
|
||||||
Loading…
x
Reference in New Issue
Block a user