Hi,
I'm using WYSiWYG 1.5.6_0 [B551+23.01.2015], CKEditor 4.4.5 [revision 25cdcad] on 1.24.1 MW
and I had to create a new button for the EmbedVideo extension.
This extension is based on a specific tag <embedvideo service=...>http://...</embedvideo>
wich I'm trying to add via the button and a simple prompt for url.
I added my button successfully, prompt works but adds only the url pasted to the existing content.
I looked around for tips, but what ever I tried, could not avoid the <embedvideo...> tag to be stripped.
I thought that adding the allowedContent: 'embedvideo[!service]' line in editor.addCommand of my plugin.js would help but niet...
Anybody knows if this allowedContent or extraAllowedContent features still work ?
Thanks for your help/advices...
Here below my plugin.js for the button
M.
CKEDITOR.plugins.add( 'video', {
init: function( editor ) {
//Plugin logic goes here.
editor.addCommand( 'insertVideo', {
exec: function( editor ) {
var services = ["bing","msn","dailymotion","kickstarter","metacafe","youtube","vimeo"];
var videoUrl = prompt('Collez ici l\'URL de la video :');
for (servi = 0; servi < services.length; servi++) {
if (videoUrl.indexOf(services[servi]) > -1) videoService = services[servi];
}
if (!videoService)
{
alert('Video Service not allowed : ' + videoURL);
}
editor.insertHtml( '<embedvideo service="'+ videoService +'">'+ videoUrl +'</embedvideo>' );
},
allowedContent: 'embedvideo[!service]',
});
editor.ui.addButton('Video',
{
label: 'Insert Video',
command: 'insertVideo',
icon: this.path + 'images/video.png'
});
}
});