config.js 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. function _getBasePath() {
  2. var els = document.getElementsByTagName('script'), src;
  3. for (var i = 0, len = els.length; i < len; i++) {
  4. src = els[i].src || '';
  5. if (/kindeditor[\w\-\.]*\.js/.test(src)) {
  6. return src.substring(0, src.lastIndexOf('/') + 1);
  7. }
  8. }
  9. return '';
  10. }
  11. K.basePath = _getBasePath();
  12. K.options = {
  13. designMode : true,
  14. fullscreenMode : false,
  15. filterMode : true,
  16. wellFormatMode : true,
  17. shadowMode : true,
  18. loadStyleMode : true,
  19. basePath : K.basePath,
  20. themesPath : K.basePath + 'themes/',
  21. langPath : K.basePath + 'lang/',
  22. pluginsPath : K.basePath + 'plugins/',
  23. themeType : 'default', // default, simple
  24. langType : 'zh-CN',
  25. urlType : '', // "", relative, absolute, domain
  26. newlineTag : 'p', // p, br
  27. resizeType : 2, // 0, 1, 2
  28. syncType : 'form', // "", form
  29. pasteType : 2, // 0:none, 1:text, 2:HTML
  30. dialogAlignType : 'page', // page, editor
  31. useContextmenu : true,
  32. fullscreenShortcut : false,
  33. bodyClass : 'ke-content',
  34. indentChar : '\t', // \t, " "
  35. cssPath : '', //String or Array
  36. cssData : '',
  37. minWidth : 650,
  38. minHeight : 100,
  39. minChangeSize : 50,
  40. zIndex : 811213,
  41. items : [
  42. 'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
  43. 'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
  44. 'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
  45. 'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
  46. 'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
  47. 'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',
  48. 'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',
  49. 'anchor', 'link', 'unlink', '|', 'about'
  50. ],
  51. noDisableItems : ['source', 'fullscreen'],
  52. colorTable : [
  53. ['#E53333', '#E56600', '#FF9900', '#64451D', '#DFC5A4', '#FFE500'],
  54. ['#009900', '#006600', '#99BB00', '#B8D100', '#60D978', '#00D5FF'],
  55. ['#337FE5', '#003399', '#4C33E5', '#9933E5', '#CC33E5', '#EE33EE'],
  56. ['#FFFFFF', '#CCCCCC', '#999999', '#666666', '#333333', '#000000']
  57. ],
  58. fontSizeTable : ['9px', '10px', '12px', '14px', '16px', '18px', '24px', '32px'],
  59. htmlTags : {
  60. font : ['id', 'class', 'color', 'size', 'face', '.background-color'],
  61. span : [
  62. 'id', 'class', '.color', '.background-color', '.font-size', '.font-family', '.background',
  63. '.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.line-height'
  64. ],
  65. div : [
  66. 'id', 'class', 'align', '.border', '.margin', '.padding', '.text-align', '.color',
  67. '.background-color', '.font-size', '.font-family', '.font-weight', '.background',
  68. '.font-style', '.text-decoration', '.vertical-align', '.margin-left'
  69. ],
  70. table: [
  71. 'id', 'class', 'border', 'cellspacing', 'cellpadding', 'width', 'height', 'align', 'bordercolor',
  72. '.padding', '.margin', '.border', 'bgcolor', '.text-align', '.color', '.background-color',
  73. '.font-size', '.font-family', '.font-weight', '.font-style', '.text-decoration', '.background',
  74. '.width', '.height', '.border-collapse'
  75. ],
  76. 'td,th': [
  77. 'id', 'class', 'align', 'valign', 'width', 'height', 'colspan', 'rowspan', 'bgcolor',
  78. '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.font-weight',
  79. '.font-style', '.text-decoration', '.vertical-align', '.background', '.border'
  80. ],
  81. a : ['id', 'class', 'href', 'target', 'name'],
  82. embed : ['id', 'class', 'src', 'width', 'height', 'type', 'loop', 'autostart', 'quality', '.width', '.height', 'align', 'allowscriptaccess', 'wmode'],
  83. img : ['id', 'class', 'src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
  84. 'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [
  85. 'id', 'class', 'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background',
  86. '.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left'
  87. ],
  88. pre : ['id', 'class'],
  89. hr : ['id', 'class', '.page-break-after'],
  90. 'br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del' : ['id', 'class'],
  91. iframe : ['id', 'class', 'src', 'frameborder', 'width', 'height', '.width', '.height']
  92. },
  93. layout : '<div class="container"><div class="toolbar"></div><div class="edit"></div><div class="statusbar"></div></div>'
  94. };