config.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
  3. * For licensing, see https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. CKEDITOR.editorConfig = function( config ) {
  6. // Define changes to default configuration here. For example:
  7. // config.language = 'fr';
  8. // config.uiColor = '#AADC6E';
  9. config.font_names =
  10. '宋体/SimSun;' +
  11. '黑体/SimHei;' +
  12. '仿宋/FangSong;' +
  13. '楷体/KaiTi;' +
  14. '隶书/LiSu;' +
  15. '幼圆/YouYuan;' +
  16. '微软雅黑/Microsoft YaHei;' +
  17. config.font_names;
  18. // 确保字体插件被加载
  19. config.extraPlugins = 'font';
  20. // 可选:设置默认字体
  21. config.font_defaultLabel = '宋体';
  22. // 可选:允许所有字体大小
  23. config.fontSize_sizes = '8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px';
  24. // 可选:设置默认字体大小
  25. config.fontSize_defaultLabel = '12px';
  26. // 设置内容CSS
  27. config.contentsCss = '/public/ckeditor/custom-ckeditor.css';
  28. // 允许额外的CSS类
  29. config.extraAllowedContent = 'div(page-break)';
  30. // 设置编辑器的宽度,高度可以设置为自动
  31. config.width = '100%';
  32. config.height = 'auto';
  33. // 添加分页符插件(如果需要)
  34. config.extraPlugins = 'pagebreak';
  35. // 设置工具栏位置在编辑区域上方
  36. config.toolbarLocation = 'top';
  37. // 修改图片上传配置
  38. config.filebrowserImageUploadUrl = 'http://58.246.234.210:8084/upload/image';
  39. config.imageUploadUrl = 'http://58.246.234.210:8084/upload/image';
  40. // 自定义上传处理
  41. config.uploadUrl = 'http://58.246.234.210:8084/upload/image';
  42. };