2 Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
\r
3 For licensing, see LICENSE.html or http://ckeditor.com/license
\r
7 * @fileOverview The "wysiwygarea" plugin. It registers the "wysiwyg" editing
\r
8 * mode, which handles the main editing area space.
\r
13 // List of elements in which has no way to move editing focus outside.
\r
14 var nonExitableElementNames = { table:1,pre:1 };
\r
16 // Matching an empty paragraph at the end of document.
\r
17 var emptyParagraphRegexp = /\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>| |\u00A0| )?\s*(:?<\/\1>)?\s*(?=$|<\/body>)/gi;
\r
19 function onInsertHtml( evt )
\r
21 if ( this.mode == 'wysiwyg' )
\r
24 this.fire( 'saveSnapshot' );
\r
26 var selection = this.getSelection(),
\r
29 if ( this.dataProcessor )
\r
30 data = this.dataProcessor.toHtml( data );
\r
32 if ( CKEDITOR.env.ie )
\r
34 var selIsLocked = selection.isLocked;
\r
39 var $sel = selection.getNative();
\r
40 if ( $sel.type == 'Control' )
\r
42 $sel.createRange().pasteHTML( data );
\r
45 this.getSelection().lock();
\r
48 this.document.$.execCommand( 'inserthtml', false, data );
\r
50 CKEDITOR.tools.setTimeout( function()
\r
52 this.fire( 'saveSnapshot' );
\r
57 function onInsertElement( evt )
\r
59 if ( this.mode == 'wysiwyg' )
\r
62 this.fire( 'saveSnapshot' );
\r
64 var element = evt.data,
\r
65 elementName = element.getName(),
\r
66 isBlock = CKEDITOR.dtd.$block[ elementName ];
\r
68 var selection = this.getSelection(),
\r
69 ranges = selection.getRanges();
\r
71 var selIsLocked = selection.isLocked;
\r
76 var range, clone, lastElement, bookmark;
\r
78 for ( var i = ranges.length - 1 ; i >= 0 ; i-- )
\r
80 range = ranges[ i ];
\r
82 // Remove the original contents.
\r
83 range.deleteContents();
\r
85 clone = !i && element || element.clone( true );
\r
87 // If we're inserting a block at dtd-violated position, split
\r
88 // the parent blocks until we reach blockLimit.
\r
92 while ( ( current = range.getCommonAncestor( false, true ) )
\r
93 && ( dtd = CKEDITOR.dtd[ current.getName() ] )
\r
94 && !( dtd && dtd [ elementName ] ) )
\r
96 // Split up inline elements.
\r
97 if ( current.getName() in CKEDITOR.dtd.span )
\r
98 range.splitElement( current );
\r
99 // If we're in an empty block which indicate a new paragraph,
\r
100 // simply replace it with the inserting block.(#3664)
\r
101 else if ( range.checkStartOfBlock()
\r
102 && range.checkEndOfBlock() )
\r
104 range.setStartBefore( current );
\r
105 range.collapse( true );
\r
109 range.splitBlock();
\r
113 // Insert the new node.
\r
114 range.insertNode( clone );
\r
116 // Save the last element reference so we can make the
\r
117 // selection later.
\r
118 if ( !lastElement )
\r
119 lastElement = clone;
\r
122 range.moveToPosition( lastElement, CKEDITOR.POSITION_AFTER_END );
\r
124 var next = lastElement.getNextSourceNode( true );
\r
125 if ( next && next.type == CKEDITOR.NODE_ELEMENT )
\r
126 range.moveToElementEditStart( next );
\r
128 selection.selectRanges( [ range ] );
\r
131 this.getSelection().lock();
\r
133 // Save snaps after the whole execution completed.
\r
134 // This's a workaround for make DOM modification's happened after
\r
135 // 'insertElement' to be included either, e.g. Form-based dialogs' 'commitContents'
\r
137 CKEDITOR.tools.setTimeout( function(){
\r
138 this.fire( 'saveSnapshot' );
\r
143 // DOM modification here should not bother dirty flag.(#4385)
\r
144 function restoreDirty( editor )
\r
146 if ( !editor.checkDirty() )
\r
147 setTimeout( function(){ editor.resetDirty(); } );
\r
150 var isNotWhitespace = CKEDITOR.dom.walker.whitespaces( true ),
\r
151 isNotBookmark = CKEDITOR.dom.walker.bookmark( false, true );
\r
153 function isNotEmpty( node )
\r
155 return isNotWhitespace( node ) && isNotBookmark( node );
\r
158 function isNbsp( node )
\r
160 return node.type == CKEDITOR.NODE_TEXT
\r
161 && CKEDITOR.tools.trim( node.getText() ).match( /^(?: |\xa0)$/ );
\r
164 function restoreSelection( selection )
\r
166 if ( selection.isLocked )
\r
168 selection.unlock();
\r
169 setTimeout( function() { selection.lock(); }, 0 );
\r
174 * Auto-fixing block-less content by wrapping paragraph (#3190), prevent
\r
175 * non-exitable-block by padding extra br.(#3189)
\r
177 function onSelectionChangeFixBody( evt )
\r
179 var editor = evt.editor,
\r
180 path = evt.data.path,
\r
181 blockLimit = path.blockLimit,
\r
182 selection = evt.data.selection,
\r
183 range = selection.getRanges()[0],
\r
184 body = editor.document.getBody(),
\r
185 enterMode = editor.config.enterMode;
\r
187 // When enterMode set to block, we'll establing new paragraph only if we're
\r
188 // selecting inline contents right under body. (#3657)
\r
189 if ( enterMode != CKEDITOR.ENTER_BR
\r
191 && blockLimit.getName() == 'body'
\r
194 restoreDirty( editor );
\r
195 CKEDITOR.env.ie && restoreSelection( selection );
\r
197 var fixedBlock = range.fixBlock( true,
\r
198 editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' );
\r
200 // For IE, we should remove any filler node which was introduced before.
\r
201 if ( CKEDITOR.env.ie )
\r
203 var first = fixedBlock.getFirst( isNotEmpty );
\r
204 first && isNbsp( first ) && first.remove();
\r
207 // If the fixed block is blank and already followed by a exitable
\r
208 // block, we should revert the fix. (#3684)
\r
209 if ( fixedBlock.getOuterHtml().match( emptyParagraphRegexp ) )
\r
211 var previousElement = fixedBlock.getPrevious( isNotWhitespace ),
\r
212 nextElement = fixedBlock.getNext( isNotWhitespace );
\r
214 if ( previousElement && previousElement.getName
\r
215 && !( previousElement.getName() in nonExitableElementNames )
\r
216 && range.moveToElementEditStart( previousElement )
\r
217 || nextElement && nextElement.getName
\r
218 && !( nextElement.getName() in nonExitableElementNames )
\r
219 && range.moveToElementEditStart( nextElement ) )
\r
221 fixedBlock.remove();
\r
226 // Notify non-IE that selection has changed.
\r
227 if ( !CKEDITOR.env.ie )
\r
228 editor.selectionChange();
\r
231 // All browsers are incapable to moving cursor out of certain non-exitable
\r
232 // blocks (e.g. table, list, pre) at the end of document, make this happen by
\r
233 // place a bogus node there, which would be later removed by dataprocessor.
\r
234 var walkerRange = new CKEDITOR.dom.range( editor.document ),
\r
235 walker = new CKEDITOR.dom.walker( walkerRange );
\r
236 walkerRange.selectNodeContents( body );
\r
237 walker.evaluator = function( node )
\r
239 return node.type == CKEDITOR.NODE_ELEMENT && ( node.getName() in nonExitableElementNames );
\r
241 walker.guard = function( node, isMoveout )
\r
243 return !( ( node.type == CKEDITOR.NODE_TEXT && isNotWhitespace( node ) ) || isMoveout );
\r
246 if ( walker.previous() )
\r
248 restoreDirty( editor );
\r
249 CKEDITOR.env.ie && restoreSelection( selection );
\r
252 if ( enterMode != CKEDITOR.ENTER_BR )
\r
253 paddingBlock = body.append( new CKEDITOR.dom.element( enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ) );
\r
255 paddingBlock = body;
\r
257 if ( !CKEDITOR.env.ie )
\r
258 paddingBlock.appendBogus();
\r
262 CKEDITOR.plugins.add( 'wysiwygarea',
\r
264 requires : [ 'editingblock' ],
\r
266 init : function( editor )
\r
268 var fixForBody = ( editor.config.enterMode != CKEDITOR.ENTER_BR )
\r
269 ? editor.config.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' : false;
\r
271 var frameLabel = editor.lang.editorTitle.replace( '%1', editor.name );
\r
273 editor.on( 'editingBlockReady', function()
\r
283 // Support for custom document.domain in IE.
\r
284 var isCustomDomain = CKEDITOR.env.isCustomDomain();
\r
286 // Creates the iframe that holds the editable document.
\r
287 var createIFrame = function( data )
\r
294 var setDataFn = !CKEDITOR.env.gecko && CKEDITOR.tools.addFunction( function( doc )
\r
296 CKEDITOR.tools.removeFunction( setDataFn );
\r
301 'document.open();' +
\r
303 // The document domain must be set any time we
\r
304 // call document.open().
\r
305 ( isCustomDomain ? ( 'document.domain="' + document.domain + '";' ) : '' ) +
\r
307 ( ( 'parent.CKEDITOR.tools.callFunction(' + setDataFn + ',document);' ) ) +
\r
309 'document.close();';
\r
311 iframe = CKEDITOR.dom.element.createFromHtml( '<iframe' +
\r
312 ' style="width:100%;height:100%"' +
\r
313 ' frameBorder="0"' +
\r
314 ' title="' + frameLabel + '"' +
\r
315 // With FF, the 'src' attribute should be left empty to
\r
316 // trigger iframe's 'load' event.
\r
317 ' src="' + ( CKEDITOR.env.gecko ? '' : 'javascript:void(function(){' + encodeURIComponent( srcScript ) + '}())' ) + '"' +
\r
318 ' tabIndex="' + editor.tabIndex + '"' +
\r
319 ' allowTransparency="true"' +
\r
322 // With FF, it's better to load the data on iframe.load. (#3894,#4058)
\r
323 CKEDITOR.env.gecko && iframe.on( 'load', function( ev )
\r
325 ev.removeListener();
\r
327 var doc = iframe.getFrameDocument().$;
\r
334 mainElement.append( iframe );
\r
337 // The script that launches the bootstrap logic on 'domReady', so the document
\r
338 // is fully editable even before the editing iframe is fully loaded (#4455).
\r
339 var activationScript =
\r
340 '<script id="cke_actscrpt" type="text/javascript" cke_temp="1">' +
\r
341 ( isCustomDomain ? ( 'document.domain="' + document.domain + '";' ) : '' ) +
\r
342 'parent.CKEDITOR._["contentDomReady' + editor.name + '"]( window );' +
\r
345 // Editing area bootstrap code.
\r
346 var contentDomReady = function( domWindow )
\r
352 editor.fire( 'ariaWidget', iframe );
\r
354 var domDocument = domWindow.document,
\r
355 body = domDocument.body;
\r
357 // Remove this script from the DOM.
\r
358 var script = domDocument.getElementById( "cke_actscrpt" );
\r
359 script.parentNode.removeChild( script );
\r
361 delete CKEDITOR._[ 'contentDomReady' + editor.name ];
\r
363 body.spellcheck = !editor.config.disableNativeSpellChecker;
\r
365 if ( CKEDITOR.env.ie )
\r
367 // Don't display the focus border.
\r
368 body.hideFocus = true;
\r
370 // Disable and re-enable the body to avoid IE from
\r
371 // taking the editing focus at startup. (#141 / #523)
\r
372 body.disabled = true;
\r
373 body.contentEditable = true;
\r
374 body.removeAttribute( 'disabled' );
\r
377 domDocument.designMode = 'on';
\r
379 // IE, Opera and Safari may not support it and throw
\r
381 try { domDocument.execCommand( 'enableObjectResizing', false, !editor.config.disableObjectResizing ) ; } catch(e) {}
\r
382 try { domDocument.execCommand( 'enableInlineTableEditing', false, !editor.config.disableNativeTableHandles ) ; } catch(e) {}
\r
384 domWindow = editor.window = new CKEDITOR.dom.window( domWindow );
\r
385 domDocument = editor.document = new CKEDITOR.dom.document( domDocument );
\r
387 // Gecko/Webkit need some help when selecting control type elements. (#3448)
\r
388 if ( !( CKEDITOR.env.ie || CKEDITOR.env.opera) )
\r
390 domDocument.on( 'mousedown', function( ev )
\r
392 var control = ev.data.getTarget();
\r
393 if ( control.is( 'img', 'hr', 'input', 'textarea', 'select' ) )
\r
394 editor.getSelection().selectElement( control );
\r
398 // Webkit: avoid from editing form control elements content.
\r
399 if ( CKEDITOR.env.webkit )
\r
401 // Prevent from tick checkbox/radiobox/select
\r
402 domDocument.on( 'click', function( ev )
\r
404 if ( ev.data.getTarget().is( 'input', 'select' ) )
\r
405 ev.data.preventDefault();
\r
408 // Prevent from editig textfield/textarea value.
\r
409 domDocument.on( 'mouseup', function( ev )
\r
411 if ( ev.data.getTarget().is( 'input', 'textarea' ) )
\r
412 ev.data.preventDefault();
\r
416 // IE standard compliant in editing frame doesn't focus the editor when
\r
417 // clicking outside actual content, manually apply the focus. (#1659)
\r
418 if ( CKEDITOR.env.ie
\r
419 && domDocument.$.compatMode == 'CSS1Compat' )
\r
421 var htmlElement = domDocument.getDocumentElement();
\r
422 htmlElement.on( 'mousedown', function( evt )
\r
424 // Setting focus directly on editor doesn't work, we
\r
425 // have to use here a temporary element to 'redirect'
\r
427 if ( evt.data.getTarget().equals( htmlElement ) )
\r
428 ieFocusGrabber.focus();
\r
432 var focusTarget = ( CKEDITOR.env.ie || CKEDITOR.env.webkit ) ?
\r
433 domWindow : domDocument;
\r
435 focusTarget.on( 'blur', function()
\r
437 editor.focusManager.blur();
\r
440 focusTarget.on( 'focus', function()
\r
442 // Gecko need a key event to 'wake up' the editing
\r
443 // ability when document is empty.(#3864)
\r
444 if ( CKEDITOR.env.gecko )
\r
447 while ( first.firstChild )
\r
448 first = first.firstChild;
\r
450 if ( !first.nextSibling
\r
451 && ( 'BR' == first.tagName )
\r
452 && first.hasAttribute( '_moz_editor_bogus_node' ) )
\r
454 restoreDirty( editor );
\r
455 var keyEventSimulate = domDocument.$.createEvent( "KeyEvents" );
\r
456 keyEventSimulate.initKeyEvent( 'keypress', true, true, domWindow.$, false,
\r
457 false, false, false, 0, 32 );
\r
458 domDocument.$.dispatchEvent( keyEventSimulate );
\r
459 var bogusText = domDocument.getBody().getFirst() ;
\r
460 // Compensate the line maintaining <br> if enterMode is not block.
\r
461 if ( editor.config.enterMode == CKEDITOR.ENTER_BR )
\r
462 domDocument.createElement( 'br', { attributes: { '_moz_dirty' : "" } } )
\r
463 .replace( bogusText );
\r
465 bogusText.remove();
\r
469 editor.focusManager.focus();
\r
472 var keystrokeHandler = editor.keystrokeHandler;
\r
473 if ( keystrokeHandler )
\r
474 keystrokeHandler.attach( domDocument );
\r
476 if ( CKEDITOR.env.ie )
\r
478 // Override keystrokes which should have deletion behavior
\r
479 // on control types in IE . (#4047)
\r
480 domDocument.on( 'keydown', function( evt )
\r
482 var keyCode = evt.data.getKeystroke();
\r
484 // Backspace OR Delete.
\r
485 if ( keyCode in { 8 : 1, 46 : 1 } )
\r
487 var sel = editor.getSelection(),
\r
488 control = sel.getSelectedElement();
\r
492 // Make undo snapshot.
\r
493 editor.fire( 'saveSnapshot' );
\r
495 // Delete any element that 'hasLayout' (e.g. hr,table) in IE8 will
\r
496 // break up the selection, safely manage it here. (#4795)
\r
497 var bookmark = sel.getRanges()[ 0 ].createBookmark();
\r
498 // Remove the control manually.
\r
500 sel.selectBookmarks( [ bookmark ] );
\r
502 editor.fire( 'saveSnapshot' );
\r
504 evt.data.preventDefault();
\r
509 // PageUp/PageDown scrolling is broken in document
\r
510 // with standard doctype, manually fix it. (#4736)
\r
511 if ( domDocument.$.compatMode == 'CSS1Compat' )
\r
513 var pageUpDownKeys = { 33 : 1, 34 : 1 };
\r
514 domDocument.on( 'keydown', function( evt )
\r
516 if ( evt.data.getKeystroke() in pageUpDownKeys )
\r
518 setTimeout( function ()
\r
520 editor.getSelection().scrollIntoView();
\r
527 // Adds the document body as a context menu target.
\r
528 if ( editor.contextMenu )
\r
529 editor.contextMenu.addTarget( domDocument, editor.config.browserContextMenuOnCtrl !== false );
\r
531 setTimeout( function()
\r
533 editor.fire( 'contentDom' );
\r
537 editor.mode = 'wysiwyg';
\r
538 editor.fire( 'mode' );
\r
542 isLoadingData = false;
\r
544 if ( isPendingFocus )
\r
547 isPendingFocus = false;
\r
549 setTimeout( function()
\r
551 editor.fire( 'dataReady' );
\r
555 * IE BUG: IE might have rendered the iframe with invisible contents.
\r
556 * (#3623). Push some inconsequential CSS style changes to force IE to
\r
559 * Also, for some unknown reasons, short timeouts (e.g. 100ms) do not
\r
560 * fix the problem. :(
\r
562 if ( CKEDITOR.env.ie )
\r
564 setTimeout( function()
\r
566 if ( editor.document )
\r
568 var $body = editor.document.$.body;
\r
569 $body.runtimeStyle.marginBottom = '0px';
\r
570 $body.runtimeStyle.marginBottom = '';
\r
578 editor.addMode( 'wysiwyg',
\r
580 load : function( holderElement, data, isSnapshot )
\r
582 mainElement = holderElement;
\r
584 if ( CKEDITOR.env.ie && CKEDITOR.env.quirks )
\r
585 holderElement.setStyle( 'position', 'relative' );
\r
587 // The editor data "may be dirty" after this
\r
589 editor.mayBeDirty = true;
\r
594 this.loadSnapshotData( data );
\r
596 this.loadData( data );
\r
599 loadData : function( data )
\r
601 isLoadingData = true;
\r
603 var config = editor.config,
\r
604 fullPage = config.fullPage,
\r
605 docType = config.docType;
\r
607 // Build the additional stuff to be included into <head>.
\r
609 '<style type="text/css" cke_temp="1">' +
\r
610 editor._.styles.join( '\n' ) +
\r
613 !fullPage && ( headExtra =
\r
614 CKEDITOR.tools.buildStyleHtml( editor.config.contentsCss ) +
\r
617 var baseTag = config.baseHref ? '<base href="' + config.baseHref + '" cke_temp="1" />' : '';
\r
621 // Search and sweep out the doctype declaration.
\r
622 data = data.replace( /<!DOCTYPE[^>]*>/i, function( match )
\r
624 editor.docType = docType = match;
\r
629 // Get the HTML version of the data.
\r
630 if ( editor.dataProcessor )
\r
631 data = editor.dataProcessor.toHtml( data, fixForBody );
\r
635 // Check if the <body> tag is available.
\r
636 if ( !(/<body[\s|>]/).test( data ) )
\r
637 data = '<body>' + data;
\r
639 // Check if the <html> tag is available.
\r
640 if ( !(/<html[\s|>]/).test( data ) )
\r
641 data = '<html>' + data + '</html>';
\r
643 // Check if the <head> tag is available.
\r
644 if ( !(/<head[\s|>]/).test( data ) )
\r
645 data = data.replace( /<html[^>]*>/, '$&<head><title></title></head>' ) ;
\r
647 // The base must be the first tag in the HEAD, e.g. to get relative
\r
648 // links on styles.
\r
649 baseTag && ( data = data.replace( /<head>/, '$&' + baseTag ) );
\r
651 // Inject the extra stuff into <head>.
\r
652 // Attention: do not change it before testing it well. (V2)
\r
653 // This is tricky... if the head ends with <meta ... content type>,
\r
654 // Firefox will break. But, it works if we place our extra stuff as
\r
655 // the last elements in the HEAD.
\r
656 data = data.replace( /<\/head\s*>/, headExtra + '$&' );
\r
658 // Add the DOCTYPE back to it.
\r
659 data = docType + data;
\r
665 '<html dir="' + config.contentsLangDirection + '">' +
\r
666 '<title>' + frameLabel + '</title>' +
\r
671 '<body' + ( config.bodyId ? ' id="' + config.bodyId + '"' : '' ) +
\r
672 ( config.bodyClass ? ' class="' + config.bodyClass + '"' : '' ) +
\r
678 data += activationScript;
\r
680 CKEDITOR._[ 'contentDomReady' + editor.name ] = contentDomReady;
\r
682 // The iframe is recreated on each call of setData, so we need to clear DOM objects
\r
684 createIFrame( data );
\r
687 getData : function()
\r
689 var config = editor.config,
\r
690 fullPage = config.fullPage,
\r
691 docType = fullPage && editor.docType,
\r
692 doc = iframe.getFrameDocument();
\r
694 var data = fullPage
\r
695 ? doc.getDocumentElement().getOuterHtml()
\r
696 : doc.getBody().getHtml();
\r
698 if ( editor.dataProcessor )
\r
699 data = editor.dataProcessor.toDataFormat( data, fixForBody );
\r
701 // Strip the last blank paragraph within document.
\r
702 if ( config.ignoreEmptyParagraph )
\r
703 data = data.replace( emptyParagraphRegexp, '' );
\r
706 data = docType + '\n' + data;
\r
711 getSnapshotData : function()
\r
713 return iframe.getFrameDocument().getBody().getHtml();
\r
716 loadSnapshotData : function( data )
\r
718 iframe.getFrameDocument().getBody().setHtml( data );
\r
721 onDispose : function()
\r
723 if ( !editor.document )
\r
726 editor.document.getDocumentElement().clearCustomData();
\r
727 editor.document.getBody().clearCustomData();
\r
729 editor.window.clearCustomData();
\r
730 editor.document.clearCustomData();
\r
732 iframe.clearCustomData();
\r
735 unload : function( holderElement )
\r
739 editor.window = editor.document = iframe = mainElement = isPendingFocus = null;
\r
741 editor.fire( 'contentDomUnload' );
\r
746 if ( isLoadingData )
\r
747 isPendingFocus = true;
\r
748 else if ( editor.window )
\r
750 editor.window.focus();
\r
751 editor.selectionChange();
\r
756 editor.on( 'insertHtml', onInsertHtml, null, null, 20 );
\r
757 editor.on( 'insertElement', onInsertElement, null, null, 20 );
\r
758 // Auto fixing on some document structure weakness to enhance usabilities. (#3190 and #3189)
\r
759 editor.on( 'selectionChange', onSelectionChangeFixBody, null, null, 1 );
\r
763 // Setting voice label as window title, backup the original one
\r
764 // and restore it before running into use.
\r
765 editor.on( 'contentDom', function ()
\r
767 var title = editor.document.getElementsByTag( 'title' ).getItem( 0 );
\r
768 title.setAttribute( '_cke_title', editor.document.$.title );
\r
769 editor.document.$.title = frameLabel;
\r
773 // Create an invisible element to grab focus.
\r
774 if ( CKEDITOR.env.ie )
\r
776 var ieFocusGrabber;
\r
777 editor.on( 'uiReady', function()
\r
779 ieFocusGrabber = editor.container.append( CKEDITOR.dom.element.createFromHtml(
\r
780 // Use 'span' instead of anything else to fly under the screen-reader radar. (#5049)
\r
781 '<span tabindex="-1" style="position:absolute; left:-10000" role="presentation"></span>' ) );
\r
783 ieFocusGrabber.on( 'focus', function()
\r
788 editor.on( 'destroy', function()
\r
790 ieFocusGrabber.clearCustomData();
\r
796 // Fixing Firefox 'Back-Forward Cache' break design mode. (#4514)
\r
797 if ( CKEDITOR.env.gecko )
\r
801 var body = document.body;
\r
804 window.addEventListener( 'load', arguments.callee, false );
\r
807 body.setAttribute( 'onpageshow', body.getAttribute( 'onpageshow' )
\r
808 + ';event.persisted && CKEDITOR.tools.callFunction(' +
\r
809 CKEDITOR.tools.addFunction( function()
\r
811 var allInstances = CKEDITOR.instances,
\r
814 for ( var i in allInstances )
\r
816 editor = allInstances[ i ];
\r
817 doc = editor.document;
\r
820 doc.$.designMode = 'off';
\r
821 doc.$.designMode = 'on';
\r
832 * Disables the ability of resize objects (image and tables) in the editing
\r
837 * config.disableObjectResizing = true;
\r
839 CKEDITOR.config.disableObjectResizing = false;
\r
842 * Disables the "table tools" offered natively by the browser (currently
\r
843 * Firefox only) to make quick table editing operations, like adding or
\r
844 * deleting rows and columns.
\r
848 * config.disableNativeTableHandles = false;
\r
850 CKEDITOR.config.disableNativeTableHandles = true;
\r
853 * Disables the built-in spell checker while typing natively available in the
\r
854 * browser (currently Firefox and Safari only).<br /><br />
\r
856 * Even if word suggestions will not appear in the CKEditor context menu, this
\r
857 * feature is useful to help quickly identifying misspelled words.<br /><br />
\r
859 * This setting is currently compatible with Firefox only due to limitations in
\r
864 * config.disableNativeSpellChecker = false;
\r
866 CKEDITOR.config.disableNativeSpellChecker = true;
\r
869 * Whether the editor must output an empty value ("") if it's contents is made
\r
870 * by an empty paragraph only.
\r
874 * config.ignoreEmptyParagraph = false;
\r
876 CKEDITOR.config.ignoreEmptyParagraph = true;
\r
879 * Fired when data is loaded and ready for retrieval in an editor instance.
\r
880 * @name CKEDITOR.editor#dataReady
\r