Guest User

Untitled

a guest
Jan 24th, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. CKEDITOR.dialog.add( 'videoLinkDialog', function( editor )
  2. {
  3. return {
  4. title : 'Video Properties',
  5. minWidth : 400,
  6. minHeight : 200,
  7. contents :
  8. [
  9. {
  10. id : 'general',
  11. label : 'Settings',
  12. elements :
  13. [
  14. {
  15. type : 'html',
  16. html : 'This dialog window lets you embed Vimeo videos on your website.'
  17. },
  18. {
  19. type : 'text',
  20. id : 'url',
  21. label : 'Video ID',
  22. validate : CKEDITOR.dialog.validate.notEmpty( 'This field cannot be empty.' ),
  23. required : true,
  24. commit : function( data )
  25. {
  26. data.text = this.getValue();
  27. }
  28. },
  29. ]
  30. }
  31. ],
  32. onOk : function()
  33. {
  34. val = this.getContentElement('general', 'url').getInputElement().getValue();
  35. 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>';
  36. this.getParentEditor().insertHtml(text)
  37. },
  38. };
  39. } );
  40.  
  41. onShow: function () {
  42. // your code here
  43. }
  44.  
  45. editor.on('doubleclick', function (e) {
  46. var el = e.data.element;
  47. if (el == *YOUR_CUSTOM_ELEMENT*)
  48. e.data.dialog = *DIALOG_NAME*;
  49. });
Add Comment
Please, Sign In to add comment