JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
a408d9348e901d62afe0f4b308cdee8f8b8cef5f
[ckeditor.git] / _source / core / config.js
1 /*\r
2 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.\r
3 For licensing, see LICENSE.html or http://ckeditor.com/license\r
4 */\r
5 \r
6 /**\r
7  * @fileOverview Defines the {@link CKEDITOR.config} object, which holds the\r
8  * default configuration settings.\r
9  */\r
10 \r
11 /**\r
12  * Used in conjuction with {@link CKEDITOR.config.enterMode} and\r
13  * {@link CKEDITOR.config.shiftEnterMode} to make the editor produce <p>\r
14  * tags when using the ENTER key.\r
15  * @constant\r
16  */\r
17 CKEDITOR.ENTER_P        = 1;\r
18 \r
19 /**\r
20  * Used in conjuction with {@link CKEDITOR.config.enterMode} and\r
21  * {@link CKEDITOR.config.shiftEnterMode} to make the editor produce <br>\r
22  * tags when using the ENTER key.\r
23  * @constant\r
24  */\r
25 CKEDITOR.ENTER_BR       = 2;\r
26 \r
27 /**\r
28  * Used in conjuction with {@link CKEDITOR.config.enterMode} and\r
29  * {@link CKEDITOR.config.shiftEnterMode} to make the editor produce <div>\r
30  * tags when using the ENTER key.\r
31  * @constant\r
32  */\r
33 CKEDITOR.ENTER_DIV      = 3;\r
34 \r
35 /**\r
36  * @namespace Holds the default configuration settings. Changes to this object are\r
37  * reflected in all editor instances, if not specificaly specified for those\r
38  * instances.\r
39  */\r
40 CKEDITOR.config =\r
41 {\r
42         /**\r
43          * The URL path for the custom configuration file to be loaded. If not\r
44          * overloaded with inline configurations, it defaults to the "config.js"\r
45          * file present in the root of the CKEditor installation directory.<br /><br />\r
46          *\r
47          * CKEditor will recursively load custom configuration files defined inside\r
48          * other custom configuration files.\r
49          * @type String\r
50          * @default '&lt;CKEditor folder&gt;/config.js'\r
51          * @example\r
52          * // Load a specific configuration file.\r
53          * CKEDITOR.replace( 'myfiled', { customConfig : '/myconfig.js' } );\r
54          * @example\r
55          * // Do not load any custom configuration file.\r
56          * CKEDITOR.replace( 'myfiled', { customConfig : '' } );\r
57          */\r
58         customConfig : 'config.js',\r
59 \r
60         /**\r
61          * Whether the replaced element (usually a textarea) is to be updated\r
62          * automatically when posting the form containing the editor.\r
63          * @type Boolean\r
64          * @default true\r
65          * @example\r
66          * config.autoUpdateElement = true;\r
67          */\r
68         autoUpdateElement : true,\r
69 \r
70         /**\r
71          * The base href URL used to resolve relative and absolute URLs in the\r
72          * editor content.\r
73          * @type String\r
74          * @default '' (empty)\r
75          * @example\r
76          * config.baseHref = 'http://www.example.com/path/';\r
77          */\r
78         baseHref : '',\r
79 \r
80         /**\r
81          * The CSS file(s) to be used to apply style to the contents. It should\r
82          * reflect the CSS used in the final pages where the contents are to be\r
83          * used.\r
84          * @type String|Array\r
85          * @default '&lt;CKEditor folder&gt;/contents.css'\r
86          * @example\r
87          * config.contentsCss = '/css/mysitestyles.css';\r
88          * config.contentsCss = ['/css/mysitestyles.css', '/css/anotherfile.css'];\r
89          */\r
90         contentsCss : CKEDITOR.basePath + 'contents.css',\r
91 \r
92         /**\r
93          * The writting direction of the language used to write the editor\r
94          * contents. Allowed values are:\r
95          * <ul>\r
96          *     <li>'ui' - which indicate content direction will be the same with the user interface language direction;</li>\r
97          *     <li>'ltr' - for Left-To-Right language (like English);</li>\r
98          *     <li>'rtl' - for Right-To-Left languages (like Arabic).</li>\r
99          * </ul>\r
100          * @default 'ui'\r
101          * @type String\r
102          * @example\r
103          * config.contentsLangDirection = 'rtl';\r
104          */\r
105         contentsLangDirection : 'ui',\r
106 \r
107         /**\r
108          * Language code of  the writting language which is used to author the editor\r
109          * contents.\r
110          * @default Same value with editor's UI language.\r
111          * @type String\r
112          * @example\r
113          * config.contentsLanguage = 'fr';\r
114          */\r
115         contentsLanguage : '',\r
116 \r
117         /**\r
118          * The user interface language localization to use. If empty, the editor\r
119          * automatically localize the editor to the user language, if supported,\r
120          * otherwise the {@link CKEDITOR.config.defaultLanguage} language is used.\r
121          * @default '' (empty)\r
122          * @type String\r
123          * @example\r
124          * // Load the German interface.\r
125          * config.language = 'de';\r
126          */\r
127         language : '',\r
128 \r
129         /**\r
130          * The language to be used if {@link CKEDITOR.config.language} is left empty and it's not\r
131          * possible to localize the editor to the user language.\r
132          * @default 'en'\r
133          * @type String\r
134          * @example\r
135          * config.defaultLanguage = 'it';\r
136          */\r
137         defaultLanguage : 'en',\r
138 \r
139         /**\r
140          * Sets the behavior for the ENTER key. It also dictates other behaviour\r
141          * rules in the editor, like whether the &lt;br&gt; element is to be used\r
142          * as a paragraph separator when indenting text.\r
143          * The allowed values are the following constants, and their relative\r
144          * behavior:\r
145          * <ul>\r
146          *     <li>{@link CKEDITOR.ENTER_P} (1): new &lt;p&gt; paragraphs are created;</li>\r
147          *     <li>{@link CKEDITOR.ENTER_BR} (2): lines are broken with &lt;br&gt; elements;</li>\r
148          *     <li>{@link CKEDITOR.ENTER_DIV} (3): new &lt;div&gt; blocks are created.</li>\r
149          * </ul>\r
150          * <strong>Note</strong>: It's recommended to use the\r
151          * {@link CKEDITOR.ENTER_P} value because of its semantic value and\r
152          * correctness. The editor is optimized for this value.\r
153          * @type Number\r
154          * @default {@link CKEDITOR.ENTER_P}\r
155          * @example\r
156          * // Not recommended.\r
157          * config.enterMode = CKEDITOR.ENTER_BR;\r
158          */\r
159         enterMode : CKEDITOR.ENTER_P,\r
160 \r
161         /**\r
162          * Force the respect of {@link CKEDITOR.config.enterMode} as line break regardless of the context,\r
163          * E.g. If {@link CKEDITOR.config.enterMode} is set to {@link CKEDITOR.ENTER_P},\r
164          * press enter key inside a 'div' will create a new paragraph with 'p' instead of 'div'.\r
165          * @since 3.2.1\r
166          * @default false\r
167          * @example\r
168          * // Not recommended.\r
169          * config.forceEnterMode = true;\r
170          */\r
171         forceEnterMode : false,\r
172 \r
173         /**\r
174          * Just like the {@link CKEDITOR.config.enterMode} setting, it defines the behavior for the SHIFT+ENTER key.\r
175          * The allowed values are the following constants, and their relative\r
176          * behavior:\r
177          * <ul>\r
178          *     <li>{@link CKEDITOR.ENTER_P} (1): new &lt;p&gt; paragraphs are created;</li>\r
179          *     <li>{@link CKEDITOR.ENTER_BR} (2): lines are broken with &lt;br&gt; elements;</li>\r
180          *     <li>{@link CKEDITOR.ENTER_DIV} (3): new &lt;div&gt; blocks are created.</li>\r
181          * </ul>\r
182          * @type Number\r
183          * @default {@link CKEDITOR.ENTER_BR}\r
184          * @example\r
185          * config.shiftEnterMode = CKEDITOR.ENTER_P;\r
186          */\r
187         shiftEnterMode : CKEDITOR.ENTER_BR,\r
188 \r
189         /**\r
190          * A comma separated list of plugins that are not related to editor\r
191          * instances. Reserved to plugins that extend the core code only.<br /><br />\r
192          *\r
193          * There are no ways to override this setting, except by editing the source\r
194          * code of CKEditor (_source/core/config.js).\r
195          * @type String\r
196          * @example\r
197          */\r
198         corePlugins : '',\r
199 \r
200         /**\r
201          * Sets the doctype to be used when loading the editor content as HTML.\r
202          * @type String\r
203          * @default '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;'\r
204          * @example\r
205          * // Set the doctype to the HTML 4 (quirks) mode.\r
206          * config.docType = '&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;';\r
207          */\r
208         docType : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',\r
209 \r
210         /**\r
211          * Sets the "id" attribute to be used on the body element of the editing\r
212          * area. This can be useful when reusing the original CSS file you're using\r
213          * on your live website and you want to assing to the editor the same id\r
214          * you're using for the region that'll hold the contents. In this way,\r
215          * id specific CSS rules will be enabled.\r
216          * @since 3.1\r
217          * @type String\r
218          * @default '' (empty)\r
219          * @example\r
220          * config.bodyId = 'contents_id';\r
221          */\r
222         bodyId : '',\r
223 \r
224         /**\r
225          * Sets the "class" attribute to be used on the body element of the editing\r
226          * area. This can be useful when reusing the original CSS file you're using\r
227          * on your live website and you want to assing to the editor the same class\r
228          * name you're using for the region that'll hold the contents. In this way,\r
229          * class specific CSS rules will be enabled.\r
230          * @since 3.1\r
231          * @type String\r
232          * @default '' (empty)\r
233          * @example\r
234          * config.bodyClass = 'contents';\r
235          */\r
236         bodyClass : '',\r
237 \r
238         /**\r
239          * Indicates whether the contents to be edited are being inputted as a full\r
240          * HTML page. A full page includes the &lt;html&gt;, &lt;head&gt; and\r
241          * &lt;body&gt; tags. The final output will also reflect this setting,\r
242          * including the &lt;body&gt; contents only if this setting is disabled.\r
243          * @since 3.1\r
244          * @type Boolean\r
245          * @default false\r
246          * @example\r
247          * config.fullPage = true;\r
248          */\r
249         fullPage : false,\r
250 \r
251         /**\r
252          * The height of editing area( content ), in relative or absolute, e.g. 30px, 5em.\r
253          * Note: Percentage unit is not supported yet. e.g. 30%.\r
254          * @type Number|String\r
255          * @default '200'\r
256          * @example\r
257          * config.height = 500;\r
258          * config.height = '25em';\r
259          * config.height = '300px';\r
260          */\r
261         height : 200,\r
262 \r
263         /**\r
264          * Comma separated list of plugins to load and initialize for an editor\r
265          * instance. This should be rarely changed, using instead the\r
266          * {@link CKEDITOR.config.extraPlugins} and\r
267          * {@link CKEDITOR.config.removePlugins} for customizations.\r
268          * @type String\r
269          * @example\r
270          */\r
271         plugins :\r
272                 'about,' +\r
273                 'a11yhelp,' +\r
274                 'basicstyles,' +\r
275                 'bidi,' +\r
276                 'blockquote,' +\r
277                 'button,' +\r
278                 'clipboard,' +\r
279                 'colorbutton,' +\r
280                 'colordialog,' +\r
281                 'contextmenu,' +\r
282                 'dialogadvtab,' +\r
283                 'div,' +\r
284                 'elementspath,' +\r
285                 'enterkey,' +\r
286                 'entities,' +\r
287                 'filebrowser,' +\r
288                 'find,' +\r
289                 'flash,' +\r
290                 'font,' +\r
291                 'format,' +\r
292                 'forms,' +\r
293                 'horizontalrule,' +\r
294                 'htmldataprocessor,' +\r
295                 'image,' +\r
296                 'indent,' +\r
297                 'justify,' +\r
298                 'keystrokes,' +\r
299                 'link,' +\r
300                 'list,' +\r
301                 'liststyle,' +\r
302                 'maximize,' +\r
303                 'newpage,' +\r
304                 'pagebreak,' +\r
305                 'pastefromword,' +\r
306                 'pastetext,' +\r
307                 'popup,' +\r
308                 'preview,' +\r
309                 'print,' +\r
310                 'removeformat,' +\r
311                 'resize,' +\r
312                 'save,' +\r
313                 'scayt,' +\r
314                 'smiley,' +\r
315                 'showblocks,' +\r
316                 'showborders,' +\r
317                 'sourcearea,' +\r
318                 'stylescombo,' +\r
319                 'table,' +\r
320                 'tabletools,' +\r
321                 'specialchar,' +\r
322                 'tab,' +\r
323                 'templates,' +\r
324                 'toolbar,' +\r
325                 'undo,' +\r
326                 'wysiwygarea,' +\r
327                 'wsc',\r
328 \r
329         /**\r
330          * List of additional plugins to be loaded. This is a tool setting which\r
331          * makes it easier to add new plugins, whithout having to touch and\r
332          * possibly breaking the {@link CKEDITOR.config.plugins} setting.\r
333          * @type String\r
334          * @example\r
335          * config.extraPlugins = 'myplugin,anotherplugin';\r
336          */\r
337         extraPlugins : '',\r
338 \r
339         /**\r
340          * List of plugins that must not be loaded. This is a tool setting which\r
341          * makes it easier to avoid loading plugins definied in the\r
342          * {@link CKEDITOR.config.plugins} setting, whithout having to touch it and\r
343          * potentially breaking it.\r
344          * @type String\r
345          * @example\r
346          * config.removePlugins = 'elementspath,save,font';\r
347          */\r
348         removePlugins : '',\r
349 \r
350         /**\r
351          * List of regular expressions to be executed over the input HTML,\r
352          * indicating code that must stay untouched.\r
353          * @type Array\r
354          * @default [] (empty array)\r
355          * @example\r
356          * config.protectedSource.push( /<\?[\s\S]*?\?>/g );   // PHP Code\r
357          * config.protectedSource.push( /<%[\s\S]*?%>/g );   // ASP Code\r
358          * config.protectedSource.push( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi );   // ASP.Net Code\r
359          */\r
360         protectedSource : [],\r
361 \r
362         /**\r
363          * The editor tabindex value.\r
364          * @type Number\r
365          * @default 0 (zero)\r
366          * @example\r
367          * config.tabIndex = 1;\r
368          */\r
369         tabIndex : 0,\r
370 \r
371         /**\r
372          * The theme to be used to build the UI.\r
373          * @type String\r
374          * @default 'default'\r
375          * @see CKEDITOR.config.skin\r
376          * @example\r
377          * config.theme = 'default';\r
378          */\r
379         theme : 'default',\r
380 \r
381         /**\r
382          * The skin to load. It may be the name of the skin folder inside the\r
383          * editor installation path, or the name and the path separated by a comma.\r
384          * @type String\r
385          * @default 'default'\r
386          * @example\r
387          * config.skin = 'v2';\r
388          * @example\r
389          * config.skin = 'myskin,/customstuff/myskin/';\r
390          */\r
391         skin : 'kama',\r
392 \r
393         /**\r
394          * The editor width in CSS size format or pixel integer.\r
395          * @type String|Number\r
396          * @default '' (empty)\r
397          * @example\r
398          * config.width = 850;\r
399          * @example\r
400          * config.width = '75%';\r
401          */\r
402         width : '',\r
403 \r
404         /**\r
405          * The base Z-index for floating dialogs and popups.\r
406          * @type Number\r
407          * @default 10000\r
408          * @example\r
409          * config.baseFloatZIndex = 2000\r
410          */\r
411         baseFloatZIndex : 10000\r
412 };\r
413 \r
414 /**\r
415  * Indicates that some of the editor features, like alignment and text\r
416  * direction, should used the "computed value" of the feature to indicate it's\r
417  * on/off state, instead of using the "real value".<br />\r
418  * <br />\r
419  * If enabled, in a left to right written document, the "Left Justify"\r
420  * alignment button will show as active, even if the aligment style is not\r
421  * explicitly applied to the current paragraph in the editor.\r
422  * @name CKEDITOR.config.useComputedState\r
423  * @type Boolean\r
424  * @default true\r
425  * @since 3.4\r
426  * @example\r
427  * config.useComputedState = false;\r
428  */\r
429 \r
430 // PACKAGER_RENAME( CKEDITOR.config )\r