Add youtube time

This commit is contained in:
Jordan Bates 2013-05-01 10:45:21 -07:00
parent a9fa6dac56
commit 0c2bdc1d6a
5 changed files with 13 additions and 8 deletions

View File

@ -1,5 +1,6 @@
seaweedchan:
- External image embedding
- Account for time options in youtube links for embedding
### 1.1.6 - 2013-05-01
seaweedchan:

View File

@ -4224,10 +4224,10 @@
},
types: {
YouTube: {
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*).*/,
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/,
el: function() {
return $.el('iframe', {
src: "//www.youtube.com/embed/" + this.name
src: "//www.youtube.com/embed/" + this.name + (this.option ? '#' + this.option : '')
});
},
title: {
@ -4390,6 +4390,7 @@
}
embed = $.el('a', {
name: (a.name = match[1]),
option: match[2],
className: 'embedder',
href: 'javascript:;',
textContent: '(embed)'

View File

@ -4220,10 +4220,10 @@
},
types: {
YouTube: {
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*).*/,
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/,
el: function() {
return $.el('iframe', {
src: "//www.youtube.com/embed/" + this.name
src: "//www.youtube.com/embed/" + this.name + (this.option ? '#' + this.option : '')
});
},
title: {
@ -4386,6 +4386,7 @@
}
embed = $.el('a', {
name: (a.name = match[1]),
option: match[2],
className: 'embedder',
href: 'javascript:;',
textContent: '(embed)'

View File

@ -4222,10 +4222,10 @@
},
types: {
YouTube: {
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*).*/,
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/,
el: function() {
return $.el('iframe', {
src: "//www.youtube.com/embed/" + this.name
src: "//www.youtube.com/embed/" + this.name + (this.option ? '#' + this.option : '')
});
},
title: {
@ -4388,6 +4388,7 @@
}
embed = $.el('a', {
name: (a.name = match[1]),
option: match[2],
className: 'embedder',
href: 'javascript:;',
textContent: '(embed)'

View File

@ -144,10 +144,10 @@ Linkify =
types:
YouTube:
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*).*/
regExp: /.*(?:youtu.be\/|youtube.*v=|youtube.*\/embed\/|youtube.*\/v\/|youtube.*videos\/)([^#\&\?]*)\??(t\=.*)?/
el: ->
$.el 'iframe',
src: "//www.youtube.com/embed/#{@name}"
src: "//www.youtube.com/embed/#{@name}#{if @option then '#' + @option else ''}"
title:
api: -> "https://gdata.youtube.com/feeds/api/videos/#{@name}?alt=json&fields=title/text(),yt:noembed,app:control/yt:state/@reasonCode"
text: -> JSON.parse(@responseText).entry.title.$t
@ -249,6 +249,7 @@ Linkify =
embed = $.el 'a',
name: (a.name = match[1])
option: match[2]
className: 'embedder'
href: 'javascript:;'
textContent: '(embed)'