var win = editor.window,\r
doc = editor.document,\r
body = editor.document.getBody(),\r
+ bodyFirstChild = body.getFirst(),\r
bodyChildsNum = body.getChildren().count();\r
\r
- if ( !bodyChildsNum || ( bodyChildsNum == 1&& body.getFirst().hasAttribute( '_moz_editor_bogus_node' ) ) )\r
+ if ( !bodyChildsNum\r
+ || bodyChildsNum == 1\r
+ && bodyFirstChild.type == CKEDITOR.NODE_ELEMENT\r
+ && bodyFirstChild.hasAttribute( '_moz_editor_bogus_node' ) )\r
{\r
restoreDirty( editor );\r
\r
activateEditing( editor );\r
\r
// Ensure bogus br could help to move cursor (out of styles) to the end of block. (#7041)\r
- var pathBlock = path.block || path.blockLimit;\r
- if ( pathBlock && !pathBlock.getBogus() )\r
+ var pathBlock = path.block || path.blockLimit,\r
+ lastNode = pathBlock && pathBlock.getLast( isNotEmpty );\r
+\r
+ // In case it's not ended with block element and doesn't have bogus yet. (#7467)\r
+ if ( pathBlock\r
+ && !( lastNode && lastNode.type == CKEDITOR.NODE_ELEMENT && lastNode.isBlockBoundary() )\r
+ && !pathBlock.is( 'pre' )\r
+ && !pathBlock.getBogus() )\r
{\r
editor.fire( 'updateSnapshot' );\r
restoreDirty( editor );\r
}\r
\r
range.select();\r
- // Notify non-IE that selection has changed.\r
- if ( !CKEDITOR.env.ie )\r
- {\r
- // Make sure next selection change is correct. (#6811)\r
- editor.forceNextSelectionCheck();\r
- editor.selectionChange();\r
- }\r
+ // Cancel this selection change in favor of the next (correct). (#6811)\r
+ evt.cancel();\r
}\r
\r
// All browsers are incapable to moving cursor out of certain non-exitable\r
// Webkit: avoid from editing form control elements content.\r
if ( CKEDITOR.env.webkit )\r
{\r
+ // Mark that cursor will right blinking (#7113).\r
+ domDocument.on( 'mousedown', function() { wasFocused = 1; } );\r
// Prevent from tick checkbox/radiobox/select\r
domDocument.on( 'click', function( ev )\r
{\r
}\r
} );\r
}\r
+\r
+ // Prevent IE from leaving new paragraph after deleting all contents in body. (#6966)\r
+ editor.config.enterMode != CKEDITOR.ENTER_P\r
+ && domDocument.on( 'selectionchange', function()\r
+ {\r
+ var body = domDocument.getBody(),\r
+ range = editor.getSelection().getRanges()[ 0 ];\r
+\r
+ if ( body.getHtml().match( /^<p> <\/p>$/i )\r
+ && range.startContainer.equals( body ) )\r
+ {\r
+ // Avoid the ambiguity from a real user cursor position.\r
+ setTimeout( function ()\r
+ {\r
+ range = editor.getSelection().getRanges()[ 0 ];\r
+ if ( !range.startContainer.equals ( 'body' ) )\r
+ {\r
+ body.getFirst().remove( 1 );\r
+ range.moveToElementEditEnd( body );\r
+ range.select( 1 );\r
+ }\r
+ }, 0 );\r
+ }\r
+ });\r
}\r
\r
// Adds the document body as a context menu target.\r
loadData : function( data )\r
{\r
isLoadingData = true;\r
+ editor._.dataStore = { id : 1 };\r
\r
var config = editor.config,\r
fullPage = config.fullPage,\r
'</html>';\r
}\r
\r
+ // Distinguish bogus to normal BR at the end of document for Mozilla. (#5293).\r
+ if ( CKEDITOR.env.gecko )\r
+ data = data.replace( /<br \/>(?=\s*<\/(:?html|body)>)/, '$&<br type="_moz" />' );\r
+\r
data += activationScript;\r
\r
\r
? doc.getDocumentElement().getOuterHtml()\r
: doc.getBody().getHtml();\r
\r
+ // BR at the end of document is bogus node for Mozilla. (#5293).\r
+ if ( CKEDITOR.env.gecko )\r
+ data = data.replace( /<br>(?=\s*(:?$|<\/body>))/, '' );\r
+\r
if ( editor.dataProcessor )\r
data = editor.dataProcessor.toDataFormat( data, fixForBody );\r
\r
CKEDITOR.config.disableNativeTableHandles = true;\r
\r
/**\r
- * Disables the built-in spell checker while typing natively available in the\r
- * browser (currently Firefox and Safari only).<br /><br />\r
+ * Disables the built-in words spell checker if browser provides one.<br /><br />\r
*\r
- * Even if word suggestions will not appear in the CKEditor context menu, this\r
- * feature is useful to help quickly identifying misspelled words.<br /><br />\r
+ * <strong>Note:</strong> Although word suggestions provided by browsers (natively) will not appear in CKEditor's default context menu,\r
+ * users can always reach the native context menu by holding the <em>Ctrl</em> key when right-clicking if {@link CKEDITOR.config.browserContextMenuOnCtrl}\r
+ * is enabled or you're simply not using the context menu plugin.\r
*\r
- * This setting is currently compatible with Firefox only due to limitations in\r
- * other browsers.\r
* @type Boolean\r
* @default true\r
* @example\r