PageRenderTime 41ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/eeplat/WebContent/FCKeditor/fckconfig.js

http://eeplat.googlecode.com/
JavaScript | 327 lines | 207 code | 65 blank | 55 comment | 2 complexity | 27c3ae07b5622bb3c09a1e6354e21229 MD5 | raw file
Possible License(s): GPL-2.0, MIT, LGPL-2.1
  1. /*
  2. * FCKeditor - The text editor for Internet - http://www.fckeditor.net
  3. * Copyright (C) 2003-2010 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://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options
  25. */
  26. FCKConfig.CustomConfigurationsPath = '' ;
  27. /*
  28. FCKConfig.BasePath = 'FCKeditor/' ;
  29. */
  30. FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ;
  31. FCKConfig.EditorAreaStyles = '' ;
  32. FCKConfig.ToolbarComboPreviewCSS = '' ;
  33. FCKConfig.DocType = '' ;
  34. FCKConfig.BaseHref = '' ;
  35. FCKConfig.FullPage = false ;
  36. // The following option determines whether the "Show Blocks" feature is enabled or not at startup.
  37. FCKConfig.StartupShowBlocks = false ;
  38. FCKConfig.Debug = false ;
  39. FCKConfig.AllowQueryStringDebug = true ;
  40. FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;
  41. FCKConfig.SkinEditorCSS = '' ; // FCKConfig.SkinPath + "|<minified css>" ;
  42. FCKConfig.SkinDialogCSS = '' ; // FCKConfig.SkinPath + "|<minified css>" ;
  43. FCKConfig.PreloadImages = [ FCKConfig.SkinPath + 'images/toolbar.start.gif', FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif' ] ;
  44. FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;
  45. // FCKConfig.Plugins.Add( 'autogrow' ) ;
  46. // FCKConfig.Plugins.Add( 'dragresizetable' );
  47. FCKConfig.AutoGrowMax = 400 ;
  48. // FCKConfig.ProtectedSource.Add( /<%[\s\S]*?%>/g ) ; // ASP style server side code <%...%>
  49. // FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ; // PHP style server side code
  50. // FCKConfig.ProtectedSource.Add( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi ) ; // ASP.Net style tags <asp:control>
  51. FCKConfig.AutoDetectLanguage = false ;
  52. FCKConfig.DefaultLanguage = 'zh-cn' ;
  53. FCKConfig.ContentLangDirection = 'ltr' ;
  54. FCKConfig.ProcessHTMLEntities = true ;
  55. FCKConfig.IncludeLatinEntities = true ;
  56. FCKConfig.IncludeGreekEntities = true ;
  57. FCKConfig.ProcessNumericEntities = false ;
  58. FCKConfig.AdditionalNumericEntities = '' ; // Single Quote: "'"
  59. FCKConfig.FillEmptyBlocks = true ;
  60. FCKConfig.FormatSource = true ;
  61. FCKConfig.FormatOutput = true ;
  62. FCKConfig.FormatIndentator = ' ' ;
  63. FCKConfig.EMailProtection = 'none' ; // none | encode | function
  64. FCKConfig.EMailProtectionFunction = 'mt(NAME,DOMAIN,SUBJECT,BODY)' ;
  65. FCKConfig.StartupFocus = false ;
  66. FCKConfig.ForcePasteAsPlainText = false ;
  67. FCKConfig.AutoDetectPasteFromWord = true ; // IE only.
  68. FCKConfig.ShowDropDialog = true ;
  69. FCKConfig.ForceSimpleAmpersand = false ;
  70. FCKConfig.TabSpaces = 0 ;
  71. FCKConfig.ShowBorders = true ;
  72. FCKConfig.SourcePopup = false ;
  73. FCKConfig.ToolbarStartExpanded = true ;
  74. FCKConfig.ToolbarCanCollapse = true ;
  75. FCKConfig.IgnoreEmptyParagraphValue = true ;
  76. FCKConfig.FloatingPanelsZIndex = 10000 ;
  77. FCKConfig.HtmlEncodeOutput = false ;
  78. FCKConfig.TemplateReplaceAll = true ;
  79. FCKConfig.TemplateReplaceCheckbox = true ;
  80. FCKConfig.ToolbarLocation = 'In' ;
  81. FCKConfig.ToolbarSets["Default"] = [
  82. ['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
  83. ['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
  84. ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
  85. ['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
  86. '/',
  87. ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
  88. ['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'],
  89. ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
  90. ['Link','Unlink','Anchor'],
  91. ['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
  92. '/',
  93. ['Style','FontFormat','FontName','FontSize'],
  94. ['TextColor','BGColor'],
  95. ['FitWindow','ShowBlocks','-','About'] // No comma for the last row.
  96. ] ;
  97. FCKConfig.ToolbarSets["Basic"] = [
  98. ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
  99. ] ;
  100. FCKConfig.EnterMode = 'p' ; // p | div | br
  101. FCKConfig.ShiftEnterMode = 'br' ; // p | div | br
  102. FCKConfig.Keystrokes = [
  103. [ CTRL + 65 /*A*/, true ],
  104. [ CTRL + 67 /*C*/, true ],
  105. [ CTRL + 70 /*F*/, true ],
  106. [ CTRL + 83 /*S*/, true ],
  107. [ CTRL + 84 /*T*/, true ],
  108. [ CTRL + 88 /*X*/, true ],
  109. [ CTRL + 86 /*V*/, 'Paste' ],
  110. [ CTRL + 45 /*INS*/, true ],
  111. [ SHIFT + 45 /*INS*/, 'Paste' ],
  112. [ CTRL + 88 /*X*/, 'Cut' ],
  113. [ SHIFT + 46 /*DEL*/, 'Cut' ],
  114. [ CTRL + 90 /*Z*/, 'Undo' ],
  115. [ CTRL + 89 /*Y*/, 'Redo' ],
  116. [ CTRL + SHIFT + 90 /*Z*/, 'Redo' ],
  117. [ CTRL + 76 /*L*/, 'Link' ],
  118. [ CTRL + 66 /*B*/, 'Bold' ],
  119. [ CTRL + 73 /*I*/, 'Italic' ],
  120. [ CTRL + 85 /*U*/, 'Underline' ],
  121. [ CTRL + SHIFT + 83 /*S*/, 'Save' ],
  122. [ CTRL + ALT + 13 /*ENTER*/, 'FitWindow' ],
  123. [ SHIFT + 32 /*SPACE*/, 'Nbsp' ]
  124. ] ;
  125. FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','Table','Form','DivContainer'] ;
  126. FCKConfig.BrowserContextMenuOnCtrl = false ;
  127. FCKConfig.BrowserContextMenu = false ;
  128. FCKConfig.EnableMoreFontColors = true ;
  129. 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' ;
  130. FCKConfig.FontFormats = 'p;h1;h2;h3;h4;h5;h6;pre;address;div' ;
  131. FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
  132. FCKConfig.FontSizes = 'smaller;larger;xx-small;x-small;small;medium;large;x-large;xx-large' ;
  133. FCKConfig.StylesXmlPath = FCKConfig.EditorPath + 'fckstyles.xml' ;
  134. FCKConfig.TemplatesXmlPath = FCKConfig.EditorPath + 'fcktemplates.xml' ;
  135. FCKConfig.SpellChecker = 'WSC' ; // 'WSC' | 'SCAYT' | 'SpellerPages' | 'ieSpell'
  136. FCKConfig.IeSpellDownloadUrl = 'http://www.iespell.com/download.php' ;
  137. FCKConfig.SpellerPagesServerScript = 'server-scripts/spellchecker.php' ; // Available extension: .php .cfm .pl
  138. FCKConfig.FirefoxSpellChecker = false ;
  139. FCKConfig.MaxUndoLevels = 15 ;
  140. FCKConfig.DisableObjectResizing = false ;
  141. FCKConfig.DisableFFTableHandles = true ;
  142. FCKConfig.LinkDlgHideTarget = false ;
  143. FCKConfig.LinkDlgHideAdvanced = false ;
  144. FCKConfig.ImageDlgHideLink = false ;
  145. FCKConfig.ImageDlgHideAdvanced = false ;
  146. FCKConfig.FlashDlgHideAdvanced = false ;
  147. FCKConfig.ProtectedTags = '' ;
  148. // This will be applied to the body element of the editor
  149. FCKConfig.BodyId = '' ;
  150. FCKConfig.BodyClass = '' ;
  151. FCKConfig.DefaultStyleLabel = '' ;
  152. FCKConfig.DefaultFontFormatLabel = '' ;
  153. FCKConfig.DefaultFontLabel = '' ;
  154. FCKConfig.DefaultFontSizeLabel = '' ;
  155. FCKConfig.DefaultLinkTarget = '' ;
  156. // The option switches between trying to keep the html structure or do the changes so the content looks like it was in Word
  157. FCKConfig.CleanWordKeepsStructure = false ;
  158. // Only inline elements are valid.
  159. FCKConfig.RemoveFormatTags = 'b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var' ;
  160. // Attributes that will be removed
  161. FCKConfig.RemoveAttributes = 'class,style,lang,width,height,align,hspace,valign' ;
  162. FCKConfig.CustomStyles =
  163. {
  164. 'Red Title' : { Element : 'h3', Styles : { 'color' : 'Red' } }
  165. };
  166. // Do not add, rename or remove styles here. Only apply definition changes.
  167. FCKConfig.CoreStyles =
  168. {
  169. // Basic Inline Styles.
  170. 'Bold' : { Element : 'strong', Overrides : 'b' },
  171. 'Italic' : { Element : 'em', Overrides : 'i' },
  172. 'Underline' : { Element : 'u' },
  173. 'StrikeThrough' : { Element : 'strike' },
  174. 'Subscript' : { Element : 'sub' },
  175. 'Superscript' : { Element : 'sup' },
  176. // Basic Block Styles (Font Format Combo).
  177. 'p' : { Element : 'p' },
  178. 'div' : { Element : 'div' },
  179. 'pre' : { Element : 'pre' },
  180. 'address' : { Element : 'address' },
  181. 'h1' : { Element : 'h1' },
  182. 'h2' : { Element : 'h2' },
  183. 'h3' : { Element : 'h3' },
  184. 'h4' : { Element : 'h4' },
  185. 'h5' : { Element : 'h5' },
  186. 'h6' : { Element : 'h6' },
  187. // Other formatting features.
  188. 'FontFace' :
  189. {
  190. Element : 'span',
  191. Styles : { 'font-family' : '#("Font")' },
  192. Overrides : [ { Element : 'font', Attributes : { 'face' : null } } ]
  193. },
  194. 'Size' :
  195. {
  196. Element : 'span',
  197. Styles : { 'font-size' : '#("Size","fontSize")' },
  198. Overrides : [ { Element : 'font', Attributes : { 'size' : null } } ]
  199. },
  200. 'Color' :
  201. {
  202. Element : 'span',
  203. Styles : { 'color' : '#("Color","color")' },
  204. Overrides : [ { Element : 'font', Attributes : { 'color' : null } } ]
  205. },
  206. 'BackColor' : { Element : 'span', Styles : { 'background-color' : '#("Color","color")' } },
  207. 'SelectionHighlight' : { Element : 'span', Styles : { 'background-color' : 'navy', 'color' : 'white' } }
  208. };
  209. // The distance of an indentation step.
  210. FCKConfig.IndentLength = 40 ;
  211. FCKConfig.IndentUnit = 'px' ;
  212. // Alternatively, FCKeditor allows the use of CSS classes for block indentation.
  213. // This overrides the IndentLength/IndentUnit settings.
  214. FCKConfig.IndentClasses = [] ;
  215. // [ Left, Center, Right, Justified ]
  216. FCKConfig.JustifyClasses = [] ;
  217. // The following value defines which File Browser connector and Quick Upload
  218. // "uploader" to use. It is valid for the default implementaion and it is here
  219. // just to make this configuration file cleaner.
  220. // It is not possible to change this value using an external file or even
  221. // inline when creating the editor instance. In that cases you must set the
  222. // values of LinkBrowserURL, ImageBrowserURL and so on.
  223. // Custom implementations should just ignore it.
  224. var _FileBrowserLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
  225. var _QuickUploadLanguage = 'php' ; // asp | aspx | cfm | lasso | perl | php | py
  226. // Don't care about the following two lines. It just calculates the correct connector
  227. // extension to use for the default File Browser (Perl uses "cgi").
  228. var _FileBrowserExtension = _FileBrowserLanguage == 'perl' ? 'cgi' : _FileBrowserLanguage ;
  229. var _QuickUploadExtension = _QuickUploadLanguage == 'perl' ? 'cgi' : _QuickUploadLanguage ;
  230. FCKConfig.LinkBrowser = true ;
  231. FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=' + encodeURIComponent( FCKConfig.BasePath + 'filemanager/connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ) ;
  232. FCKConfig.LinkBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70%
  233. FCKConfig.LinkBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70%
  234. FCKConfig.ImageBrowser = true ;
  235. FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=' + encodeURIComponent( FCKConfig.BasePath + 'filemanager/connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ) ;
  236. FCKConfig.ImageBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% ;
  237. FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70% ;
  238. FCKConfig.FlashBrowser = true ;
  239. FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector=' + encodeURIComponent( FCKConfig.BasePath + 'filemanager/connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ) ;
  240. FCKConfig.FlashBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; //70% ;
  241. FCKConfig.FlashBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; //70% ;
  242. FCKConfig.LinkUpload = true ;
  243. FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension ;
  244. 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
  245. FCKConfig.LinkUploadDeniedExtensions = "" ; // empty for no one
  246. FCKConfig.ImageUpload = true ;
  247. FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension + '?Type=Image' ;
  248. FCKConfig.ImageUploadAllowedExtensions = ".(jpg|gif|jpeg|png|bmp)$" ; // empty for all
  249. FCKConfig.ImageUploadDeniedExtensions = "" ; // empty for no one
  250. FCKConfig.FlashUpload = true ;
  251. FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/connectors/' + _QuickUploadLanguage + '/upload.' + _QuickUploadExtension + '?Type=Flash' ;
  252. FCKConfig.FlashUploadAllowedExtensions = ".(swf|flv)$" ; // empty for all
  253. FCKConfig.FlashUploadDeniedExtensions = "" ; // empty for no one
  254. FCKConfig.SmileyPath = FCKConfig.BasePath + 'images/smiley/msn/' ;
  255. FCKConfig.SmileyImages = ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ;
  256. FCKConfig.SmileyColumns = 8 ;
  257. FCKConfig.SmileyWindowWidth = 320 ;
  258. FCKConfig.SmileyWindowHeight = 210 ;
  259. FCKConfig.BackgroundBlockerColor = '#ffffff' ;
  260. FCKConfig.BackgroundBlockerOpacity = 0.50 ;
  261. FCKConfig.MsWebBrowserControlCompat = false ;
  262. FCKConfig.PreventSubmitHandler = false ;