config_js.tpl 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /* Ckeditor global configuration file */
  2. CKEDITOR.editorConfig = function (config) {
  3. // Define changes to default configuration here.
  4. // For complete reference see:
  5. // http://docs.ckeditor.com/#!/api/CKEDITOR.config
  6. // Remove some buttons provided by the standard plugins, which are
  7. // not needed in the Standard(s) toolbar.
  8. //config.removeButtons = 'Underline,Subscript,Superscript';
  9. // Set the most common block elements.
  10. config.format_tags = 'p;h1;h2;h3;h4;h5;h6;pre';
  11. // Simplify the dialog windows.
  12. config.removeDialogTabs = 'image:advanced;link:advanced';
  13. config.templates_files = [
  14. '{{ _p.web_main ~ 'inc/lib/elfinder/templates.php'}}'
  15. ];
  16. //Style for default CKEditor Chamilo LMS
  17. config.stylesSet = [
  18. {
  19. name : 'Title 1',
  20. element : 'h1',
  21. attributes : { 'class': 'ck ck-title' }
  22. },
  23. {
  24. name : 'Title 2',
  25. element : 'h2',
  26. attributes : { 'class': 'ck ck-title2' }
  27. },
  28. {
  29. name : 'Alert Success',
  30. element : 'div',
  31. attributes : { 'class': 'alert alert-success' }
  32. },
  33. {
  34. name : 'Alert Info',
  35. element : 'div',
  36. attributes : { 'class': 'alert alert-info' }
  37. },
  38. {
  39. name : 'Alert Warning',
  40. element : 'div',
  41. attributes : { 'class': 'alert alert-warning' }
  42. },
  43. {
  44. name : 'Alert Danger',
  45. element : 'div',
  46. attributes : { 'class': 'alert alert-danger' }
  47. },
  48. {
  49. name : 'Section Article' ,
  50. element : 'h3' ,
  51. attributes : { 'class': 'ck ck-article' }
  52. }, {
  53. name : 'Paragraph box' ,
  54. element : 'p' ,
  55. attributes: { 'class': 'ck-paragraph-box' }
  56. }, {
  57. name : 'Superscript' ,
  58. element : 'sup'
  59. },
  60. {
  61. name : 'Subscript' ,
  62. element : 'sub'
  63. },
  64. {
  65. name : 'Strikethrough' ,
  66. element : 'del'
  67. },
  68. {
  69. name : 'Underlined' ,
  70. element : 'ins'
  71. },
  72. {
  73. name : 'Stand Out' ,
  74. element : 'span',
  75. attributes: { 'class':'ck-stand-out'}
  76. },
  77. {
  78. name : 'Separate Style 1' ,
  79. element : 'hr',
  80. attributes: { 'class':'ck-style1'}
  81. },
  82. {
  83. name : 'Separate Style 2' ,
  84. element : 'hr',
  85. attributes: { 'class':'ck-style2'}
  86. },
  87. {
  88. name : 'Separate Style 3' ,
  89. element : 'hr',
  90. attributes: { 'class':'ck-style3'}
  91. }
  92. ];
  93. {% if moreButtonsInMaximizedMode %}
  94. config.toolbar = 'minToolbar';
  95. config.smallToolbar = 'minToolbar';
  96. config.maximizedToolbar = 'maxToolbar';
  97. {% endif %}
  98. // File manager (elFinder)
  99. config.filebrowserBrowseUrl = '{{ _p.web_lib ~ 'elfinder/filemanager.php?' }}{{ course_condition }}';
  100. config.videobrowserBrowseUrl = '{{ _p.web_lib ~ 'elfinder/filemanager.php?' }}{{ course_condition }}';
  101. // Ofaj
  102. config.enterMode = CKEDITOR.ENTER_BR;
  103. // Allows to use "class" attribute inside divs and spans.
  104. config.allowedContent = true;
  105. // Option to set the "styles" menu
  106. config.contentsCss = [
  107. '{{ bootstrap_css }}',
  108. '{{ font_awesome_css }}',
  109. '{{ css_editor }}',
  110. ];
  111. config.language_list = ['{{ language_list }}'];
  112. config.qMarkersRollsUrl = '{{ _p.web_ajax }}exercise.ajax.php?a=get_quiz_embeddable';
  113. };
  114. // Sets default target to "_blank" in link plugin
  115. CKEDITOR.on('dialogDefinition', function (ev) {
  116. if (ev.data.name == 'link'){
  117. ev.data.definition.getContents('target').get('linkTargetType')['default']='_blank';
  118. }
  119. });