PageRenderTime 36ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/fckeditor/fckconfig.js

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