JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
vanilla ckeditor-3.6.3
[ckeditor.git] / _source / core / config.js
1 /*\r
2 Copyright (c) 2003-2012, 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). This\r
260          * can be an integer, for pixel sizes, or any CSS-defined length unit.<br>\r
261          * <br>\r
262          * <strong>Note:</strong> Percent units (%) are not supported.\r
263          * @type Number|String\r
264          * @default <code>200</code>\r
265          * @example\r
266          * config.height = 500; // 500 pixels.\r
267          * @example\r
268          * config.height = '25em'; // CSS length.\r
269          * @example\r
270          * config.height = '300px'; // CSS length.\r
271          */\r
272         height : 200,\r
273 \r
274         /**\r
275          * Comma separated list of plugins to be loaded and initialized for an editor\r
276          * instance. This setting should rarely be changed. It is recommended to use the\r
277          * <code>{@link CKEDITOR.config.extraPlugins}</code> and\r
278          * <code>{@link CKEDITOR.config.removePlugins}</code> for customization purposes instead.\r
279          * @type String\r
280          * @example\r
281          */\r
282         plugins :\r
283                 'about,' +\r
284                 'a11yhelp,' +\r
285                 'basicstyles,' +\r
286                 'bidi,' +\r
287                 'blockquote,' +\r
288                 'button,' +\r
289                 'clipboard,' +\r
290                 'colorbutton,' +\r
291                 'colordialog,' +\r
292                 'contextmenu,' +\r
293                 'dialogadvtab,' +\r
294                 'div,' +\r
295                 'elementspath,' +\r
296                 'enterkey,' +\r
297                 'entities,' +\r
298                 'filebrowser,' +\r
299                 'find,' +\r
300                 'flash,' +\r
301                 'font,' +\r
302                 'format,' +\r
303                 'forms,' +\r
304                 'horizontalrule,' +\r
305                 'htmldataprocessor,' +\r
306                 'iframe,' +\r
307                 'image,' +\r
308                 'indent,' +\r
309                 'justify,' +\r
310                 'keystrokes,' +\r
311                 'link,' +\r
312                 'list,' +\r
313                 'liststyle,' +\r
314                 'maximize,' +\r
315                 'newpage,' +\r
316                 'pagebreak,' +\r
317                 'pastefromword,' +\r
318                 'pastetext,' +\r
319                 'popup,' +\r
320                 'preview,' +\r
321                 'print,' +\r
322                 'removeformat,' +\r
323                 'resize,' +\r
324                 'save,' +\r
325                 'scayt,' +\r
326                 'smiley,' +\r
327                 'showblocks,' +\r
328                 'showborders,' +\r
329                 'sourcearea,' +\r
330                 'stylescombo,' +\r
331                 'table,' +\r
332                 'tabletools,' +\r
333                 'specialchar,' +\r
334                 'tab,' +\r
335                 'templates,' +\r
336                 'toolbar,' +\r
337                 'undo,' +\r
338                 'wysiwygarea,' +\r
339                 'wsc',\r
340 \r
341         /**\r
342          * A list of additional plugins to be loaded. This setting makes it easier\r
343          * to add new plugins without having to touch and potentially break the\r
344          * <code>{@link CKEDITOR.config.plugins}</code> setting.\r
345          * @type String\r
346          * @example\r
347          * config.extraPlugins = 'myplugin,anotherplugin';\r
348          */\r
349         extraPlugins : '',\r
350 \r
351         /**\r
352          * A list of plugins that must not be loaded. This setting makes it possible\r
353          * to avoid loading some plugins defined in the <code>{@link CKEDITOR.config.plugins}</code>\r
354          * setting, without having to touch it and potentially break it.\r
355          * @type String\r
356          * @example\r
357          * config.removePlugins = 'elementspath,save,font';\r
358          */\r
359         removePlugins : '',\r
360 \r
361         /**\r
362          * List of regular expressions to be executed on input HTML,\r
363          * indicating HTML source code that when matched, must <strong>not</strong> be available in the WYSIWYG\r
364          * mode for editing.\r
365          * @type Array\r
366          * @default <code>[]</code> (empty array)\r
367          * @example\r
368          * config.protectedSource.push( /<\?[\s\S]*?\?>/g );   // PHP code\r
369          * config.protectedSource.push( /<%[\s\S]*?%>/g );   // ASP code\r
370          * config.protectedSource.push( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi );   // ASP.Net code\r
371          */\r
372         protectedSource : [],\r
373 \r
374         /**\r
375          * The editor <code>tabindex</code> value.\r
376          * @type Number\r
377          * @default <code>0</code> (zero)\r
378          * @example\r
379          * config.tabIndex = 1;\r
380          */\r
381         tabIndex : 0,\r
382 \r
383         /**\r
384          * The theme to be used to build the user interface.\r
385          * @type String\r
386          * @default <code>'default'</code>\r
387          * @see CKEDITOR.config.skin\r
388          * @example\r
389          * config.theme = 'default';\r
390          */\r
391         theme : 'default',\r
392 \r
393         /**\r
394          * The skin to load. It may be the name of the skin folder inside the\r
395          * editor installation path, or the name and the path separated by a comma.\r
396          * @type String\r
397          * @default <code>'default'</code>\r
398          * @example\r
399          * config.skin = 'v2';\r
400          * @example\r
401          * config.skin = 'myskin,/customstuff/myskin/';\r
402          */\r
403         skin : 'kama',\r
404 \r
405         /**\r
406          * The editor UI outer width. This can be an integer, for pixel sizes, or\r
407          * any CSS-defined unit.<br>\r
408          * <br>\r
409          * Unlike the <code>{@link CKEDITOR.config.height}</code> setting, this\r
410          * one will set the outer width of the entire editor UI, not for the\r
411          * editing area only.\r
412          * @type String|Number\r
413          * @default <code>''</code> (empty)\r
414          * @example\r
415          * config.width = 850; // 850 pixels wide.\r
416          * @example\r
417          * config.width = '75%'; // CSS unit.\r
418          */\r
419         width : '',\r
420 \r
421         /**\r
422          * The base Z-index for floating dialog windows and popups.\r
423          * @type Number\r
424          * @default <code>10000</code>\r
425          * @example\r
426          * config.baseFloatZIndex = 2000\r
427          */\r
428         baseFloatZIndex : 10000\r
429 };\r
430 \r
431 /**\r
432  * Indicates that some of the editor features, like alignment and text\r
433  * direction, should use the "computed value" of the feature to indicate its\r
434  * on/off state instead of using the "real value".<br />\r
435  * <br />\r
436  * If enabled in a Left-To-Right written document, the "Left Justify"\r
437  * alignment button will be shown as active, even if the alignment style is not\r
438  * explicitly applied to the current paragraph in the editor.\r
439  * @name CKEDITOR.config.useComputedState\r
440  * @type Boolean\r
441  * @default <code>true</code>\r
442  * @since 3.4\r
443  * @example\r
444  * config.useComputedState = false;\r
445  */\r
446 \r
447 // PACKAGER_RENAME( CKEDITOR.config )\r