1 /* 2 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved. 3 For licensing, see LICENSE.html or http://ckeditor.com/license 4 */ 5 6 /** 7 * @fileOverview Defines the {@link CKEDITOR.config} object, which holds the 8 * default configuration settings. 9 */ 10 11 CKEDITOR.ENTER_P = 1; 12 CKEDITOR.ENTER_BR = 2; 13 CKEDITOR.ENTER_DIV = 3; 14 15 /** 16 * Holds the default configuration settings. Changes to this object are 17 * reflected in all editor instances, if not specificaly specified for those 18 * instances. 19 * @namespace 20 * @example 21 * // All editor created after the following setting will not load custom 22 * // configuration files. 23 * CKEDITOR.config.customConfig = ''; 24 */ 25 CKEDITOR.config = 26 { 27 /** 28 * The URL path for the custom configuration file to be loaded. If not 29 * overloaded with inline configurations, it defaults to the "config.js" 30 * file present in the root of the CKEditor installation directory.<br /><br /> 31 * 32 * CKEditor will recursively load custom configuration files defined inside 33 * other custom configuration files. 34 * @type String 35 * @default '<CKEditor folder>/config.js' 36 * @example 37 * // Load a specific configuration file. 38 * CKEDITOR.replace( 'myfiled', { customConfig : '/myconfig.js' } ); 39 * @example 40 * // Do not load any custom configuration file. 41 * CKEDITOR.replace( 'myfiled', { customConfig : '' } ); 42 */ 43 customConfig : 'config.js', 44 45 /** 46 * Whether the replaced element (usually a textarea) is to be updated 47 * automatically when posting the form containing the editor. 48 * @type Boolean 49 * @default true 50 * @example 51 * config.autoUpdateElement = true; 52 */ 53 autoUpdateElement : true, 54 55 /** 56 * The base href URL used to resolve relative and absolute URLs in the 57 * editor content. 58 * @type String 59 * @default '' (empty string) 60 * @example 61 * config.baseHref = 'http://www.example.com/path/'; 62 */ 63 baseHref : '', 64 65 /** 66 * The CSS file(s) to be used to apply style to the contents. It should 67 * reflect the CSS used in the final pages where the contents are to be 68 * used. 69 * @type String|Array 70 * @default '<CKEditor folder>/contents.css' 71 * @example 72 * config.contentsCss = '/css/mysitestyles.css'; 73 * config.contentsCss = ['/css/mysitestyles.css', '/css/anotherfile.css']; 74 */ 75 contentsCss : CKEDITOR.basePath + 'contents.css', 76 77 /** 78 * The writting direction of the language used to write the editor 79 * contents. Allowed values are 'ltr' for Left-To-Right language (like 80 * English), or 'rtl' for Right-To-Left languages (like Arabic). 81 * @default 'ltr' 82 * @type String 83 * @example 84 * config.contentsLangDirection = 'rtl'; 85 */ 86 contentsLangDirection : 'ltr', 87 88 /** 89 * Language code of the writting language which is used to author the editor 90 * contents. 91 * @default Same value with editor's UI language. 92 * @type String 93 * @example 94 * config.contentsLanguage = 'fr'; 95 */ 96 contentsLanguage : '', 97 98 /** 99 * The user interface language localization to use. If empty, the editor 100 * automatically localize the editor to the user language, if supported, 101 * otherwise the {@link CKEDITOR.config.defaultLanguage} language is used. 102 * @default '' (empty) 103 * @type String 104 * @example 105 * // Load the German interface. 106 * config.language = 'de'; 107 */ 108 language : '', 109 110 /** 111 * The language to be used if {@link CKEDITOR.config.language} is left empty and it's not 112 * possible to localize the editor to the user language. 113 * @default 'en' 114 * @type String 115 * @example 116 * config.defaultLanguage = 'it'; 117 */ 118 defaultLanguage : 'en', 119 120 /** 121 * Sets the behavior for the ENTER key. It also dictates other behaviour 122 * rules in the editor, like whether the <br> element is to be used 123 * as a paragraph separator when indenting text. 124 * The allowed values are the following constants, and their relative 125 * behavior: 126 * <ul> 127 * <li>{@link CKEDITOR.ENTER_P} (1): new <p> paragraphs are created;</li> 128 * <li>{@link CKEDITOR.ENTER_BR} (2): lines are broken with <br> elements;</li> 129 * <li>{@link CKEDITOR.ENTER_DIV} (3): new <div> blocks are created.</li> 130 * </ul> 131 * <strong>Note</strong>: It's recommended to use the 132 * {@link CKEDITOR.ENTER_P} value because of its semantic value and 133 * correctness. The editor is optimized for this value. 134 * @type Number 135 * @default {@link CKEDITOR.ENTER_P} 136 * @example 137 * // Not recommended. 138 * config.enterMode = CKEDITOR.ENTER_BR; 139 */ 140 enterMode : CKEDITOR.ENTER_P, 141 142 /** 143 * Force the respect of {@link CKEDITOR.config.enterMode} as line break regardless of the context, 144 * E.g. If {@link CKEDITOR.config.enterMode} is set to {@link CKEDITOR.ENTER_P}, 145 * press enter key inside a 'div' will create a new paragraph with 'p' instead of 'div'. 146 * @since 3.2.1 147 * @default false 148 * @example 149 * // Not recommended. 150 * config.forceEnterMode = true; 151 */ 152 forceEnterMode : false, 153 154 /** 155 * Just like the {@link CKEDITOR.config.enterMode} setting, it defines the behavior for the SHIFT+ENTER key. 156 * The allowed values are the following constants, and their relative 157 * behavior: 158 * <ul> 159 * <li>{@link CKEDITOR.ENTER_P} (1): new <p> paragraphs are created;</li> 160 * <li>{@link CKEDITOR.ENTER_BR} (2): lines are broken with <br> elements;</li> 161 * <li>{@link CKEDITOR.ENTER_DIV} (3): new <div> blocks are created.</li> 162 * </ul> 163 * @type Number 164 * @default {@link CKEDITOR.ENTER_BR} 165 * @example 166 * config.shiftEnterMode = CKEDITOR.ENTER_P; 167 */ 168 shiftEnterMode : CKEDITOR.ENTER_BR, 169 170 /** 171 * A comma separated list of plugins that are not related to editor 172 * instances. Reserved to plugins that extend the core code only.<br /><br /> 173 * 174 * There are no ways to override this setting, except by editing the source 175 * code of CKEditor (_source/core/config.js). 176 * @type String 177 * @example 178 */ 179 corePlugins : '', 180 181 /** 182 * Sets the doctype to be used when loading the editor content as HTML. 183 * @type String 184 * @default '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' 185 * @example 186 * // Set the doctype to the HTML 4 (quirks) mode. 187 * config.docType = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'; 188 */ 189 docType : '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">', 190 191 /** 192 * Sets the "id" attribute to be used on the body element of the editing 193 * area. 194 * @since 3.1 195 * @type String 196 * @default '' 197 */ 198 bodyId : '', 199 200 /** 201 * Sets the "class" attribute to be used on the body element of the editing 202 * area. 203 * @since 3.1 204 * @type String 205 * @default '' 206 */ 207 bodyClass : '', 208 209 /** 210 * Indicates whether the contents to be edited are being inputted as a full 211 * HTML page. A full page includes the <html>, <head> and 212 * <body> tags. The final output will also reflect this setting, 213 * including the <body> contents only if this setting is disabled. 214 * @since 3.1 215 * @type Boolean 216 * @default false 217 * @example 218 * config.fullPage = true; 219 */ 220 fullPage : false, 221 222 /** 223 * The height of editing area( content ), in relative or absolute, e.g. 30px, 5em. 224 * Note: Percentage unit is not supported yet. e.g. 30%. 225 * @type Number|String 226 * @default '200' 227 * @example 228 * config.height = 500; 229 * config.height = '25em'; 230 * config.height = '300px'; 231 */ 232 height : 200, 233 234 /** 235 * Comma separated list of plugins to load and initialize for an editor 236 * instance. This should be rarely changed, using instead the 237 * {@link CKEDITOR.config.extraPlugins} and 238 * {@link CKEDITOR.config.removePlugins} for customizations. 239 * @type String 240 * @example 241 */ 242 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,liststyle,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', 243 244 /** 245 * List of additional plugins to be loaded. This is a tool setting which 246 * makes it easier to add new plugins, whithout having to touch and 247 * possibly breaking the {@link CKEDITOR.config.plugins} setting. 248 * @type String 249 * @example 250 * config.extraPlugins = 'myplugin,anotherplugin'; 251 */ 252 extraPlugins : '', 253 254 /** 255 * List of plugins that must not be loaded. This is a tool setting which 256 * makes it easier to avoid loading plugins definied in the 257 * {@link CKEDITOR.config.plugins} setting, whithout having to touch it and 258 * potentially breaking it. 259 * @type String 260 * @example 261 * config.removePlugins = 'elementspath,save,font'; 262 */ 263 removePlugins : '', 264 265 /** 266 * List of regular expressions to be executed over the input HTML, 267 * indicating code that must stay untouched. 268 * @type Array 269 * @default [] (empty array) 270 * @example 271 * config.protectedSource.push( /<\?[\s\S]*?\?>/g ); // PHP Code 272 * config.protectedSource.push( /<%[\s\S]*?%>/g ); // ASP Code 273 * config.protectedSource.push( /(<asp:[^\>]+>[\s|\S]*?<\/asp:[^\>]+>)|(<asp:[^\>]+\/>)/gi ); // ASP.Net Code 274 */ 275 protectedSource : [], 276 277 /** 278 * The editor tabindex value. 279 * @type Number 280 * @default 0 (zero) 281 * @example 282 * config.tabIndex = 1; 283 */ 284 tabIndex : 0, 285 286 /** 287 * The theme to be used to build the UI. 288 * @type String 289 * @default 'default' 290 * @see CKEDITOR.config.skin 291 * @example 292 * config.theme = 'default'; 293 */ 294 theme : 'default', 295 296 /** 297 * The skin to load. It may be the name of the skin folder inside the 298 * editor installation path, or the name and the path separated by a comma. 299 * @type String 300 * @default 'default' 301 * @example 302 * config.skin = 'v2'; 303 * @example 304 * config.skin = 'myskin,/customstuff/myskin/'; 305 */ 306 skin : 'kama', 307 308 /** 309 * The editor width in CSS size format or pixel integer. 310 * @type String|Number 311 * @default '' (empty) 312 * @example 313 * config.width = 850; 314 * @example 315 * config.width = '75%'; 316 */ 317 width : '', 318 319 /** 320 * The base Z-index for floating dialogs and popups. 321 * @type Number 322 * @default 10000 323 * @example 324 * config.baseFloatZIndex = 2000 325 */ 326 baseFloatZIndex : 10000 327 }; 328 329 // PACKAGER_RENAME( CKEDITOR.config ) 330