JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
c53892da769809ccc8be5aa99bf38bd10affdb02
[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 'ltr' for Left-To-Right language (like\r
80          * English), or 'rtl' for Right-To-Left languages (like Arabic).\r
81          * @default 'ltr'\r
82          * @type String\r
83          * @example\r
84          * config.contentsLangDirection = 'rtl';\r
85          */\r
86         contentsLangDirection : 'ltr',\r
87 \r
88         /**\r
89          * The user interface language localization to use. If empty, the editor\r
90          * automatically localize the editor to the user language, if supported,\r
91          * otherwise the {@link CKEDITOR.config.defaultLanguage} language is used.\r
92          * @default '' (empty)\r
93          * @type String\r
94          * @example\r
95          * // Load the German interface.\r
96          * config.language = 'de';\r
97          */\r
98         language : '',\r
99 \r
100         /**\r
101          * The language to be used if {@link CKEDITOR.config.language} is left empty and it's not\r
102          * possible to localize the editor to the user language.\r
103          * @default 'en'\r
104          * @type String\r
105          * @example\r
106          * config.defaultLanguage = 'it';\r
107          */\r
108         defaultLanguage : 'en',\r
109 \r
110         /**\r
111          * Sets the behavior for the ENTER key. It also dictates other behaviour\r
112          * rules in the editor, like whether the &lt;br&gt; element is to be used\r
113          * as a paragraph separator when indenting text.\r
114          * The allowed values are the following constants, and their relative\r
115          * behavior:\r
116          * <ul>\r
117          *     <li>{@link CKEDITOR.ENTER_P} (1): new &lt;p&gt; paragraphs are created;</li>\r
118          *     <li>{@link CKEDITOR.ENTER_BR} (2): lines are broken with &lt;br&gt; elements;</li>\r
119          *     <li>{@link CKEDITOR.ENTER_DIV} (3): new &lt;div&gt; blocks are created.</li>\r
120          * </ul>\r
121          * <strong>Note</strong>: It's recommended to use the\r
122          * {@link CKEDITOR.ENTER_P} value because of its semantic value and\r
123          * correctness. The editor is optimized for this value.\r
124          * @type Number\r
125          * @default {@link CKEDITOR.ENTER_P}\r
126          * @example\r
127          * // Not recommended.\r
128          * config.enterMode = CKEDITOR.ENTER_BR;\r
129          */\r
130         enterMode : CKEDITOR.ENTER_P,\r
131 \r
132         /**\r
133          * Force the respect of {@link CKEDITOR.config.enterMode} as line break regardless of the context,\r
134          * E.g. If {@link CKEDITOR.config.enterMode} is set to {@link CKEDITOR.ENTER_P},\r
135          * press enter key inside a 'div' will create a new paragraph with 'p' instead of 'div'.\r
136          * @since 3.2.1\r
137          * @default false\r
138          * @example\r
139          * // Not recommended.\r
140          * config.forceEnterMode = true;\r
141          */\r
142         forceEnterMode : false,\r
143 \r
144         /**\r
145          * Just like the {@link CKEDITOR.config.enterMode} setting, it defines the behavior for the SHIFT+ENTER key.\r
146          * The allowed values are the following constants, and their relative\r
147          * behavior:\r
148          * <ul>\r
149          *     <li>{@link CKEDITOR.ENTER_P} (1): new &lt;p&gt; paragraphs are created;</li>\r
150          *     <li>{@link CKEDITOR.ENTER_BR} (2): lines are broken with &lt;br&gt; elements;</li>\r
151          *     <li>{@link CKEDITOR.ENTER_DIV} (3): new &lt;div&gt; blocks are created.</li>\r
152          * </ul>\r
153          * @type Number\r
154          * @default {@link CKEDITOR.ENTER_BR}\r
155          * @example\r
156          * config.shiftEnterMode = CKEDITOR.ENTER_P;\r
157          */\r
158         shiftEnterMode : CKEDITOR.ENTER_BR,\r
159 \r
160         /**\r
161          * A comma separated list of plugins that are not related to editor\r
162          * instances. Reserved to plugins that extend the core code only.<br /><br />\r
163          *\r
164          * There are no ways to override this setting, except by editing the source\r
165          * code of CKEditor (_source/core/config.js).\r
166          * @type String\r
167          * @example\r
168          */\r
169         corePlugins : '',\r
170 \r
171         /**\r
172          * Sets the doctype to be used when loading the editor content as HTML.\r
173          * @type String\r
174          * @default '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;'\r
175          * @example\r
176          * // Set the doctype to the HTML 4 (quirks) mode.\r
177          * config.docType = '&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"&gt;';\r
178          */\r
179         docType : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',\r
180 \r
181         /**\r
182          * Sets the "id" attribute to be used on the body element of the editing\r
183          * area.\r
184          * @since 3.1\r
185          * @type String\r
186          * @default ''\r
187          */\r
188         bodyId : '',\r
189 \r
190         /**\r
191          * Sets the "class" attribute to be used on the body element of the editing\r
192          * area.\r
193          * @since 3.1\r
194          * @type String\r
195          * @default ''\r
196          */\r
197         bodyClass : '',\r
198 \r
199         /**\r
200          * Indicates whether the contents to be edited are being inputted as a full\r
201          * HTML page. A full page includes the &lt;html&gt;, &lt;head&gt; and\r
202          * &lt;body&gt; tags. The final output will also reflect this setting,\r
203          * including the &lt;body&gt; contents only if this setting is disabled.\r
204          * @since 3.1\r
205          * @type Boolean\r
206          * @default false\r
207          * @example\r
208          * config.fullPage = true;\r
209          */\r
210         fullPage : false,\r
211 \r
212         /**\r
213          * The height of editing area( content ), in relative or absolute, e.g. 30px, 5em.\r
214          * Note: Percentage unit is not supported yet. e.g. 30%.\r
215          * @type Number|String\r
216          * @default '200'\r
217          * @example\r
218          * config.height = 500;\r
219          * config.height = '25em';\r
220          * config.height = '300px';\r
221          */\r
222         height : 200,\r
223 \r
224         /**\r
225          * Comma separated list of plugins to load and initialize for an editor\r
226          * instance. This should be rarely changed, using instead the\r
227          * {@link CKEDITOR.config.extraPlugins} and\r
228          * {@link CKEDITOR.config.removePlugins} for customizations.\r
229          * @type String\r
230          * @example\r
231          */\r
232         plugins : 'about,a11yhelp,basicstyles,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,showborders,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc',\r
233 \r
234         /**\r
235          * List of additional plugins to be loaded. This is a tool setting which\r
236          * makes it easier to add new plugins, whithout having to touch and\r
237          * possibly breaking the {@link CKEDITOR.config.plugins} setting.\r
238          * @type String\r
239          * @example\r
240          * config.extraPlugins = 'myplugin,anotherplugin';\r
241          */\r
242         extraPlugins : '',\r
243 \r
244         /**\r
245          * List of plugins that must not be loaded. This is a tool setting which\r
246          * makes it easier to avoid loading plugins definied in the\r
247          * {@link CKEDITOR.config.plugins} setting, whithout having to touch it and\r
248          * potentially breaking it.\r
249          * @type String\r
250          * @example\r
251          * config.removePlugins = 'elementspath,save,font';\r
252          */\r
253         removePlugins : '',\r
254 \r
255         /**\r
256          * List of regular expressions to be executed over the input HTML,\r
257          * indicating code that must stay untouched.\r
258          * @type Array\r
259          * @default [] (empty array)\r
260          * @example\r
261          * config.protectedSource.push( /<\?[\s\S]*?\?>/g );   // PHP Code\r
262          * config.protectedSource.push( /<%[\s\S]*?%>/g );   // ASP Code\r
263          * config.protectedSource.push( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi );   // ASP.Net Code\r
264          */\r
265         protectedSource : [],\r
266 \r
267         /**\r
268          * The editor tabindex value.\r
269          * @type Number\r
270          * @default 0 (zero)\r
271          * @example\r
272          * config.tabIndex = 1;\r
273          */\r
274         tabIndex : 0,\r
275 \r
276         /**\r
277          * The theme to be used to build the UI.\r
278          * @type String\r
279          * @default 'default'\r
280          * @see CKEDITOR.config.skin\r
281          * @example\r
282          * config.theme = 'default';\r
283          */\r
284         theme : 'default',\r
285 \r
286         /**\r
287          * The skin to load. It may be the name of the skin folder inside the\r
288          * editor installation path, or the name and the path separated by a comma.\r
289          * @type String\r
290          * @default 'default'\r
291          * @example\r
292          * config.skin = 'v2';\r
293          * @example\r
294          * config.skin = 'myskin,/customstuff/myskin/';\r
295          */\r
296         skin : 'kama',\r
297 \r
298         /**\r
299          * The editor width in CSS size format or pixel integer.\r
300          * @type String|Number\r
301          * @default '' (empty)\r
302          * @example\r
303          * config.width = 850;\r
304          * @example\r
305          * config.width = '75%';\r
306          */\r
307         width : '',\r
308 \r
309         /**\r
310          * The base Z-index for floating dialogs and popups.\r
311          * @type Number\r
312          * @default 10000\r
313          * @example\r
314          * config.baseFloatZIndex = 2000\r
315          */\r
316         baseFloatZIndex : 10000\r
317 };\r
318 \r
319 // PACKAGER_RENAME( CKEDITOR.config )\r