diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-01-25 17:45:33 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-01-25 18:00:33 +0100 |
commit | 7adcb81e4f83f98c468889aaa5a85558ba88c770 (patch) | |
tree | 0d6ede733777b29060b48df4afaa2c64bfbae276 /sources/core/config.js | |
download | connexionswing-ckeditor-component-7adcb81e4f83f98c468889aaa5a85558ba88c770.tar.gz connexionswing-ckeditor-component-7adcb81e4f83f98c468889aaa5a85558ba88c770.tar.zst connexionswing-ckeditor-component-7adcb81e4f83f98c468889aaa5a85558ba88c770.zip |
Initial commit4.5.6
Diffstat (limited to 'sources/core/config.js')
-rw-r--r-- | sources/core/config.js | 451 |
1 files changed, 451 insertions, 0 deletions
diff --git a/sources/core/config.js b/sources/core/config.js new file mode 100644 index 00000000..6bab846c --- /dev/null +++ b/sources/core/config.js | |||
@@ -0,0 +1,451 @@ | |||
1 | /** | ||
2 | * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved. | ||
3 | * For licensing, see LICENSE.md or http://ckeditor.com/license | ||
4 | */ | ||
5 | |||
6 | /** | ||
7 | * @fileOverview Defines the {@link CKEDITOR.config} object that stores the | ||
8 | * default configuration settings. | ||
9 | */ | ||
10 | |||
11 | /** | ||
12 | * Used in conjunction with the {@link CKEDITOR.config#enterMode} | ||
13 | * and {@link CKEDITOR.config#shiftEnterMode} configuration | ||
14 | * settings to make the editor produce `<p>` tags when | ||
15 | * using the <kbd>Enter</kbd> key. | ||
16 | * | ||
17 | * Read more in the [documentation](#!/guide/dev_enterkey) and see the | ||
18 | * [SDK sample](http://sdk.ckeditor.com/samples/enterkey.html). | ||
19 | * | ||
20 | * @readonly | ||
21 | * @property {Number} [=1] | ||
22 | * @member CKEDITOR | ||
23 | */ | ||
24 | CKEDITOR.ENTER_P = 1; | ||
25 | |||
26 | /** | ||
27 | * Used in conjunction with the {@link CKEDITOR.config#enterMode} | ||
28 | * and {@link CKEDITOR.config#shiftEnterMode} configuration | ||
29 | * settings to make the editor produce `<br>` tags when | ||
30 | * using the <kbd>Enter</kbd> key. | ||
31 | * | ||
32 | * Read more in the [documentation](#!/guide/dev_enterkey) and see the | ||
33 | * [SDK sample](http://sdk.ckeditor.com/samples/enterkey.html). | ||
34 | * | ||
35 | * @readonly | ||
36 | * @property {Number} [=2] | ||
37 | * @member CKEDITOR | ||
38 | */ | ||
39 | CKEDITOR.ENTER_BR = 2; | ||
40 | |||
41 | /** | ||
42 | * Used in conjunction with the {@link CKEDITOR.config#enterMode} | ||
43 | * and {@link CKEDITOR.config#shiftEnterMode} configuration | ||
44 | * settings to make the editor produce `<div>` tags when | ||
45 | * using the <kbd>Enter</kbd> key. | ||
46 | * | ||
47 | * Read more in the [documentation](#!/guide/dev_enterkey) and see the | ||
48 | * [SDK sample](http://sdk.ckeditor.com/samples/enterkey.html). | ||
49 | * | ||
50 | * @readonly | ||
51 | * @property {Number} [=3] | ||
52 | * @member CKEDITOR | ||
53 | */ | ||
54 | CKEDITOR.ENTER_DIV = 3; | ||
55 | |||
56 | /** | ||
57 | * Stores default configuration settings. Changes to this object are | ||
58 | * reflected in all editor instances, if not specified otherwise for a particular | ||
59 | * instance. | ||
60 | * | ||
61 | * Read more about setting CKEditor configuration in the | ||
62 | * [documentation](#!/guide/dev_configuration). | ||
63 | * | ||
64 | * @class | ||
65 | * @singleton | ||
66 | */ | ||
67 | CKEDITOR.config = { | ||
68 | /** | ||
69 | * The URL path to the custom configuration file to be loaded. If not | ||
70 | * overwritten with inline configuration, it defaults to the `config.js` | ||
71 | * file present in the root of the CKEditor installation directory. | ||
72 | * | ||
73 | * CKEditor will recursively load custom configuration files defined inside | ||
74 | * other custom configuration files. | ||
75 | * | ||
76 | * Read more about setting CKEditor configuration in the | ||
77 | * [documentation](#!/guide/dev_configuration). | ||
78 | * | ||
79 | * // Load a specific configuration file. | ||
80 | * CKEDITOR.replace( 'myfield', { customConfig: '/myconfig.js' } ); | ||
81 | * | ||
82 | * // Do not load any custom configuration file. | ||
83 | * CKEDITOR.replace( 'myfield', { customConfig: '' } ); | ||
84 | * | ||
85 | * @cfg {String} [="<CKEditor folder>/config.js"] | ||
86 | */ | ||
87 | customConfig: 'config.js', | ||
88 | |||
89 | /** | ||
90 | * Whether the element replaced by the editor (usually a `<textarea>`) | ||
91 | * is to be updated automatically when posting the form containing the editor. | ||
92 | * | ||
93 | * @cfg | ||
94 | */ | ||
95 | autoUpdateElement: true, | ||
96 | |||
97 | /** | ||
98 | * The user interface language localization to use. If left empty, the editor | ||
99 | * will automatically be localized to the user language. If the user language is not supported, | ||
100 | * the language specified in the {@link CKEDITOR.config#defaultLanguage} | ||
101 | * configuration setting is used. | ||
102 | * | ||
103 | * Read more in the [documentation](#!/guide/dev_uilanguage) and see the | ||
104 | * [SDK sample](http://sdk.ckeditor.com/samples/uilanguages.html). | ||
105 | * | ||
106 | * // Load the German interface. | ||
107 | * config.language = 'de'; | ||
108 | * | ||
109 | * @cfg | ||
110 | */ | ||
111 | language: '', | ||
112 | |||
113 | /** | ||
114 | * The language to be used if the {@link CKEDITOR.config#language} | ||
115 | * setting is left empty and it is not possible to localize the editor to the user language. | ||
116 | * | ||
117 | * Read more in the [documentation](#!/guide/dev_uilanguage) and see the | ||
118 | * [SDK sample](http://sdk.ckeditor.com/samples/uilanguages.html). | ||
119 | * | ||
120 | * config.defaultLanguage = 'it'; | ||
121 | * | ||
122 | * @cfg | ||
123 | */ | ||
124 | defaultLanguage: 'en', | ||
125 | |||
126 | /** | ||
127 | * The writing direction of the language which is used to create editor content. | ||
128 | * Allowed values are: | ||
129 | * | ||
130 | * * `''` (an empty string) – Indicates that content direction will be the same as either | ||
131 | * the editor UI direction or the page element direction depending on the editor type: | ||
132 | * * [Classic editor](#!/guide/dev_framed) – The same as the user interface language direction. | ||
133 | * * [Inline editor](#!/guide/dev_inline)– The same as the editable element text direction. | ||
134 | * * `'ltr'` – Indicates a Left-To-Right text direction (like in English). | ||
135 | * * `'rtl'` – Indicates a Right-To-Left text direction (like in Arabic). | ||
136 | * | ||
137 | * See the [SDK sample](http://sdk.ckeditor.com/samples/language.html). | ||
138 | * | ||
139 | * Example: | ||
140 | * | ||
141 | * config.contentsLangDirection = 'rtl'; | ||
142 | * | ||
143 | * @cfg | ||
144 | */ | ||
145 | contentsLangDirection: '', | ||
146 | |||
147 | /** | ||
148 | * Sets the behavior of the <kbd>Enter</kbd> key. It also determines other behavior | ||
149 | * rules of the editor, like whether the `<br>` element is to be used | ||
150 | * as a paragraph separator when indenting text. | ||
151 | * The allowed values are the following constants that cause the behavior outlined below: | ||
152 | * | ||
153 | * * {@link CKEDITOR#ENTER_P} (1) – New `<p>` paragraphs are created. | ||
154 | * * {@link CKEDITOR#ENTER_BR} (2) – Lines are broken with `<br>` elements. | ||
155 | * * {@link CKEDITOR#ENTER_DIV} (3) – New `<div>` blocks are created. | ||
156 | * | ||
157 | * **Note**: It is recommended to use the {@link CKEDITOR#ENTER_P} setting because of | ||
158 | * its semantic value and correctness. The editor is optimized for this setting. | ||
159 | * | ||
160 | * Read more in the [documentation](#!/guide/dev_enterkey) and see the | ||
161 | * [SDK sample](http://sdk.ckeditor.com/samples/enterkey.html). | ||
162 | * | ||
163 | * // Not recommended. | ||
164 | * config.enterMode = CKEDITOR.ENTER_BR; | ||
165 | * | ||
166 | * @cfg {Number} [=CKEDITOR.ENTER_P] | ||
167 | */ | ||
168 | enterMode: CKEDITOR.ENTER_P, | ||
169 | |||
170 | /** | ||
171 | * Forces the use of {@link CKEDITOR.config#enterMode} as line break regardless | ||
172 | * of the context. If, for example, {@link CKEDITOR.config#enterMode} is set | ||
173 | * to {@link CKEDITOR#ENTER_P}, pressing the <kbd>Enter</kbd> key inside a | ||
174 | * `<div>` element will create a new paragraph with a `<p>` | ||
175 | * instead of a `<div>`. | ||
176 | * | ||
177 | * Read more in the [documentation](#!/guide/dev_enterkey) and see the | ||
178 | * [SDK sample](http://sdk.ckeditor.com/samples/enterkey.html). | ||
179 | * | ||
180 | * // Not recommended. | ||
181 | * config.forceEnterMode = true; | ||
182 | * | ||
183 | * @since 3.2.1 | ||
184 | * @cfg | ||
185 | */ | ||
186 | forceEnterMode: false, | ||
187 | |||
188 | /** | ||
189 | * Similarly to the {@link CKEDITOR.config#enterMode} setting, it defines the behavior | ||
190 | * of the <kbd>Shift+Enter</kbd> key combination. | ||
191 | * | ||
192 | * The allowed values are the following constants that cause the behavior outlined below: | ||
193 | * | ||
194 | * * {@link CKEDITOR#ENTER_P} (1) – New `<p>` paragraphs are created. | ||
195 | * * {@link CKEDITOR#ENTER_BR} (2) – Lines are broken with `<br>` elements. | ||
196 | * * {@link CKEDITOR#ENTER_DIV} (3) – New `<div>` blocks are created. | ||
197 | * | ||
198 | * Read more in the [documentation](#!/guide/dev_enterkey) and see the | ||
199 | * [SDK sample](http://sdk.ckeditor.com/samples/enterkey.html). | ||
200 | * | ||
201 | * Example: | ||
202 | * | ||
203 | * config.shiftEnterMode = CKEDITOR.ENTER_P; | ||
204 | * | ||
205 | * @cfg {Number} [=CKEDITOR.ENTER_BR] | ||
206 | */ | ||
207 | shiftEnterMode: CKEDITOR.ENTER_BR, | ||
208 | |||
209 | /** | ||
210 | * Sets the `DOCTYPE` to be used when loading the editor content as HTML. | ||
211 | * | ||
212 | * // Set the DOCTYPE to the HTML 4 (Quirks) mode. | ||
213 | * config.docType = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'; | ||
214 | * | ||
215 | * @cfg | ||
216 | */ | ||
217 | docType: '<!DOCTYPE html>', | ||
218 | |||
219 | /** | ||
220 | * Sets the `id` attribute to be used on the `body` element | ||
221 | * of the editing area. This can be useful when you intend to reuse the original CSS | ||
222 | * file you are using on your live website and want to assign the editor the same ID | ||
223 | * as the section that will include the contents. In this way ID-specific CSS rules will | ||
224 | * be enabled. | ||
225 | * | ||
226 | * config.bodyId = 'contents_id'; | ||
227 | * | ||
228 | * @since 3.1 | ||
229 | * @cfg | ||
230 | */ | ||
231 | bodyId: '', | ||
232 | |||
233 | /** | ||
234 | * Sets the `class` attribute to be used on the `body` element | ||
235 | * of the editing area. This can be useful when you intend to reuse the original CSS | ||
236 | * file you are using on your live website and want to assign the editor the same class | ||
237 | * as the section that will include the contents. In this way class-specific CSS rules will | ||
238 | * be enabled. | ||
239 | * | ||
240 | * config.bodyClass = 'contents'; | ||
241 | * | ||
242 | * **Note:** The editor needs to load stylesheets containing contents styles. You can either | ||
243 | * copy them to the `contents.css` file that the editor loads by default or set the {@link #contentsCss} | ||
244 | * option. | ||
245 | * | ||
246 | * **Note:** This setting only applies to [classic editor](#!/guide/dev_framed) (the one that uses `iframe`). | ||
247 | * | ||
248 | * @since 3.1 | ||
249 | * @cfg | ||
250 | */ | ||
251 | bodyClass: '', | ||
252 | |||
253 | /** | ||
254 | * Indicates whether the content to be edited is being input as a full HTML page. | ||
255 | * A full page includes the `<html>`, `<head>`, and `<body>` elements. | ||
256 | * The final output will also reflect this setting, including the | ||
257 | * `<body>` content only if this setting is disabled. | ||
258 | * | ||
259 | * Read more in the [documentation](#!/guide/dev_fullpage) and see the | ||
260 | * [SDK sample](http://sdk.ckeditor.com/samples/fullpage.html). | ||
261 | * | ||
262 | * config.fullPage = true; | ||
263 | * | ||
264 | * @since 3.1 | ||
265 | * @cfg | ||
266 | */ | ||
267 | fullPage: false, | ||
268 | |||
269 | /** | ||
270 | * The height of the editing area that includes the editor content. This configuration | ||
271 | * option accepts an integer (to denote a value in pixels) or any CSS-defined length unit | ||
272 | * except percent (`%`) values which are not supported. | ||
273 | * | ||
274 | * **Note:** This configuration option is ignored by [inline editor](#!/guide/dev_inline). | ||
275 | * | ||
276 | * Read more in the [documentation](#!/guide/dev_size) and see the | ||
277 | * [SDK sample](http://sdk.ckeditor.com/samples/size.html). | ||
278 | * | ||
279 | * config.height = 500; // 500 pixels. | ||
280 | * config.height = '25em'; // CSS length. | ||
281 | * config.height = '300px'; // CSS length. | ||
282 | * | ||
283 | * @cfg {Number/String} | ||
284 | */ | ||
285 | height: 200, | ||
286 | |||
287 | /** | ||
288 | * The CSS file(s) to be used to apply style to editor content. It should | ||
289 | * reflect the CSS used in the target pages where the content is to be | ||
290 | * displayed. | ||
291 | * | ||
292 | * **Note:** This configuration value is ignored by [inline editor](#!/guide/dev_inline) | ||
293 | * as it uses the styles that come directly from the page that CKEditor is | ||
294 | * rendered on. It is also ignored in the {@link #fullPage full page mode} in | ||
295 | * which the developer has full control over the page HTML code. | ||
296 | * | ||
297 | * Read more in the [documentation](#!/guide/dev_styles) and see the | ||
298 | * [SDK sample](http://sdk.ckeditor.com/samples/styles.html). | ||
299 | * | ||
300 | * config.contentsCss = '/css/mysitestyles.css'; | ||
301 | * config.contentsCss = [ '/css/mysitestyles.css', '/css/anotherfile.css' ]; | ||
302 | * | ||
303 | * @cfg {String/Array} [contentsCss=CKEDITOR.getUrl( 'contents.css' )] | ||
304 | */ | ||
305 | contentsCss: CKEDITOR.getUrl( 'contents.css' ), | ||
306 | |||
307 | /** | ||
308 | * Comma-separated list of plugins to be used in an editor instance. Note that | ||
309 | * the actual plugins that are to be loaded could still be affected by two other settings: | ||
310 | * {@link CKEDITOR.config#extraPlugins} and {@link CKEDITOR.config#removePlugins}. | ||
311 | * | ||
312 | * @cfg {String} [="<default list of plugins>"] | ||
313 | */ | ||
314 | plugins: '', // %REMOVE_LINE% | ||
315 | |||
316 | /** | ||
317 | * A list of additional plugins to be loaded. This setting makes it easier | ||
318 | * to add new plugins without having to touch the {@link CKEDITOR.config#plugins} setting. | ||
319 | * | ||
320 | * **Note:** The most recommended way to | ||
321 | * [add CKEditor plugins](http://docs.ckeditor.com/#!/guide/dev_plugins) is through | ||
322 | * [CKEditor Builder](http://ckeditor.com/builder). Read more in the | ||
323 | * [documentation](#!/guide/dev_plugins). | ||
324 | * | ||
325 | * config.extraPlugins = 'myplugin,anotherplugin'; | ||
326 | * | ||
327 | * @cfg | ||
328 | */ | ||
329 | extraPlugins: '', | ||
330 | |||
331 | /** | ||
332 | * A list of plugins that must not be loaded. This setting makes it possible | ||
333 | * to avoid loading some plugins defined in the {@link CKEDITOR.config#plugins} | ||
334 | * setting without having to touch it. | ||
335 | * | ||
336 | * **Note:** A plugin required by another plugin cannot be removed and will cause | ||
337 | * an error to be thrown. So for example if `contextmenu` is required by `tabletools`, | ||
338 | * it can only be removed if `tabletools` is not loaded. | ||
339 | * | ||
340 | * config.removePlugins = 'elementspath,save,font'; | ||
341 | * | ||
342 | * @cfg | ||
343 | */ | ||
344 | removePlugins: '', | ||
345 | |||
346 | /** | ||
347 | * A list of regular expressions to be executed on input HTML, | ||
348 | * indicating HTML source code that when matched, must **not** be available in the WYSIWYG | ||
349 | * mode for editing. | ||
350 | * | ||
351 | * config.protectedSource.push( /<\?[\s\S]*?\?>/g ); // PHP code | ||
352 | * config.protectedSource.push( /<%[\s\S]*?%>/g ); // ASP code | ||
353 | * config.protectedSource.push( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi ); // ASP.NET code | ||
354 | * | ||
355 | * @cfg | ||
356 | */ | ||
357 | protectedSource: [], | ||
358 | |||
359 | /** | ||
360 | * The editor `tabindex` value. | ||
361 | * | ||
362 | * Read more in the [documentation](#!/guide/dev_tabindex) and see the | ||
363 | * [SDK sample](http://sdk.ckeditor.com/samples/tabindex.html). | ||
364 | * | ||
365 | * config.tabIndex = 1; | ||
366 | * | ||
367 | * @cfg | ||
368 | */ | ||
369 | tabIndex: 0, | ||
370 | |||
371 | /** | ||
372 | * The editor UI outer width. This configuration option accepts an integer | ||
373 | * (to denote a value in pixels) or any CSS-defined length unit. | ||
374 | * | ||
375 | * Unlike the {@link CKEDITOR.config#height} setting, this | ||
376 | * one will set the outer width of the entire editor UI, not for the | ||
377 | * editing area only. | ||
378 | * | ||
379 | * **Note:** This configuration option is ignored by [inline editor](#!/guide/dev_inline). | ||
380 | * | ||
381 | * Read more in the [documentation](#!/guide/dev_size) and see the | ||
382 | * [SDK sample](http://sdk.ckeditor.com/samples/size.html). | ||
383 | * | ||
384 | * config.width = 850; // 850 pixels wide. | ||
385 | * config.width = '75%'; // CSS unit. | ||
386 | * | ||
387 | * @cfg {String/Number} | ||
388 | */ | ||
389 | width: '', | ||
390 | |||
391 | /** | ||
392 | * The base Z-index for floating dialog windows and popups. | ||
393 | * | ||
394 | * config.baseFloatZIndex = 2000; | ||
395 | * | ||
396 | * @cfg | ||
397 | */ | ||
398 | baseFloatZIndex: 10000, | ||
399 | |||
400 | /** | ||
401 | * The keystrokes that are blocked by default as the browser implementation | ||
402 | * is buggy. These default keystrokes are handled by the editor. | ||
403 | * | ||
404 | * // Default setting. | ||
405 | * config.blockedKeystrokes = [ | ||
406 | * CKEDITOR.CTRL + 66, // Ctrl+B | ||
407 | * CKEDITOR.CTRL + 73, // Ctrl+I | ||
408 | * CKEDITOR.CTRL + 85 // Ctrl+U | ||
409 | * ]; | ||
410 | * | ||
411 | * @cfg {Array} [blockedKeystrokes=see example] | ||
412 | */ | ||
413 | blockedKeystrokes: [ | ||
414 | CKEDITOR.CTRL + 66, // Ctrl+B | ||
415 | CKEDITOR.CTRL + 73, // Ctrl+I | ||
416 | CKEDITOR.CTRL + 85 // Ctrl+U | ||
417 | ] | ||
418 | }; | ||
419 | |||
420 | /** | ||
421 | * Indicates that some of the editor features, like alignment and text | ||
422 | * direction, should use the "computed value" of the feature to indicate its | ||
423 | * on/off state instead of using the "real value". | ||
424 | * | ||
425 | * If enabled in a Left-To-Right written document, the "Left Justify" | ||
426 | * alignment button will be shown as active, even if the alignment style is not | ||
427 | * explicitly applied to the current paragraph in the editor. | ||
428 | * | ||
429 | * config.useComputedState = false; | ||
430 | * | ||
431 | * @since 3.4 | ||
432 | * @cfg {Boolean} [useComputedState=true] | ||
433 | */ | ||
434 | |||
435 | /** | ||
436 | * The base user interface color to be used by the editor. Not all skins are | ||
437 | * [compatible with this setting](#!/guide/skin_sdk_chameleon). | ||
438 | * | ||
439 | * Read more in the [documentation](#!/guide/dev_uicolor) and see the | ||
440 | * [SDK sample](http://sdk.ckeditor.com/samples/uicolor.html). | ||
441 | * | ||
442 | * // Using a color code. | ||
443 | * config.uiColor = '#AADC6E'; | ||
444 | * | ||
445 | * // Using an HTML color name. | ||
446 | * config.uiColor = 'Gold'; | ||
447 | * | ||
448 | * @cfg {String} uiColor | ||
449 | */ | ||
450 | |||
451 | // PACKAGER_RENAME( CKEDITOR.config ) | ||