( function(){
var exampleDialog = function(editor){
return {
title : 'Youtube Video',
minWidth : 200,
minHeight : 175,
onOk: function(){
var dialog = this;
var embedId = dialog.getValueOf( 'tab1', 'embedId' );
var embedWidth = dialog.getValueOf('tab1','embedWidth');
var embedHeight = dialog.getValueOf('tab1','embedHeight');
var embedRelatedVideos = dialog.getValueOf('tab1','embedRelatedVideos');
var rel = 0;
if(embedRelatedVideos === 'true'){
rel = 1;
}else{
rel = 0;
}
var sHtml = '<p><object width="'+embedWidth+'" height="'+embedHeight+'" data="http://www.youtube.com/v/&rel=1" type="application/x-shockwave-flash"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/'+embedId+'&rel='+rel+'" /></object></p>';
editor.insertHtml( sHtml );
} ,
onLoad: function(){},
onShow: function(){
},
onHide: function(){},
onCancel: function(){},
resizable: 'none',
contents :
[
{
id : 'tab1',
label : 'Insert Youtube Embedded Code',
elements :
[
{
type: 'text',
id: 'embedId',
label: 'Youtube Embed Code',
validate: CKEDITOR.dialog.validate.notEmpty("Youtube Embed Code is not filled in. This field cannot be empty")
},
{
type: 'text',
id: 'embedWidth',
label: 'Width',
width: "50px",
'default': '450px'
},
{
type: 'text',
id: 'embedHeight',
label: 'Height',
width: "50px",
'default': '320px'
},
{
type: 'radio',
id: 'embedRelatedVideos',
label: 'Show related videos?',
items: [['Yes','true'],['No','false']],
'default' : 'false'
}
]
}
]
}
}
CKEDITOR.dialog.add('youtube', function(editor){
return exampleDialog(editor);
});
})();
Tue, 09/11/2012 - 13:56
#1

Re: Youtube Plugin double click in editor
http://nightly.ckeditor.com/7608/_sampl ... ialog.html
http://docs.cksource.com/CKEditor_3.x/Tutorials
Customer and Community Manager, CKSource
Follow us on: Facebook, Twitter, LinkedIn
If you think you found a bug in CKEditor, read this!