Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. CKEDITOR.plugins.addExternal('embed', '/assets/global/plugins/ckeditor/plugins/embed/', 'plugin.js');
  2. CKEDITOR.plugins.addExternal('embedbase', '/assets/global/plugins/ckeditor/plugins/embedbase/', 'plugin.js');
  3. CKEDITOR.plugins.addExternal('notificationaggregator', '/assets/global/plugins/ckeditor/plugins/notificationaggregator/', 'plugin.js');
  4. CKEDITOR.plugins.addExternal('widget', '/assets/global/plugins/ckeditor/plugins/widget/', 'plugin.js');
  5. CKEDITOR.plugins.addExternal('notification', '/assets/global/plugins/ckeditor/plugins/notification/', 'plugin.js');
  6. CKEDITOR.plugins.addExternal('lineutils', '/assets/global/plugins/ckeditor/plugins/lineutils/', 'plugin.js');
  7. CKEDITOR.plugins.addExternal('widgetselection', '/assets/global/plugins/ckeditor/plugins/widgetselection/', 'plugin.js');
  8.  
  9. CKEDITOR.on( 'instanceCreated', function ( event ) {
  10. var editor = event.editor,
  11. element = editor.element;
  12.  
  13. if ( element.is( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6' ) ) {
  14. editor.on( 'configLoaded', function () {
  15.  
  16. editor.config.removePlugins = 'colorbutton,find,flash,font,' +
  17. 'forms,iframe,image,newpage,removeformat,' +
  18. 'smiley,specialchar,stylescombo,templates';
  19.  
  20. editor.config.toolbarGroups = [
  21. { name: 'editing', groups: [ 'basicstyles', 'links' ] },
  22. { name: 'undo' },
  23. { name: 'clipboard', groups: [ 'selection', 'clipboard' ] }
  24. ];
  25. } );
  26. }
  27.  
  28. if(element.is('div')){
  29. editor.config.extraPlugins = 'embed';
  30.  
  31. editor.on( 'configLoaded', function () {
  32. editor.config.toolbar = [
  33. {name: 'clipboard', items: ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},
  34. {name: 'editing', items: ['Find', 'Replace', '-', 'SelectAll']},
  35. {name: 'basicstyles', items: ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript']},
  36. '/',
  37. {name: 'paragraph', items: ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock']},
  38. {name: 'links', items: ['Link', 'Unlink']},
  39. {name: 'insert', items: ['Image', 'Embed', 'Table']},
  40. {name: 'colors', items: ['TextColor', 'BGColor']},
  41. '/',
  42. {name: 'styles', items: ['Styles', 'Format', 'Font', 'FontSize']}
  43. ];
  44. });
  45. }
  46.  
  47. } );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement