Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CKEDITOR.dialog.add( 'videoLinkDialog', function( editor )
- {
- return {
- title : 'Video Properties',
- minWidth : 400,
- minHeight : 200,
- contents :
- [
- {
- id : 'general',
- label : 'Settings',
- elements :
- [
- {
- type : 'html',
- html : 'This dialog window lets you embed Vimeo videos on your website.'
- },
- {
- type : 'text',
- id : 'url',
- label : 'Video ID',
- validate : CKEDITOR.dialog.validate.notEmpty( 'This field cannot be empty.' ),
- required : true,
- commit : function( data )
- {
- data.text = this.getValue();
- }
- },
- ]
- }
- ],
- onOk : function()
- {
- val = this.getContentElement('general', 'url').getInputElement().getValue();
- var text = '<a class="colorbox-inline" href="http://player.vimeo.com/video/' + val + '?width=915&height=515&iframe=true&autoplay=1"><img class="vid-thumbnail" src="http://placehold.it/350x150" data-vimeo-id="' + val + '" /></a>';
- this.getParentEditor().insertHtml(text)
- },
- };
- } );
- onShow: function () {
- // your code here
- }
- editor.on('doubleclick', function (e) {
- var el = e.data.element;
- if (el == *YOUR_CUSTOM_ELEMENT*)
- e.data.dialog = *DIALOG_NAME*;
- });
Add Comment
Please, Sign In to add comment