forked from leftypol/leftypol
display youtube video thumbnail (with local url) in embeds
This commit is contained in:
parent
5216f2e189
commit
2c6628b7cd
2 changed files with 13 additions and 7 deletions
|
@ -29,6 +29,7 @@ onready(function(){
|
|||
|
||||
function addEmbedButton(index, videoNode) {
|
||||
videoNode = $(videoNode);
|
||||
var contents = videoNode.contents();
|
||||
var videoId = videoNode.data('video');
|
||||
var span = $("<span>[Embed]</span>");
|
||||
var embedNode = $('<iframe style="float:left;margin: 10px 20px" type="text/html" '+
|
||||
|
@ -36,9 +37,11 @@ onready(function(){
|
|||
'?autoplay=1&html5=1" allowfullscreen frameborder="0"/>');
|
||||
span.click(function() {
|
||||
if (span.text() == ON){
|
||||
videoNode.append(contents);
|
||||
embedNode.remove();
|
||||
span.text(OFF);
|
||||
} else{
|
||||
contents.detach();
|
||||
videoNode.append(embedNode);
|
||||
span.text(ON);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue