PageRenderTime 44ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/fckeditor/fckconfig.js

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