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