PageRenderTime 27ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 0ms

/files/ckeditor/4.3.0/plugins/wysiwygarea/plugin.js

https://gitlab.com/Mirros/jsdelivr
JavaScript | 656 lines | 351 code | 111 blank | 194 comment | 75 complexity | c3e31d45c25d5217a0cc7b819e5b5ec7 MD5 | raw file
  1. /**
  2. * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or http://ckeditor.com/license
  4. */
  5. /**
  6. * @fileOverview The "wysiwygarea" plugin. It registers the "wysiwyg" editing
  7. * mode, which handles the main editing area space.
  8. */
  9. (function() {
  10. CKEDITOR.plugins.add( 'wysiwygarea', {
  11. init: function( editor ) {
  12. if ( editor.config.fullPage ) {
  13. editor.addFeature( {
  14. allowedContent: 'html head title; style [media,type]; body (*)[id]; meta link [*]',
  15. requiredContent: 'body'
  16. } );
  17. }
  18. editor.addMode( 'wysiwyg', function( callback ) {
  19. var src = 'document.open();' +
  20. // In IE, the document domain must be set any time we call document.open().
  21. ( CKEDITOR.env.ie ? '(' + CKEDITOR.tools.fixDomain + ')();' : '' ) +
  22. 'document.close();';
  23. // With IE, the custom domain has to be taken care at first,
  24. // for other browers, the 'src' attribute should be left empty to
  25. // trigger iframe's 'load' event.
  26. src = CKEDITOR.env.air ? 'javascript:void(0)' : CKEDITOR.env.ie ? 'javascript:void(function(){' + encodeURIComponent( src ) + '}())'
  27. :
  28. '';
  29. var iframe = CKEDITOR.dom.element.createFromHtml( '<iframe src="' + src + '" frameBorder="0"></iframe>' );
  30. iframe.setStyles( { width: '100%', height: '100%' } );
  31. iframe.addClass( 'cke_wysiwyg_frame cke_reset' );
  32. var contentSpace = editor.ui.space( 'contents' );
  33. contentSpace.append( iframe );
  34. // Asynchronous iframe loading is only required in IE>8 and Gecko (other reasons probably).
  35. // Do not use it on WebKit as it'll break the browser-back navigation.
  36. var useOnloadEvent = CKEDITOR.env.ie || CKEDITOR.env.gecko;
  37. if ( useOnloadEvent )
  38. iframe.on( 'load', onLoad );
  39. var frameLabel = editor.title,
  40. frameDesc = editor.lang.common.editorHelp;
  41. if ( frameLabel ) {
  42. if ( CKEDITOR.env.ie )
  43. frameLabel += ', ' + frameDesc;
  44. iframe.setAttribute( 'title', frameLabel );
  45. }
  46. var labelId = CKEDITOR.tools.getNextId(),
  47. desc = CKEDITOR.dom.element.createFromHtml( '<span id="' + labelId + '" class="cke_voice_label">' + frameDesc + '</span>' );
  48. contentSpace.append( desc, 1 );
  49. // Remove the ARIA description.
  50. editor.on( 'beforeModeUnload', function( evt ) {
  51. evt.removeListener();
  52. desc.remove();
  53. });
  54. iframe.setAttributes({
  55. 'aria-describedby': labelId,
  56. tabIndex: editor.tabIndex,
  57. allowTransparency: 'true'
  58. });
  59. // Execute onLoad manually for all non IE||Gecko browsers.
  60. !useOnloadEvent && onLoad();
  61. if ( CKEDITOR.env.webkit ) {
  62. // Webkit: iframe size doesn't auto fit well. (#7360)
  63. var onResize = function() {
  64. // Hide the iframe to get real size of the holder. (#8941)
  65. contentSpace.setStyle( 'width', '100%' );
  66. iframe.hide();
  67. iframe.setSize( 'width', contentSpace.getSize( 'width' ) );
  68. contentSpace.removeStyle( 'width' );
  69. iframe.show();
  70. };
  71. iframe.setCustomData( 'onResize', onResize );
  72. CKEDITOR.document.getWindow().on( 'resize', onResize );
  73. }
  74. editor.fire( 'ariaWidget', iframe );
  75. function onLoad( evt ) {
  76. evt && evt.removeListener();
  77. editor.editable( new framedWysiwyg( editor, iframe.$.contentWindow.document.body ) );
  78. editor.setData( editor.getData( 1 ), callback );
  79. }
  80. });
  81. }
  82. });
  83. function onDomReady( win ) {
  84. var editor = this.editor,
  85. doc = win.document,
  86. body = doc.body;
  87. // Remove helper scripts from the DOM.
  88. var script = doc.getElementById( 'cke_actscrpt' );
  89. script && script.parentNode.removeChild( script );
  90. script = doc.getElementById( 'cke_shimscrpt' );
  91. script && script.parentNode.removeChild( script );
  92. if ( CKEDITOR.env.gecko ) {
  93. // Force Gecko to change contentEditable from false to true on domReady
  94. // (because it's previously set to true on iframe's body creation).
  95. // Otherwise del/backspace and some other editable features will be broken in Fx <4
  96. // See: #107 and https://bugzilla.mozilla.org/show_bug.cgi?id=440916
  97. body.contentEditable = false;
  98. // Remove any leading <br> which is between the <body> and the comment.
  99. // This one fixes Firefox 3.6 bug: the browser inserts a leading <br>
  100. // on document.write if the body has contenteditable="true".
  101. if ( CKEDITOR.env.version < 20000 ) {
  102. body.innerHTML = body.innerHTML.replace( /^.*<!-- cke-content-start -->/, '' );
  103. // The above hack messes up the selection in FF36.
  104. // To clean this up, manually select collapsed range that
  105. // starts within the body.
  106. setTimeout( function() {
  107. var range = new CKEDITOR.dom.range( new CKEDITOR.dom.document( doc ) );
  108. range.setStart( new CKEDITOR.dom.node( body ), 0 );
  109. editor.getSelection().selectRanges( [ range ] );
  110. }, 0 );
  111. }
  112. }
  113. body.contentEditable = true;
  114. if ( CKEDITOR.env.ie ) {
  115. // Don't display the focus border.
  116. body.hideFocus = true;
  117. // Disable and re-enable the body to avoid IE from
  118. // taking the editing focus at startup. (#141 / #523)
  119. body.disabled = true;
  120. body.removeAttribute( 'disabled' );
  121. }
  122. delete this._.isLoadingData;
  123. // Play the magic to alter element reference to the reloaded one.
  124. this.$ = body;
  125. doc = new CKEDITOR.dom.document( doc );
  126. this.setup();
  127. if ( CKEDITOR.env.ie ) {
  128. doc.getDocumentElement().addClass( doc.$.compatMode );
  129. // Prevent IE from leaving new paragraph after deleting all contents in body. (#6966)
  130. editor.config.enterMode != CKEDITOR.ENTER_P && doc.on( 'selectionchange', function() {
  131. var body = doc.getBody(),
  132. sel = editor.getSelection(),
  133. range = sel && sel.getRanges()[ 0 ];
  134. if ( range && body.getHtml().match( /^<p>(?:&nbsp;|<br>)<\/p>$/i ) && range.startContainer.equals( body ) ) {
  135. // Avoid the ambiguity from a real user cursor position.
  136. setTimeout( function() {
  137. range = editor.getSelection().getRanges()[ 0 ];
  138. if ( !range.startContainer.equals( 'body' ) ) {
  139. body.getFirst().remove( 1 );
  140. range.moveToElementEditEnd( body );
  141. range.select();
  142. }
  143. }, 0 );
  144. }
  145. } );
  146. }
  147. // Fix problem with cursor not appearing in Webkit and IE11+ when clicking below the body (#10945, #10906).
  148. // Fix for older IEs (8-10 and QM) is placed inside selection.js.
  149. if ( CKEDITOR.env.webkit || ( CKEDITOR.env.ie && CKEDITOR.env.version > 10 ) ) {
  150. doc.getDocumentElement().on( 'mousedown', function( evt ) {
  151. if ( evt.data.getTarget().is( 'html' ) ) {
  152. // IE needs this timeout. Webkit does not, but it does not cause problems too.
  153. setTimeout( function() {
  154. editor.editable().focus();
  155. } );
  156. }
  157. } );
  158. }
  159. // ## START : disableNativeTableHandles and disableObjectResizing settings.
  160. // Enable dragging of position:absolute elements in IE.
  161. try {
  162. editor.document.$.execCommand( '2D-position', false, true );
  163. } catch ( e ) {}
  164. // IE, Opera and Safari may not support it and throw errors.
  165. try {
  166. editor.document.$.execCommand( 'enableInlineTableEditing', false, !editor.config.disableNativeTableHandles );
  167. } catch ( e ) {}
  168. if ( editor.config.disableObjectResizing ) {
  169. try {
  170. this.getDocument().$.execCommand( 'enableObjectResizing', false, false );
  171. } catch ( e ) {
  172. // For browsers in which the above method failed, we can cancel the resizing on the fly (#4208)
  173. this.attachListener( this, CKEDITOR.env.ie ? 'resizestart' : 'resize', function( evt ) {
  174. evt.data.preventDefault();
  175. });
  176. }
  177. }
  178. if ( CKEDITOR.env.gecko || CKEDITOR.env.ie && editor.document.$.compatMode == 'CSS1Compat' ) {
  179. this.attachListener( this, 'keydown', function( evt ) {
  180. var keyCode = evt.data.getKeystroke();
  181. // PageUp OR PageDown
  182. if ( keyCode == 33 || keyCode == 34 ) {
  183. // PageUp/PageDown scrolling is broken in document
  184. // with standard doctype, manually fix it. (#4736)
  185. if ( CKEDITOR.env.ie ) {
  186. setTimeout( function() {
  187. editor.getSelection().scrollIntoView();
  188. }, 0 );
  189. }
  190. // Page up/down cause editor selection to leak
  191. // outside of editable thus we try to intercept
  192. // the behavior, while it affects only happen
  193. // when editor contents are not overflowed. (#7955)
  194. else if ( editor.window.$.innerHeight > this.$.offsetHeight ) {
  195. var range = editor.createRange();
  196. range[ keyCode == 33 ? 'moveToElementEditStart' : 'moveToElementEditEnd' ]( this );
  197. range.select();
  198. evt.data.preventDefault();
  199. }
  200. }
  201. });
  202. }
  203. if ( CKEDITOR.env.ie ) {
  204. // [IE] Iframe will still keep the selection when blurred, if
  205. // focus is moved onto a non-editing host, e.g. link or button, but
  206. // it becomes a problem for the object type selection, since the resizer
  207. // handler attached on it will mark other part of the UI, especially
  208. // for the dialog. (#8157)
  209. // [IE<8 & Opera] Even worse For old IEs, the cursor will not vanish even if
  210. // the selection has been moved to another text input in some cases. (#4716)
  211. //
  212. // Now the range restore is disabled, so we simply force IE to clean
  213. // up the selection before blur.
  214. this.attachListener( doc, 'blur', function() {
  215. // Error proof when the editor is not visible. (#6375)
  216. try {
  217. doc.$.selection.empty();
  218. } catch ( er ) {}
  219. });
  220. }
  221. // ## END
  222. var title = editor.document.getElementsByTag( 'title' ).getItem( 0 );
  223. title.data( 'cke-title', editor.document.$.title );
  224. // [IE] JAWS will not recognize the aria label we used on the iframe
  225. // unless the frame window title string is used as the voice label,
  226. // backup the original one and restore it on output.
  227. if ( CKEDITOR.env.ie )
  228. editor.document.$.title = this._.docTitle;
  229. CKEDITOR.tools.setTimeout( function() {
  230. editor.fire( 'contentDom' );
  231. if ( this._.isPendingFocus ) {
  232. editor.focus();
  233. this._.isPendingFocus = false;
  234. }
  235. setTimeout( function() {
  236. editor.fire( 'dataReady' );
  237. }, 0 );
  238. // IE BUG: IE might have rendered the iframe with invisible contents.
  239. // (#3623). Push some inconsequential CSS style changes to force IE to
  240. // refresh it.
  241. //
  242. // Also, for some unknown reasons, short timeouts (e.g. 100ms) do not
  243. // fix the problem. :(
  244. if ( CKEDITOR.env.ie ) {
  245. setTimeout( function() {
  246. if ( editor.document ) {
  247. var $body = editor.document.$.body;
  248. $body.runtimeStyle.marginBottom = '0px';
  249. $body.runtimeStyle.marginBottom = '';
  250. }
  251. }, 1000 );
  252. }
  253. }, 0, this );
  254. }
  255. var framedWysiwyg = CKEDITOR.tools.createClass({
  256. $: function( editor ) {
  257. this.base.apply( this, arguments );
  258. this._.frameLoadedHandler = CKEDITOR.tools.addFunction( function( win ) {
  259. // Avoid opening design mode in a frame window thread,
  260. // which will cause host page scrolling.(#4397)
  261. CKEDITOR.tools.setTimeout( onDomReady, 0, this, win );
  262. }, this );
  263. this._.docTitle = this.getWindow().getFrame().getAttribute( 'title' );
  264. },
  265. base: CKEDITOR.editable,
  266. proto: {
  267. setData: function( data, isSnapshot ) {
  268. var editor = this.editor;
  269. if ( isSnapshot ) {
  270. this.setHtml( data );
  271. // Fire dataReady for the consistency with inline editors
  272. // and because it makes sense. (#10370)
  273. editor.fire( 'dataReady' );
  274. }
  275. else {
  276. this._.isLoadingData = true;
  277. editor._.dataStore = { id:1 };
  278. var config = editor.config,
  279. fullPage = config.fullPage,
  280. docType = config.docType;
  281. // Build the additional stuff to be included into <head>.
  282. var headExtra = CKEDITOR.tools.buildStyleHtml( iframeCssFixes() )
  283. .replace( /<style>/, '<style data-cke-temp="1">' );
  284. if ( !fullPage )
  285. headExtra += CKEDITOR.tools.buildStyleHtml( editor.config.contentsCss );
  286. var baseTag = config.baseHref ? '<base href="' + config.baseHref + '" data-cke-temp="1" />' : '';
  287. if ( fullPage ) {
  288. // Search and sweep out the doctype declaration.
  289. data = data.replace( /<!DOCTYPE[^>]*>/i, function( match ) {
  290. editor.docType = docType = match;
  291. return '';
  292. }).replace( /<\?xml\s[^\?]*\?>/i, function( match ) {
  293. editor.xmlDeclaration = match;
  294. return '';
  295. });
  296. }
  297. // Get the HTML version of the data.
  298. data = editor.dataProcessor.toHtml( data );
  299. if ( fullPage ) {
  300. // Check if the <body> tag is available.
  301. if ( !( /<body[\s|>]/ ).test( data ) )
  302. data = '<body>' + data;
  303. // Check if the <html> tag is available.
  304. if ( !( /<html[\s|>]/ ).test( data ) )
  305. data = '<html>' + data + '</html>';
  306. // Check if the <head> tag is available.
  307. if ( !( /<head[\s|>]/ ).test( data ) )
  308. data = data.replace( /<html[^>]*>/, '$&<head><title></title></head>' );
  309. else if ( !( /<title[\s|>]/ ).test( data ) )
  310. data = data.replace( /<head[^>]*>/, '$&<title></title>' );
  311. // The base must be the first tag in the HEAD, e.g. to get relative
  312. // links on styles.
  313. baseTag && ( data = data.replace( /<head>/, '$&' + baseTag ) );
  314. // Inject the extra stuff into <head>.
  315. // Attention: do not change it before testing it well. (V2)
  316. // This is tricky... if the head ends with <meta ... content type>,
  317. // Firefox will break. But, it works if we place our extra stuff as
  318. // the last elements in the HEAD.
  319. data = data.replace( /<\/head\s*>/, headExtra + '$&' );
  320. // Add the DOCTYPE back to it.
  321. data = docType + data;
  322. } else {
  323. data = config.docType +
  324. '<html dir="' + config.contentsLangDirection + '"' +
  325. ' lang="' + ( config.contentsLanguage || editor.langCode ) + '">' +
  326. '<head>' +
  327. '<title>' + this._.docTitle + '</title>' +
  328. baseTag +
  329. headExtra +
  330. '</head>' +
  331. '<body' + ( config.bodyId ? ' id="' + config.bodyId + '"' : '' ) +
  332. ( config.bodyClass ? ' class="' + config.bodyClass + '"' : '' ) +
  333. '>' +
  334. data +
  335. '</body>' +
  336. '</html>';
  337. }
  338. if ( CKEDITOR.env.gecko ) {
  339. // Hack to make Fx put cursor at the start of doc on fresh focus.
  340. data = data.replace( /<body/, '<body contenteditable="true" ' );
  341. // Another hack which is used by onDomReady to remove a leading
  342. // <br> which is inserted by Firefox 3.6 when document.write is called.
  343. // This additional <br> is present because of contenteditable="true"
  344. if ( CKEDITOR.env.version < 20000 )
  345. data = data.replace( /<body[^>]*>/, '$&<!-- cke-content-start -->' );
  346. }
  347. // The script that launches the bootstrap logic on 'domReady', so the document
  348. // is fully editable even before the editing iframe is fully loaded (#4455).
  349. var bootstrapCode =
  350. '<script id="cke_actscrpt" type="text/javascript"' + ( CKEDITOR.env.ie ? ' defer="defer" ' : '' ) + '>' +
  351. 'var wasLoaded=0;' + // It must be always set to 0 as it remains as a window property.
  352. 'function onload(){' +
  353. 'if(!wasLoaded)' + // FF3.6 calls onload twice when editor.setData. Stop that.
  354. 'window.parent.CKEDITOR.tools.callFunction(' + this._.frameLoadedHandler + ',window);' +
  355. 'wasLoaded=1;' +
  356. '}' +
  357. ( CKEDITOR.env.ie ? 'onload();' : 'document.addEventListener("DOMContentLoaded", onload, false );' ) +
  358. '</script>';
  359. // For IE<9 add support for HTML5's elements.
  360. // Note: this code must not be deferred.
  361. if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 ) {
  362. bootstrapCode +=
  363. '<script id="cke_shimscrpt">' +
  364. 'window.parent.CKEDITOR.tools.enableHtml5Elements(document)' +
  365. '</script>';
  366. }
  367. data = data.replace( /(?=\s*<\/(:?head)>)/, bootstrapCode );
  368. // Current DOM will be deconstructed by document.write, cleanup required.
  369. this.clearCustomData();
  370. this.clearListeners();
  371. editor.fire( 'contentDomUnload' );
  372. var doc = this.getDocument();
  373. // Work around Firefox bug - error prune when called from XUL (#320),
  374. // defer it thanks to the async nature of this method.
  375. try { doc.write( data ); } catch ( e ) {
  376. setTimeout( function () { doc.write( data ); }, 0 );
  377. }
  378. }
  379. },
  380. getData: function( isSnapshot ) {
  381. if ( isSnapshot )
  382. return this.getHtml();
  383. else {
  384. var editor = this.editor,
  385. config = editor.config,
  386. fullPage = config.fullPage,
  387. docType = fullPage && editor.docType,
  388. xmlDeclaration = fullPage && editor.xmlDeclaration,
  389. doc = this.getDocument();
  390. var data = fullPage ? doc.getDocumentElement().getOuterHtml() : doc.getBody().getHtml();
  391. // BR at the end of document is bogus node for Mozilla. (#5293).
  392. // Prevent BRs from disappearing from the end of the content
  393. // while enterMode is ENTER_BR (#10146).
  394. if ( CKEDITOR.env.gecko && config.enterMode != CKEDITOR.ENTER_BR )
  395. data = data.replace( /<br>(?=\s*(:?$|<\/body>))/, '' );
  396. data = editor.dataProcessor.toDataFormat( data );
  397. if ( xmlDeclaration )
  398. data = xmlDeclaration + '\n' + data;
  399. if ( docType )
  400. data = docType + '\n' + data;
  401. return data;
  402. }
  403. },
  404. focus: function() {
  405. if ( this._.isLoadingData )
  406. this._.isPendingFocus = true;
  407. else
  408. framedWysiwyg.baseProto.focus.call( this );
  409. },
  410. detach: function() {
  411. var editor = this.editor,
  412. doc = editor.document,
  413. iframe = editor.window.getFrame();
  414. framedWysiwyg.baseProto.detach.call( this );
  415. // Memory leak proof.
  416. this.clearCustomData();
  417. doc.getDocumentElement().clearCustomData();
  418. iframe.clearCustomData();
  419. CKEDITOR.tools.removeFunction( this._.frameLoadedHandler );
  420. var onResize = iframe.removeCustomData( 'onResize' );
  421. onResize && onResize.removeListener();
  422. editor.fire( 'contentDomUnload' );
  423. // IE BUG: When destroying editor DOM with the selection remains inside
  424. // editing area would break IE7/8's selection system, we have to put the editing
  425. // iframe offline first. (#3812 and #5441)
  426. iframe.remove();
  427. }
  428. }
  429. });
  430. // DOM modification here should not bother dirty flag.(#4385)
  431. function restoreDirty( editor ) {
  432. if ( !editor.checkDirty() )
  433. setTimeout( function() {
  434. editor.resetDirty();
  435. }, 0 );
  436. }
  437. function iframeCssFixes() {
  438. var css = [];
  439. // IE>=8 stricts mode doesn't have 'contentEditable' in effect
  440. // on element unless it has layout. (#5562)
  441. if ( CKEDITOR.document.$.documentMode >= 8 ) {
  442. css.push( 'html.CSS1Compat [contenteditable=false]{min-height:0 !important}' );
  443. var selectors = [];
  444. for ( var tag in CKEDITOR.dtd.$removeEmpty )
  445. selectors.push( 'html.CSS1Compat ' + tag + '[contenteditable=false]' );
  446. css.push( selectors.join( ',' ) + '{display:inline-block}' );
  447. }
  448. // Set the HTML style to 100% to have the text cursor in affect (#6341)
  449. else if ( CKEDITOR.env.gecko ) {
  450. css.push( 'html{height:100% !important}' );
  451. css.push( 'img:-moz-broken{-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}' );
  452. }
  453. // #6341: The text cursor must be set on the editor area.
  454. // #6632: Avoid having "text" shape of cursor in IE7 scrollbars.
  455. css.push( 'html{cursor:text;*cursor:auto}' );
  456. // Use correct cursor for these elements
  457. css.push( 'img,input,textarea{cursor:default}' );
  458. return css.join('\n');
  459. }
  460. })();
  461. /**
  462. * Disables the ability of resize objects (image and tables) in the editing area.
  463. *
  464. * config.disableObjectResizing = true;
  465. *
  466. * @cfg
  467. * @member CKEDITOR.config
  468. */
  469. CKEDITOR.config.disableObjectResizing = false;
  470. /**
  471. * Disables the "table tools" offered natively by the browser (currently
  472. * Firefox only) to make quick table editing operations, like adding or
  473. * deleting rows and columns.
  474. *
  475. * config.disableNativeTableHandles = false;
  476. *
  477. * @cfg
  478. * @member CKEDITOR.config
  479. */
  480. CKEDITOR.config.disableNativeTableHandles = true;
  481. /**
  482. * Disables the built-in words spell checker if browser provides one.
  483. *
  484. * **Note:** Although word suggestions provided by browsers (natively) will
  485. * not appear in CKEditor's default context menu,
  486. * users can always reach the native context menu by holding the
  487. * *Ctrl* key when right-clicking if {@link #browserContextMenuOnCtrl}
  488. * is enabled or you're simply not using the context menu plugin.
  489. *
  490. * config.disableNativeSpellChecker = false;
  491. *
  492. * @cfg
  493. * @member CKEDITOR.config
  494. */
  495. CKEDITOR.config.disableNativeSpellChecker = true;
  496. /**
  497. * The CSS file(s) to be used to apply style to the contents. It should
  498. * reflect the CSS used in the final pages where the contents are to be
  499. * used.
  500. *
  501. * config.contentsCss = '/css/mysitestyles.css';
  502. * config.contentsCss = ['/css/mysitestyles.css', '/css/anotherfile.css'];
  503. *
  504. * @cfg {String/Array} [contentsCss=CKEDITOR.basePath + 'contents.css']
  505. * @member CKEDITOR.config
  506. */
  507. CKEDITOR.config.contentsCss = CKEDITOR.basePath + 'contents.css';
  508. /**
  509. * Language code of the writting language which is used to author the editor
  510. * contents.
  511. *
  512. * config.contentsLanguage = 'fr';
  513. *
  514. * @cfg {String} [contentsLanguage=same value with editor's UI language]
  515. * @member CKEDITOR.config
  516. */
  517. /**
  518. * The base href URL used to resolve relative and absolute URLs in the
  519. * editor content.
  520. *
  521. * config.baseHref = 'http://www.example.com/path/';
  522. *
  523. * @cfg {String} [baseHref='']
  524. * @member CKEDITOR.config
  525. */
  526. /**
  527. * Whether automatically create wrapping blocks around inline contents inside document body,
  528. * this helps to ensure the integrality of the block enter mode.
  529. *
  530. * **Note:** Changing the default value might introduce unpredictable usability issues.
  531. *
  532. * config.autoParagraph = false;
  533. *
  534. * @since 3.6
  535. * @cfg {Boolean} [autoParagraph=true]
  536. * @member CKEDITOR.config
  537. */
  538. /**
  539. * Fired when some elements are added to the document.
  540. *
  541. * @event ariaWidget
  542. * @member CKEDITOR.editor
  543. * @param {CKEDITOR.editor} editor This editor instance.
  544. * @param {CKEDITOR.dom.element} data The element being added.
  545. */