/application/protected/extensions/widgets/elrte/src/elrte/js/elRTE.options.js

https://bitbucket.org/dinhtrung/yiicorecms/ · JavaScript · 168 lines · 135 code · 1 blank · 32 comment · 0 complexity · cbdfbe60e93bae5d0ca1f74732e80670 MD5 · raw file

  1. /*
  2. * elRTE configuration
  3. *
  4. * @param doctype - doctype for editor iframe
  5. * @param cssClass - css class for editor
  6. * @param cssFiles - array of css files, witch will inlude in iframe
  7. * @param height - not used now (may be deleted in future)
  8. * @param lang - interface language (requires file in i18n dir)
  9. * @param toolbar - name of toolbar to load
  10. * @param absoluteURLs - convert files and images urls to absolute or not
  11. * @param allowSource - is source editing allowing
  12. * @param stripWhiteSpace - strip ?????? whitespaces/tabs or not
  13. * @param styleWithCSS - use style=... instead of strong etc.
  14. * @param fmAllow - allow using file manger (elFinder)
  15. * @param fmOpen - callback for open file manager
  16. * @param buttons - object with pairs of buttons classes names and titles (when create new button, you have to add iys name here)
  17. * @param panels - named groups of buttons
  18. * @param panelNames - title of panels (required for one planned feature)
  19. * @param toolbars - named redy to use toolbals (you may combine your own toolbar)
  20. *
  21. * @author: Dmitry Levashov (dio) dio@std42.ru
  22. * Copyright: Studio 42, http://www.std42.ru
  23. */
  24. (function($) {
  25. elRTE.prototype.options = {
  26. doctype : '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">',
  27. cssClass : 'el-rte',
  28. cssfiles : [],
  29. height : null,
  30. resizable : true,
  31. lang : 'en',
  32. toolbar : 'normal',
  33. absoluteURLs : true,
  34. allowSource : true,
  35. stripWhiteSpace : true,
  36. styleWithCSS : false,
  37. fmAllow : true,
  38. fmOpen : null,
  39. /* if set all other tag will be removed */
  40. allowTags : [],
  41. /* if set this tags will be removed */
  42. denyTags : ['applet', 'base', 'basefont', 'bgsound', 'blink', 'body', 'col', 'colgroup', 'isindex', 'frameset', 'html', 'head', 'meta', 'marquee', 'noframes', 'noembed', 'o:p', 'title', 'xml'],
  43. denyAttr : [],
  44. /* on paste event this attributes will removed from pasted html */
  45. pasteDenyAttr : ['id', 'name', 'class', 'style', 'language', 'onclick', 'ondblclick', 'onhover', 'onkeup', 'onkeydown', 'onkeypress'],
  46. /* If false - all text nodes will be wrapped by paragraph tag */
  47. allowTextNodes : true,
  48. /* allow browser specific styles like -moz|-webkit|-o */
  49. allowBrowsersSpecStyles : false,
  50. /* allow paste content into editor */
  51. allowPaste : true,
  52. /* if true - only text will be pasted (not in ie) */
  53. pasteOnlyText : false,
  54. /* user replacement rules */
  55. replace : [],
  56. /* user restore rules */
  57. restore : [],
  58. pagebreak : '<div style="page-break-after: always;"></div>', //'<!-- pagebreak -->',
  59. buttons : {
  60. 'save' : 'Save',
  61. 'copy' : 'Copy',
  62. 'cut' : 'Cut',
  63. 'css' : 'Css style and class',
  64. 'paste' : 'Paste',
  65. 'pastetext' : 'Paste only text',
  66. 'pasteformattext' : 'Paste formatted text',
  67. 'removeformat' : 'Clean format',
  68. 'undo' : 'Undo last action',
  69. 'redo' : 'Redo previous action',
  70. 'bold' : 'Bold',
  71. 'italic' : 'Italic',
  72. 'underline' : 'Underline',
  73. 'strikethrough' : 'Strikethrough',
  74. 'superscript' : 'Superscript',
  75. 'subscript' : 'Subscript',
  76. 'justifyleft' : 'Align left',
  77. 'justifyright' : 'Ailgn right',
  78. 'justifycenter' : 'Align center',
  79. 'justifyfull' : 'Align full',
  80. 'indent' : 'Indent',
  81. 'outdent' : 'Outdent',
  82. 'rtl' : 'Right to left',
  83. 'ltr' : 'Left to right',
  84. 'forecolor' : 'Font color',
  85. 'hilitecolor' : 'Background color',
  86. 'formatblock' : 'Format',
  87. 'fontsize' : 'Font size',
  88. 'fontname' : 'Font',
  89. 'insertorderedlist' : 'Ordered list',
  90. 'insertunorderedlist' : 'Unordered list',
  91. 'horizontalrule' : 'Horizontal rule',
  92. 'blockquote' : 'Blockquote',
  93. 'div' : 'Block element (DIV)',
  94. 'link' : 'Link',
  95. 'unlink' : 'Delete link',
  96. 'anchor' : 'Bookmark',
  97. 'image' : 'Image',
  98. 'pagebreak' : 'Page break',
  99. 'smiley' : 'Smiley',
  100. 'flash' : 'Flash',
  101. 'table' : 'Table',
  102. 'tablerm' : 'Delete table',
  103. 'tableprops' : 'Table properties',
  104. 'tbcellprops' : 'Table cell properties',
  105. 'tbrowbefore' : 'Insert row before',
  106. 'tbrowafter' : 'Insert row after',
  107. 'tbrowrm' : 'Delete row',
  108. 'tbcolbefore' : 'Insert column before',
  109. 'tbcolafter' : 'Insert column after',
  110. 'tbcolrm' : 'Delete column',
  111. 'tbcellsmerge' : 'Merge table cells',
  112. 'tbcellsplit' : 'Split table cell',
  113. 'docstructure' : 'Toggle display document structure',
  114. 'elfinder' : 'Open file manager',
  115. 'fullscreen' : 'Toggle full screen mode',
  116. 'nbsp' : 'Non breakable space',
  117. 'stopfloat' : 'Stop element floating',
  118. 'about' : 'About this software'
  119. },
  120. panels : {
  121. eol : [], // special panel, insert's a new line in toolbar
  122. save : ['save'],
  123. copypaste : ['copy', 'cut', 'paste', 'pastetext', 'pasteformattext', 'removeformat', 'docstructure'],
  124. undoredo : ['undo', 'redo'],
  125. style : ['bold', 'italic', 'underline', 'strikethrough', 'subscript', 'superscript'],
  126. colors : ['forecolor', 'hilitecolor'],
  127. alignment : ['justifyleft', 'justifycenter', 'justifyright', 'justifyfull'],
  128. indent : ['outdent', 'indent'],
  129. format : ['formatblock', 'fontsize', 'fontname'],
  130. lists : ['insertorderedlist', 'insertunorderedlist'],
  131. elements : ['horizontalrule', 'blockquote', 'div', 'stopfloat', 'css', 'nbsp', 'smiley', 'pagebreak'],
  132. direction : ['ltr', 'rtl'],
  133. links : ['link', 'unlink', 'anchor'],
  134. images : ['image'],
  135. media : ['image', 'flash'],
  136. tables : ['table', 'tableprops', 'tablerm', 'tbrowbefore', 'tbrowafter', 'tbrowrm', 'tbcolbefore', 'tbcolafter', 'tbcolrm', 'tbcellprops', 'tbcellsmerge', 'tbcellsplit'],
  137. elfinder : ['elfinder'],
  138. fullscreen : ['fullscreen', 'about']
  139. },
  140. toolbars : {
  141. tiny : ['style'],
  142. compact : ['save', 'undoredo', 'style', 'alignment', 'lists', 'links', 'fullscreen'],
  143. normal : ['save', 'copypaste', 'undoredo', 'style', 'alignment', 'colors', 'indent', 'lists', 'links', 'elements', 'images', 'fullscreen'],
  144. complete : ['save', 'copypaste', 'undoredo', 'style', 'alignment', 'colors', 'format', 'indent', 'lists', 'links', 'elements', 'media', 'fullscreen'],
  145. maxi : ['save', 'copypaste', 'undoredo', 'elfinder', 'style', 'alignment', 'direction', 'colors', 'format', 'indent', 'lists', 'links', 'elements', 'media', 'tables', 'fullscreen'],
  146. eldorado : ['save', 'copypaste', 'elfinder', 'undoredo', 'style', 'alignment', 'colors', 'format', 'indent', 'lists', 'links', 'elements', 'media', 'tables', 'fullscreen']
  147. },
  148. panelNames : {
  149. save : 'Save',
  150. copypaste : 'Copy/Pase',
  151. undoredo : 'Undo/Redo',
  152. style : 'Text styles',
  153. colors : 'Colors',
  154. alignment : 'Alignment',
  155. indent : 'Indent/Outdent',
  156. format : 'Text format',
  157. lists : 'Lists',
  158. elements : 'Misc elements',
  159. direction : 'Script direction',
  160. links : 'Links',
  161. images : 'Images',
  162. media : 'Media',
  163. tables : 'Tables',
  164. elfinder : 'File manager (elFinder)'
  165. }
  166. };
  167. })(jQuery);