Ticket #1966: fckconfig.js

File fckconfig.js, 14.4 KB (added by Said Bakr, 17 years ago)

The editor javascript config

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