ckeditor-config.js 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* global CKEDITOR */
  2. CKEDITOR.editorConfig = function( config ) {
  3. var fixThings = false;
  4. // https://dev.ckeditor.com/ticket/10907
  5. config.needsBrFiller= fixThings;
  6. config.needsNbspFiller= fixThings;
  7. config.removeButtons= 'Source,Maximize';
  8. // magicline plugin inserts html crap into the document which is not part of the
  9. // document itself and causes problems when it's sent across the wire and reflected back
  10. config.removePlugins= 'resize,elementspath';
  11. config.resize_enabled= false; //bottom-bar
  12. config.extraPlugins= 'autolink,colorbutton,colordialog,font,indentblock,justify,mediatag,print,blockbase64';
  13. config.toolbarGroups= [
  14. // {"name":"clipboard","groups":["clipboard","undo"]},
  15. //{"name":"editing","groups":["find","selection"]},
  16. {"name":"links"},
  17. {"name":"insert"},
  18. {"name":"forms"},
  19. {"name":"tools"},
  20. {"name":"document","groups":["mode","document","doctools"]},
  21. {"name":"others"},
  22. {"name":"basicstyles","groups":["basicstyles","cleanup"]},
  23. {"name":"paragraph","groups":["list","indent","blocks","align","bidi"]},
  24. {"name":"styles"},
  25. {"name":"colors"},
  26. {"name":"print"}];
  27. config.font_defaultLabel = 'Arial';
  28. config.fontSize_defaultLabel = '16';
  29. config.keystrokes = [
  30. [ CKEDITOR.ALT + 121 /*F10*/, 'toolbarFocus' ],
  31. [ CKEDITOR.ALT + 122 /*F11*/, 'elementsPathFocus' ],
  32. [ CKEDITOR.SHIFT + 121 /*F10*/, 'contextMenu' ],
  33. [ CKEDITOR.CTRL + 90 /*Z*/, 'undo' ],
  34. [ CKEDITOR.CTRL + 89 /*Y*/, 'redo' ],
  35. [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 /*Z*/, 'redo' ],
  36. [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 76 /*L*/, 'link' ],
  37. [ CKEDITOR.CTRL + 76 /*L*/, undefined ],
  38. [ CKEDITOR.CTRL + 66 /*B*/, 'bold' ],
  39. [ CKEDITOR.CTRL + 73 /*I*/, 'italic' ],
  40. [ CKEDITOR.CTRL + 85 /*U*/, 'underline' ],
  41. [ CKEDITOR.ALT + 109 /*-*/, 'toolbarCollapse' ]
  42. ];
  43. //skin: 'moono-cryptpad,/pad/themes/moono-cryptpad/'
  44. //skin: 'flat,/pad/themes/flat/'
  45. //config.skin= 'moono-lisa,/pad/themes/moono-lisa/'
  46. skin: 'moono-dark,/pad/themes/moono-dark/'
  47. //skin: 'office2013,/pad/themes/office2013/'
  48. };
  49. (function () {
  50. // These are overrides inside of ckeditor which add ?ver= to the CSS files so that
  51. // every part of ckeditor will get in the browser cache.
  52. var fix = function (x) {
  53. if (x.map) { return x.map(fix); }
  54. return (/\/bower_components\/.*\.css$/.test(x)) ? (x + '?ver=' + CKEDITOR.timestamp) : x;
  55. };
  56. CKEDITOR.tools._buildStyleHtml = CKEDITOR.tools.buildStyleHtml;
  57. CKEDITOR.document._appendStyleSheet = CKEDITOR.document.appendStyleSheet;
  58. CKEDITOR.tools.buildStyleHtml = function (x) { return CKEDITOR.tools._buildStyleHtml(fix(x)); };
  59. CKEDITOR.document.appendStyleSheet = function (x) { return CKEDITOR.document._appendStyleSheet(fix(x)); };
  60. }());