PageRenderTime 41ms CodeModel.GetById 8ms RepoModel.GetById 1ms app.codeStats 0ms

/fckeditor/fckconfig.js

http://fckeditor-for-wordpress.googlecode.com/
JavaScript | 224 lines | 136 code | 47 blank | 41 comment | 1 complexity | 04ee02a17c61885b6de0e9f3635ad311 MD5 | raw file
Possible License(s): LGPL-2.1
  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. // Disable the custom Enter Key Handler. This option will be removed in version 2.5.
  27. FCKConfig.DisableEnterKeyHandler = false ;
  28. FCKConfig.CustomConfigurationsPath = '' ;
  29. FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ;
  30. FCKConfig.ToolbarComboPreviewCSS = '' ;
  31. FCKConfig.DocType = '' ;
  32. FCKConfig.BaseHref = '' ;
  33. FCKConfig.FullPage = false ;
  34. FCKConfig.Debug = false ;
  35. FCKConfig.AllowQueryStringDebug = true ;
  36. FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;
  37. FCKConfig.PreloadImages = [ FCKConfig.SkinPath + 'images/toolbar.start.gif', FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif' ] ;
  38. FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;
  39. // FCKConfig.Plugins.Add( 'autogrow' ) ;
  40. FCKConfig.AutoGrowMax = 400 ;
  41. // FCKConfig.ProtectedSource.Add( /<%[\s\S]*?%>/g ) ; // ASP style server side code <%...%>
  42. // FCKConfig.ProtectedSource.Add( /<\?[\s\S]*?\?>/g ) ; // PHP style server side code
  43. // FCKConfig.ProtectedSource.Add( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi ) ; // ASP.Net style tags <asp:control>
  44. FCKConfig.AutoDetectLanguage = true ;
  45. FCKConfig.DefaultLanguage = 'en' ;
  46. FCKConfig.ContentLangDirection = 'ltr' ;
  47. FCKConfig.ProcessHTMLEntities = true ;
  48. FCKConfig.IncludeLatinEntities = true ;
  49. FCKConfig.IncludeGreekEntities = true ;
  50. FCKConfig.ProcessNumericEntities = false ;
  51. FCKConfig.AdditionalNumericEntities = '' ; // Single Quote: "'"
  52. FCKConfig.FillEmptyBlocks = true ;
  53. FCKConfig.FormatSource = true ;
  54. FCKConfig.FormatOutput = true ;
  55. FCKConfig.FormatIndentator = ' ' ;
  56. FCKConfig.ForceStrongEm = true ;
  57. FCKConfig.GeckoUseSPAN = false ;
  58. FCKConfig.StartupFocus = false ;
  59. FCKConfig.ForcePasteAsPlainText = false ;
  60. FCKConfig.AutoDetectPasteFromWord = true ; // IE only.
  61. FCKConfig.ForceSimpleAmpersand = false ;
  62. FCKConfig.TabSpaces = 0 ;
  63. FCKConfig.ShowBorders = true ;
  64. FCKConfig.SourcePopup = false ;
  65. FCKConfig.ToolbarStartExpanded = true ;
  66. FCKConfig.ToolbarCanCollapse = true ;
  67. FCKConfig.IgnoreEmptyParagraphValue = true ;
  68. FCKConfig.PreserveSessionOnFileBrowser = false ;
  69. FCKConfig.FloatingPanelsZIndex = 10000 ;
  70. FCKConfig.TemplateReplaceAll = true ;
  71. FCKConfig.TemplateReplaceCheckbox = true ;
  72. FCKConfig.ToolbarLocation = 'In' ;
  73. FCKConfig.ToolbarSets["Default"] = [
  74. ['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
  75. ['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
  76. ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
  77. ['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
  78. '/',
  79. ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
  80. ['OrderedList','UnorderedList','-','Outdent','Indent'],
  81. ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
  82. ['Link','Unlink','Anchor'],
  83. ['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
  84. '/',
  85. ['Style','FontFormat','FontName','FontSize'],
  86. ['TextColor','BGColor'],
  87. ['FitWindow','-','About']
  88. ] ;
  89. FCKConfig.ToolbarSets["Basic"] = [
  90. ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
  91. ] ;
  92. FCKConfig.EnterMode = 'p' ; // p | div | br
  93. FCKConfig.ShiftEnterMode = 'br' ; // p | div | br
  94. FCKConfig.Keystrokes = [
  95. [ CTRL + 65 /*A*/, true ],
  96. [ CTRL + 67 /*C*/, true ],
  97. [ CTRL + 70 /*F*/, true ],
  98. [ CTRL + 83 /*S*/, true ],
  99. [ CTRL + 88 /*X*/, true ],
  100. [ CTRL + 86 /*V*/, 'Paste' ],
  101. [ SHIFT + 45 /*INS*/, 'Paste' ],
  102. [ CTRL + 90 /*Z*/, 'Undo' ],
  103. [ CTRL + 89 /*Y*/, 'Redo' ],
  104. [ CTRL + SHIFT + 90 /*Z*/, 'Redo' ],
  105. [ CTRL + 76 /*L*/, 'Link' ],
  106. [ CTRL + 66 /*B*/, 'Bold' ],
  107. [ CTRL + 73 /*I*/, 'Italic' ],
  108. [ CTRL + 85 /*U*/, 'Underline' ],
  109. [ CTRL + SHIFT + 83 /*S*/, 'Save' ],
  110. [ CTRL + ALT + 13 /*ENTER*/, 'FitWindow' ],
  111. [ CTRL + 9 /*TAB*/, 'Source' ]
  112. ] ;
  113. FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','Table','Form'] ;
  114. 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' ;
  115. FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
  116. FCKConfig.FontSizes = '1/xx-small;2/x-small;3/small;4/medium;5/large;6/x-large;7/xx-large' ;
  117. FCKConfig.FontFormats = 'p;div;pre;address;h1;h2;h3;h4;h5;h6' ;
  118. FCKConfig.StylesXmlPath = FCKConfig.EditorPath + 'fckstyles.xml' ;
  119. FCKConfig.TemplatesXmlPath = FCKConfig.EditorPath + 'fcktemplates.xml' ;
  120. FCKConfig.SpellChecker = 'ieSpell' ; // 'ieSpell' | 'SpellerPages'
  121. FCKConfig.IeSpellDownloadUrl = 'http://www.iespell.com/download.php' ;
  122. FCKConfig.SpellerPagesServerScript = 'server-scripts/spellchecker.php' ; // Available extension: .php .cfm .pl
  123. FCKConfig.MaxUndoLevels = 15 ;
  124. FCKConfig.DisableObjectResizing = false ;
  125. FCKConfig.DisableFFTableHandles = true ;
  126. FCKConfig.LinkDlgHideTarget = false ;
  127. FCKConfig.LinkDlgHideAdvanced = false ;
  128. FCKConfig.ImageDlgHideLink = false ;
  129. FCKConfig.ImageDlgHideAdvanced = false ;
  130. FCKConfig.FlashDlgHideAdvanced = false ;
  131. FCKConfig.ProtectedTags = '' ;
  132. // This will be applied to the body element of the editor
  133. FCKConfig.BodyId = '' ;
  134. FCKConfig.BodyClass = '' ;
  135. // The option switches between trying to keep the html structure or do the changes so the content looks like it was in Word
  136. FCKConfig.CleanWordKeepsStructure = false ;
  137. // The following value defines which File Browser connector and Quick Upload
  138. // "uploader" to use. It is valid for the default implementaion and it is here
  139. // just to make this configuration file cleaner.
  140. // It is not possible to change this value using an external file or even
  141. // inline when creating the editor instance. In that cases you must set the
  142. // values of LinkBrowserURL, ImageBrowserURL and so on.
  143. // Custom implementations should just ignore it.
  144. var _FileBrowserLanguage = 'asp' ; // asp | aspx | cfm | lasso | perl | php | py
  145. var _QuickUploadLanguage = 'asp' ; // asp | aspx | cfm | lasso | php
  146. // Don't care about the following line. It just calculates the correct connector
  147. // extension to use for the default File Browser (Perl uses "cgi").
  148. var _FileBrowserExtension = _FileBrowserLanguage == 'perl' ? 'cgi' : _FileBrowserLanguage ;
  149. FCKConfig.LinkBrowser = true ;
  150. FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
  151. FCKConfig.LinkBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70%
  152. FCKConfig.LinkBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70%
  153. FCKConfig.ImageBrowser = true ;
  154. FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
  155. FCKConfig.ImageBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70% ;
  156. FCKConfig.ImageBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70% ;
  157. FCKConfig.FlashBrowser = true ;
  158. FCKConfig.FlashBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/' + _FileBrowserLanguage + '/connector.' + _FileBrowserExtension ;
  159. FCKConfig.FlashBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; //70% ;
  160. FCKConfig.FlashBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; //70% ;
  161. FCKConfig.LinkUpload = true ;
  162. FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage ;
  163. FCKConfig.LinkUploadAllowedExtensions = "" ; // empty for all
  164. FCKConfig.LinkUploadDeniedExtensions = ".(html|htm|php|php2|php3|php4|php5|phtml|pwml|inc|asp|aspx|ascx|jsp|cfm|cfc|pl|bat|exe|com|dll|vbs|js|reg|cgi|htaccess|asis)$" ; // empty for no one
  165. FCKConfig.ImageUpload = true ;
  166. FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=Image' ;
  167. FCKConfig.ImageUploadAllowedExtensions = ".(jpg|gif|jpeg|png|bmp)$" ; // empty for all
  168. FCKConfig.ImageUploadDeniedExtensions = "" ; // empty for no one
  169. FCKConfig.FlashUpload = true ;
  170. FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/upload/' + _QuickUploadLanguage + '/upload.' + _QuickUploadLanguage + '?Type=Flash' ;
  171. FCKConfig.FlashUploadAllowedExtensions = ".(swf|fla)$" ; // empty for all
  172. FCKConfig.FlashUploadDeniedExtensions = "" ; // empty for no one
  173. FCKConfig.SmileyPath = FCKConfig.BasePath + 'images/smiley/msn/' ;
  174. 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'] ;
  175. FCKConfig.SmileyColumns = 8 ;
  176. FCKConfig.SmileyWindowWidth = 320 ;
  177. FCKConfig.SmileyWindowHeight = 240 ;