X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=_source%2Fplugins%2Fclipboard%2Fdialogs%2Fpaste.js;h=496b8a6a5872c941efffb12bf4ff3a618fa52cee;hb=8665a7c6c60586526e32e8941fe2896739b6ebfb;hp=70527ad46db6b335ca261a642c9fe615c34cf039;hpb=e7789c1ad838194d45eeee6ac2eb6e55f5cf35a1;p=ckeditor.git diff --git a/_source/plugins/clipboard/dialogs/paste.js b/_source/plugins/clipboard/dialogs/paste.js index 70527ad..496b8a6 100644 --- a/_source/plugins/clipboard/dialogs/paste.js +++ b/_source/plugins/clipboard/dialogs/paste.js @@ -11,18 +11,23 @@ CKEDITOR.dialog.add( 'paste', function( editor ) function onPasteFrameLoad( win ) { var doc = new CKEDITOR.dom.document( win.document ), - $ = doc.$; + docElement = doc.$; doc.getById( "cke_actscrpt" ).remove(); CKEDITOR.env.ie ? - $.body.contentEditable = "true" : - $.designMode = "on"; + docElement.body.contentEditable = "true" : + docElement.designMode = "on"; - CKEDITOR.env.ie && doc.getWindow().on( 'blur', function() + // IE before version 8 will leave cursor blinking inside the document after + // editor blurred unless we clean up the selection. (#4716) + if ( CKEDITOR.env.ie && CKEDITOR.env.version < 8 ) { - $.body.contentEditable = "false"; - } ); + doc.getWindow().on( 'blur', function() + { + docElement.selection.empty(); + } ); + } doc.on( "keydown", function( e ) { @@ -60,10 +65,14 @@ CKEDITOR.dialog.add( 'paste', function( editor ) // inserted iframe editable. (#3366) this.parts.dialog.$.offsetHeight; - var htmlToLoad = '' + - ''; + var htmlToLoad = + '' + + '' + + '' + + ''; var iframe = CKEDITOR.dom.element.createFromHtml( '' ); + focusGrabber.on( 'focus', function() + { + iframe.$.contentWindow.focus(); + }); + container.append( focusGrabber ); + + // Override focus handler on field. + field.focus = function() + { + focusGrabber.focus(); + this.fire( 'focus' ); + }; + } + field.getInputElement = function(){ return iframe; }; // Force container to scale in IE. @@ -165,16 +193,13 @@ CKEDITOR.dialog.add( 'paste', function( editor ) html : '', focus : function() { - var win = this.getInputElement().$.contentWindow, - body = win && win.document.body; + var win = this.getInputElement().$.contentWindow; // #3291 : JAWS needs the 500ms delay to detect that the editor iframe // iframe is no longer editable. So that it will put the focus into the // Paste from Word dialog's editable area instead. setTimeout( function() { - // Reactivate design mode for IE to make the cursor blinking. - CKEDITOR.env.ie && body && ( body.contentEditable = "true" ); win.focus(); }, 500 ); }