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