Add youtube time
This commit is contained in:
parent
a9fa6dac56
commit
0c2bdc1d6a
@ -1,5 +1,6 @@
|
|||||||
seaweedchan:
|
seaweedchan:
|
||||||
- External image embedding
|
- External image embedding
|
||||||
|
- Account for time options in youtube links for embedding
|
||||||
|
|
||||||
### 1.1.6 - 2013-05-01
|
### 1.1.6 - 2013-05-01
|
||||||
seaweedchan:
|
seaweedchan:
|
||||||
|
|||||||
@ -4224,10 +4224,10 @@
|
|||||||
},
|
},
|
||||||
types: {
|
types: {
|
||||||
YouTube: {
|
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() {
|
el: function() {
|
||||||
return $.el('iframe', {
|
return $.el('iframe', {
|
||||||
src: "//www.youtube.com/embed/" + this.name
|
src: "//www.youtube.com/embed/" + this.name + (this.option ? '#' + this.option : '')
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@ -4390,6 +4390,7 @@
|
|||||||
}
|
}
|
||||||
embed = $.el('a', {
|
embed = $.el('a', {
|
||||||
name: (a.name = match[1]),
|
name: (a.name = match[1]),
|
||||||
|
option: match[2],
|
||||||
className: 'embedder',
|
className: 'embedder',
|
||||||
href: 'javascript:;',
|
href: 'javascript:;',
|
||||||
textContent: '(embed)'
|
textContent: '(embed)'
|
||||||
|
|||||||
@ -4220,10 +4220,10 @@
|
|||||||
},
|
},
|
||||||
types: {
|
types: {
|
||||||
YouTube: {
|
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() {
|
el: function() {
|
||||||
return $.el('iframe', {
|
return $.el('iframe', {
|
||||||
src: "//www.youtube.com/embed/" + this.name
|
src: "//www.youtube.com/embed/" + this.name + (this.option ? '#' + this.option : '')
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@ -4386,6 +4386,7 @@
|
|||||||
}
|
}
|
||||||
embed = $.el('a', {
|
embed = $.el('a', {
|
||||||
name: (a.name = match[1]),
|
name: (a.name = match[1]),
|
||||||
|
option: match[2],
|
||||||
className: 'embedder',
|
className: 'embedder',
|
||||||
href: 'javascript:;',
|
href: 'javascript:;',
|
||||||
textContent: '(embed)'
|
textContent: '(embed)'
|
||||||
|
|||||||
@ -4222,10 +4222,10 @@
|
|||||||
},
|
},
|
||||||
types: {
|
types: {
|
||||||
YouTube: {
|
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() {
|
el: function() {
|
||||||
return $.el('iframe', {
|
return $.el('iframe', {
|
||||||
src: "//www.youtube.com/embed/" + this.name
|
src: "//www.youtube.com/embed/" + this.name + (this.option ? '#' + this.option : '')
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
title: {
|
title: {
|
||||||
@ -4388,6 +4388,7 @@
|
|||||||
}
|
}
|
||||||
embed = $.el('a', {
|
embed = $.el('a', {
|
||||||
name: (a.name = match[1]),
|
name: (a.name = match[1]),
|
||||||
|
option: match[2],
|
||||||
className: 'embedder',
|
className: 'embedder',
|
||||||
href: 'javascript:;',
|
href: 'javascript:;',
|
||||||
textContent: '(embed)'
|
textContent: '(embed)'
|
||||||
|
|||||||
@ -144,10 +144,10 @@ Linkify =
|
|||||||
|
|
||||||
types:
|
types:
|
||||||
YouTube:
|
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: ->
|
||||||
$.el 'iframe',
|
$.el 'iframe',
|
||||||
src: "//www.youtube.com/embed/#{@name}"
|
src: "//www.youtube.com/embed/#{@name}#{if @option then '#' + @option else ''}"
|
||||||
title:
|
title:
|
||||||
api: -> "https://gdata.youtube.com/feeds/api/videos/#{@name}?alt=json&fields=title/text(),yt:noembed,app:control/yt:state/@reasonCode"
|
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
|
text: -> JSON.parse(@responseText).entry.title.$t
|
||||||
@ -249,6 +249,7 @@ Linkify =
|
|||||||
|
|
||||||
embed = $.el 'a',
|
embed = $.el 'a',
|
||||||
name: (a.name = match[1])
|
name: (a.name = match[1])
|
||||||
|
option: match[2]
|
||||||
className: 'embedder'
|
className: 'embedder'
|
||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
textContent: '(embed)'
|
textContent: '(embed)'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user