- // Gecko need a key event to 'wake up' the editing\r
- // ability when document is empty.(#3864)\r
- if ( CKEDITOR.env.gecko && !body.childNodes.length )\r
- {\r
- setTimeout( function()\r
- {\r
- restoreDirty( editor );\r
-\r
- // Simulating keyboard character input by dispatching a keydown of white-space text.\r
- var keyEventSimulate = domDocument.$.createEvent( "KeyEvents" );\r
- keyEventSimulate.initKeyEvent( 'keypress', true, true, domWindow.$, false,\r
- false, false, false, 0, 32 );\r
- domDocument.$.dispatchEvent( keyEventSimulate );\r
-\r
- // Restore the original document status by placing the cursor before a bogus br created (#5021).\r
- domDocument.createElement( 'br', { attributes: { '_moz_editor_bogus_node' : 'TRUE', '_moz_dirty' : "" } } )\r
- .replace( domDocument.getBody().getFirst() );\r
- var nativeRange = new CKEDITOR.dom.range( domDocument );\r
- nativeRange.setStartAt( new CKEDITOR.dom.element( body ) , CKEDITOR.POSITION_AFTER_START );\r
- nativeRange.select();\r
- }, 0 );\r
- }\r
-\r
- // IE, Opera and Safari may not support it and throw\r
- // errors.\r
- try { domDocument.execCommand( 'enableObjectResizing', false, !editor.config.disableObjectResizing ) ; } catch(e) {}\r
- try { domDocument.execCommand( 'enableInlineTableEditing', false, !editor.config.disableNativeTableHandles ) ; } catch(e) {}\r