/source/Plug-in/fck/fckconfig.js

http://prosporous.googlecode.com/ · JavaScript · 303 lines · 185 code · 62 blank · 56 comment · 2 complexity · 0a5b8b7c20dd167736f488425f0fd510 MD5 · raw file

  1. /*
  2. * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  3. * Copyright (C) 2003-2007 Frederico Caldeira Knabben
  4. *
  5. * == BEGIN LICENSE ==
  6. *
  7. * Licensed under the terms of any of the following licenses at your
  8. * choice:
  9. *
  10. * - GNU General Public License Version 2 or later (the "GPL")
  11. * http://www.gnu.org/licenses/gpl.html
  12. *
  13. * - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
  14. * http://www.gnu.org/licenses/lgpl.html
  15. *
  16. * - Mozilla Public License Version 1.1 or later (the "MPL")
  17. * http://www.mozilla.org/MPL/MPL-1.1.html
  18. *
  19. * == END LICENSE ==
  20. *
  21. * Editor configuration settings.
  22. *
  23. * Follow this link for more information:
  24. * http://wiki.fckeditor.net/Developer%27s_Guide/Configuration/Configurations_Settings
  25. */
  26. FCKConfig.CustomConfigurationsPath = '' ;
  27. FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ;
  28. FCKConfig.EditorAreaStyles = '' ;
  29. FCKConfig.ToolbarComboPreviewCSS = '' ;
  30. FCKConfig.DocType = '' ;
  31. FCKConfig.BaseHref = '' ;
  32. FCKConfig.FullPage = false ;
  33. // The following option determines whether the "Show Blocks" feature is enabled or not at startup.
  34. FCKConfig.StartupShowBlocks = false ;
  35. FCKConfig.Debug = false ;
  36. FCKConfig.AllowQueryStringDebug = true ;
  37. FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;
  38. FCKConfig.PreloadImages = [ FCKConfig.SkinPath + 'images/toolbar.start.gif', FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif' ] ;
  39. FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;
  40. //FCKConfig.Plugins.Add( 'Media', 'en,zh,zh-cn' ) ;
  41. // FCKConfig.Plugins.Add( 'autogrow' ) ;
  42. // FCKConfig.Plugins.Add( 'dragresizetable' );
  43. FCKConfig.AutoGrowMax = 400 ;
  44. // FCKConfig.ProtectedSource.Add( /<%[\s\S]*?%>/g ) ; // ASP style server side code <%...%>
  45. // FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ; // PHP style server side code
  46. // FCKConfig.ProtectedSource.Add( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi ) ; // ASP.Net style tags <asp:control>
  47. FCKConfig.AutoDetectLanguage = true ;
  48. FCKConfig.DefaultLanguage = 'en' ;
  49. FCKConfig.ContentLangDirection = 'ltr' ;
  50. FCKConfig.ProcessHTMLEntities = true ;
  51. FCKConfig.IncludeLatinEntities = true ;
  52. FCKConfig.IncludeGreekEntities = true ;
  53. FCKConfig.ProcessNumericEntities = false ;
  54. FCKConfig.AdditionalNumericEntities = '' ; // Single Quote: "'"
  55. FCKConfig.FillEmptyBlocks = true ;
  56. FCKConfig.FormatSource = true ;
  57. FCKConfig.FormatOutput = true ;
  58. FCKConfig.FormatIndentator = ' ' ;
  59. FCKConfig.StartupFocus = false ;
  60. FCKConfig.ForcePasteAsPlainText = false ;
  61. FCKConfig.AutoDetectPasteFromWord = true ; // IE only.
  62. FCKConfig.ShowDropDialog = true ;
  63. FCKConfig.ForceSimpleAmpersand = false ;
  64. FCKConfig.TabSpaces = 0 ;
  65. FCKConfig.ShowBorders = true ;
  66. FCKConfig.SourcePopup = false ;
  67. FCKConfig.ToolbarStartExpanded = true ;
  68. FCKConfig.ToolbarCanCollapse = true ;
  69. FCKConfig.IgnoreEmptyParagraphValue = true ;
  70. FCKConfig.PreserveSessionOnFileBrowser = false ;
  71. FCKConfig.FloatingPanelsZIndex = 10000 ;
  72. FCKConfig.HtmlEncodeOutput = false ;
  73. FCKConfig.TemplateReplaceAll = true ;
  74. FCKConfig.TemplateReplaceCheckbox = true ;
  75. FCKConfig.ToolbarLocation = 'In' ;
  76. FCKConfig.ToolbarSets["Default"] = [
  77. ['Bold','Italic','Underline','StrikeThrough','-','TextColor','BGColor','-','Outdent','Indent','Blockquote','-','JustifyLeft','JustifyCenter','JustifyRight','JustifyFull','-','Templates','Paste','PasteText','PasteWord'],
  78. ['Image','Flash','Table','-','Rule','SpecialChar','-','OrderedList','UnorderedList','-','Undo','Redo','-','Link','Unlink','-','RemoveFormat','PageBreak','-','FitWindow','Source'],
  79. ['Style','FontFormat','FontName','FontSize']
  80. ]
  81. FCKConfig.ToolbarSets["Basic"] = [
  82. ['Style','FontFormat','FontName','FontSize'],
  83. ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript','-','OrderedList','UnorderedList','-','TextColor','BGColor','-','Link','Unlink','-','Image','Smiley']
  84. ] ;
  85. FCKConfig.EnterMode = 'br' ; // p | div | br
  86. FCKConfig.ShiftEnterMode = 'p' ; // p | div | br
  87. FCKConfig.Keystrokes = [
  88. [ CTRL + 65 /*A*/, true ],
  89. [ CTRL + 67 /*C*/, true ],
  90. [ CTRL + 70 /*F*/, true ],
  91. [ CTRL + 83 /*S*/, true ],
  92. [ CTRL + 88 /*X*/, true ],
  93. [ CTRL + 86 /*V*/, 'Paste' ],
  94. [ SHIFT + 45 /*INS*/, 'Paste' ],
  95. [ CTRL + 88 /*X*/, 'Cut' ],
  96. [ SHIFT + 46 /*DEL*/, 'Cut' ],
  97. [ CTRL + 90 /*Z*/, 'Undo' ],
  98. [ CTRL + 89 /*Y*/, 'Redo' ],
  99. [ CTRL + SHIFT + 90 /*Z*/, 'Redo' ],
  100. [ CTRL + 76 /*L*/, 'Link' ],
  101. [ CTRL + 66 /*B*/, 'Bold' ],
  102. [ CTRL + 73 /*I*/, 'Italic' ],
  103. [ CTRL + 85 /*U*/, 'Underline' ],
  104. [ CTRL + SHIFT + 83 /*S*/, 'Save' ],
  105. [ CTRL + ALT + 13 /*ENTER*/, 'FitWindow' ],
  106. [ CTRL + 9 /*TAB*/, 'Source' ]
  107. ] ;
  108. FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','Table','Form'] ;
  109. FCKConfig.BrowserContextMenuOnCtrl = false ;
  110. FCKConfig.EnableMoreFontColors = true ;
  111. FCKConfig.FontColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF' ;
  112. FCKConfig.FontFormats = 'p;h1;h2;h3;h4;h5;h6;pre;address;div' ;
  113. FCKConfig.FontNames = '??;??;??;??;??_GB2312;??_GB2312;????;????;????;Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana;'+'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana;' ;
  114. FCKConfig.FontSizes = '12px;14px;16px;18px;24px;26px;28px;32px;smaller;larger;xx-small;x-small;small;medium;large;x-large;xx-large;' ;
  115. FCKConfig.StylesXmlPath = FCKConfig.EditorPath + 'fckstyles.xml' ;
  116. FCKConfig.TemplatesXmlPath = FCKConfig.EditorPath + 'fcktemplates.xml' ;
  117. FCKConfig.SpellChecker = 'ieSpell' ; // 'ieSpell' | 'SpellerPages'
  118. FCKConfig.IeSpellDownloadUrl = 'http://www.iespell.com/download.php' ;
  119. FCKConfig.SpellerPagesServerScript = 'server-scripts/spellchecker.php' ; // Available extension: .php .cfm .pl
  120. FCKConfig.FirefoxSpellChecker = false ;
  121. FCKConfig.MaxUndoLevels = 15 ;
  122. FCKConfig.DisableObjectResizing = false ;
  123. FCKConfig.DisableFFTableHandles = true ;
  124. FCKConfig.LinkDlgHideTarget = false ;
  125. FCKConfig.LinkDlgHideAdvanced = false ;
  126. FCKConfig.ImageDlgHideLink = false ;
  127. FCKConfig.ImageDlgHideAdvanced = false ;
  128. FCKConfig.FlashDlgHideAdvanced = false ;
  129. FCKConfig.ProtectedTags = '' ;
  130. // This will be applied to the body element of the editor
  131. FCKConfig.BodyId = '' ;
  132. FCKConfig.BodyClass = '' ;
  133. FCKConfig.DefaultStyleLabel = '' ;
  134. FCKConfig.DefaultFontFormatLabel = '' ;
  135. FCKConfig.DefaultFontLabel = '' ;
  136. FCKConfig.DefaultFontSizeLabel = '' ;
  137. FCKConfig.DefaultLinkTarget = '' ;
  138. // The option switches between trying to keep the html structure or do the changes so the content looks like it was in Word
  139. FCKConfig.CleanWordKeepsStructure = false ;
  140. // Only inline elements are valid.
  141. FCKConfig.RemoveFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var' ;
  142. FCKConfig.CustomStyles =
  143. {
  144. 'Red Title' : { Element : 'h3', Styles : { 'color' : 'Red' } }
  145. };
  146. // Do not add, rename or remove styles here. Only apply definition changes.
  147. FCKConfig.CoreStyles =
  148. {
  149. // Basic Inline Styles.
  150. 'Bold' : { Element : 'b', Overrides : 'strong' },
  151. 'Italic' : { Element : 'i', Overrides : 'em' },
  152. 'Underline' : { Element : 'u' },
  153. 'StrikeThrough' : { Element : 'strike' },
  154. 'Subscript' : { Element : 'sub' },
  155. 'Superscript' : { Element : 'sup' },
  156. // Basic Block Styles (Font Format Combo).
  157. 'p' : { Element : 'p' },
  158. 'div' : { Element : 'div' },
  159. 'pre' : { Element : 'pre' },
  160. 'address' : { Element : 'address' },
  161. 'h1' : { Element : 'h1' },
  162. 'h2' : { Element : 'h2' },
  163. 'h3' : { Element : 'h3' },
  164. 'h4' : { Element : 'h4' },
  165. 'h5' : { Element : 'h5' },
  166. 'h6' : { Element : 'h6' },
  167. // Other formatting features.
  168. 'FontFace' :
  169. {
  170. Element : 'span',
  171. Styles : { 'font-family' : '#("Font")' },
  172. Overrides : [ { Element : 'font', Attributes : { 'face' : null } } ]
  173. },
  174. 'Size' :
  175. {
  176. Element : 'span',
  177. Styles : { 'font-size' : '#("Size","fontSize")' },
  178. Overrides : [ { Element : 'font', Attributes : { 'size' : null } } ]
  179. },
  180. 'Color' :
  181. {
  182. Element : 'span',
  183. Styles : { 'color' : '#("Color","color")' },
  184. Overrides : [ { Element : 'font', Attributes : { 'color' : null } } ]
  185. },
  186. 'BackColor' : { Element : 'span', Styles : { 'background-color' : '#("Color","color")' } }
  187. };
  188. // The distance of an indentation step.
  189. FCKConfig.IndentLength = 40 ;
  190. FCKConfig.IndentUnit = 'px' ;
  191. // Alternatively, FCKeditor allows the use of CSS classes for block indentation.
  192. // This overrides the IndentLength/IndentUnit settings.
  193. FCKConfig.IndentClasses = [] ;
  194. // [ Left, Center, Right, Justified ]
  195. FCKConfig.JustifyClasses = [] ;
  196. // The following value defines which File Browser connector and Quick Upload
  197. // "uploader" to use. It is valid for the default implementaion and it is here
  198. // just to make this configuration file cleaner.
  199. // It is not possible to change this value using an external file or even
  200. // inline when creating the editor instance. In that cases you must set the
  201. // values of LinkBrowserURL, ImageBrowserURL and so on.
  202. // Custom implementations should just ignore it.
  203. var _FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
  204. var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
  205. // Don't care about the following two lines. It just calculates the correct connector
  206. // extension to use for the default File Browser (Perl uses "cgi").
  207. var _FileBrowserExtension = _FileBrowserLanguage == 'perl' ? 'cgi' : _FileBrowserLanguage ;
  208. var _QuickUploadExtension = _QuickUploadLanguage == 'perl' ? 'cgi' : _QuickUploadLanguage ;
  209. FCKConfig.LinkBrowser = true ;
  210. FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=../../connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
  211. FCKConfig.LinkBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70%
  212. FCKConfig.LinkBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70%
  213. FCKConfig.ImageBrowser = true ;
  214. FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=../../connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
  215. FCKConfig.ImageBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% ;
  216. FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70% ;
  217. FCKConfig.FlashBrowser = true ;
  218. FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector=../../connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
  219. FCKConfig.FlashBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; //70% ;
  220. FCKConfig.FlashBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; //70% ;
  221. FCKConfig.LinkUpload = true ;
  222. FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension ;
  223. FCKConfig.LinkUploadAllowedExtensions = ".(7z|aiff|asf|avi|bmp|csv|doc|fla|flv|gif|gz|gzip|jpeg|jpg|mid|mov|mp3|mp4|mpc|mpeg|mpg|ods|odt|pdf|png|ppt|pxd|qt|ram|rar|rm|rmi|rmvb|rtf|sdc|sitd|swf|sxc|sxw|tar|tgz|tif|tiff|txt|vsd|wav|wma|wmv|xls|xml|zip)$" ; // empty for all
  224. FCKConfig.LinkUploadDeniedExtensions = "" ; // empty for no one
  225. FCKConfig.ImageUpload = true ;
  226. FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension + '?Type=Image' ;
  227. FCKConfig.ImageUploadAllowedExtensions = ".(jpg|gif|jpeg|png|bmp)$" ; // empty for all
  228. FCKConfig.ImageUploadDeniedExtensions = "" ; // empty for no one
  229. FCKConfig.FlashUpload = true ;
  230. FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension + '?Type=Flash' ;
  231. FCKConfig.FlashUploadAllowedExtensions = ".(swf|flv)$" ; // empty for all
  232. FCKConfig.FlashUploadDeniedExtensions = "" ; // empty for no one
  233. //FCKConfig.MediaUpload = true ;
  234. //FCKConfig.MediaUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension + '?Type=Media' ;
  235. //FCKConfig.MediaUploadAllowedExtensions = ".(aiff|asf|avi|mid|mov|mp3|mp4|mpc|mpeg|mpg|qt|ram|rm|rmi|rmvb|wav|wma|wmv)$" ; // empty for all
  236. //FCKConfig.MediaUploadDeniedExtensions = "" ; // empty for no one
  237. FCKConfig.SmileyPath = FCKConfig.BasePath + 'images/smiley/msn/' ;
  238. FCKConfig.SmileyImages = ['m00.gif','m01.gif','m02.gif','m03.gif','m04.gif','m05.gif','m06.gif','m07.gif','m20.gif','m21.gif','m22.gif','m23.gif','m24.gif','m25.gif','m26.gif','m27.gif','m28.gif','m29.gif','m30.gif','m31.gif','m32.gif','m33.gif','m34.gif','m35.gif','m36.gif','m37.gif','m38.gif','m39.gif','m40.gif','m41.gif','m42.gif','m43.gif','m44.gif','m45.gif','m46.gif','m47.gif','m48.gif','m49.gif','m50.gif','m51.gif','m52.gif','m53.gif','m54.gif','m55.gif','m56.gif','m57.gif','m58.gif','m59.gif','m61.gif','m62.gif','m63.gif','m64.gif','m65.gif','m66.gif','m67.gif','m68.gif','m69.gif','m70.gif','m94.gif','m95.gif','m96.gif','m97.gif','m98.gif','m99.gif'] ;
  239. FCKConfig.SmileyColumns = 8 ;
  240. FCKConfig.SmileyWindowWidth = 400 ;
  241. FCKConfig.SmileyWindowHeight = 340 ;