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