X-Git-Url: https://jasonwoof.com/gitweb/?p=ckeditor.git;a=blobdiff_plain;f=_source%2Fplugins%2Fwysiwygarea%2Fplugin.js;h=6e4eacb04e65da3d150ac2425879a661956d4ec2;hp=d837ea7afe4cb0852f96eb10a3d80e7363ce2e2c;hb=f0610347140239143439a511ee2bd48cb784f470;hpb=4e70ea24db840898be8cc21c950363a52a2a6aba diff --git a/_source/plugins/wysiwygarea/plugin.js b/_source/plugins/wysiwygarea/plugin.js index d837ea7..6e4eacb 100644 --- a/_source/plugins/wysiwygarea/plugin.js +++ b/_source/plugins/wysiwygarea/plugin.js @@ -51,6 +51,9 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( this.dataProcessor ) data = this.dataProcessor.toHtml( data ); + if ( !data ) + return; + // HTML insertion only considers the first range. var selection = this.getSelection(), range = selection.getRanges()[ 0 ]; @@ -58,6 +61,26 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( range.checkReadOnly() ) return; + // Opera: force block splitting when pasted content contains block. (#7801) + if ( CKEDITOR.env.opera ) + { + var path = new CKEDITOR.dom.elementPath( range.startContainer ); + if ( path.block ) + { + var nodes = CKEDITOR.htmlParser.fragment.fromHtml( data, false ).children; + for ( var i = 0, count = nodes.length; i < count; i++ ) + { + if ( nodes[ i ]._.isBlockLike ) + { + range.splitBlock( this.enterMode == CKEDITOR.ENTER_DIV ? 'div' : 'p' ); + range.insertNode( range.document.createText( '' ) ); + range.select(); + break; + } + } + } + } + if ( CKEDITOR.env.ie ) { var selIsLocked = selection.isLocked; @@ -536,30 +559,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license if ( document.location.protocol == 'chrome:' ) CKEDITOR.event.useCapture = false; - // The container must be visible when creating the iframe in FF (#5956) - var element = editor.element, - isHidden = CKEDITOR.env.gecko && !element.isVisible(), - previousStyles = {}; - if ( isHidden ) - { - element.show(); - previousStyles = { - position : element.getStyle( 'position' ), - top : element.getStyle( 'top' ) - }; - element.setStyles( { position : 'absolute', top : '-3000px' } ); - } - mainElement.append( iframe ); - - if ( isHidden ) - { - setTimeout( function() - { - element.hide(); - element.setStyles( previousStyles ); - }, 1000 ); - } }; // The script that launches the bootstrap logic on 'domReady', so the document