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