Index: /CKEditor/branches/features/aria/_source/lang/en.js =================================================================== --- /CKEditor/branches/features/aria/_source/lang/en.js (revision 4956) +++ /CKEditor/branches/features/aria/_source/lang/en.js (revision 4957) @@ -502,5 +502,6 @@ copyError : 'Your browser security settings don\'t permit the editor to automatically execute copying operations. Please use the keyboard for that (Ctrl+C).', pasteMsg : 'Please paste inside the following box using the keyboard (Ctrl+V) and hit OK', - securityMsg : 'Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.' + securityMsg : 'Because of your browser security settings, the editor is not able to access your clipboard data directly. You are required to paste it again in this window.', + pasteArea : 'paste area' }, Index: /CKEditor/branches/features/aria/_source/plugins/clipboard/dialogs/paste.js =================================================================== --- /CKEditor/branches/features/aria/_source/plugins/clipboard/dialogs/paste.js (revision 4956) +++ /CKEditor/branches/features/aria/_source/plugins/clipboard/dialogs/paste.js (revision 4957) @@ -6,42 +6,92 @@ CKEDITOR.dialog.add( 'paste', function( editor ) { + var lang = editor.lang.clipboard; var isCustomDomain = CKEDITOR.env.isCustomDomain(); + function onPasteFrameLoad( win ) + { + var doc = new CKEDITOR.dom.document( win.document ), + $ = doc.$; + + doc.getById( "cke_actscrpt" ).remove(); + + CKEDITOR.env.ie ? + $.body.contentEditable = "true" : + $.designMode = "on"; + + CKEDITOR.env.ie && doc.getWindow().on( 'blur', function() + { + $.body.contentEditable = "false"; + } ); + + doc.on( "keydown", function( e ) + { + var domEvent = e.data, + key = domEvent.getKeystroke(), + processed; + + switch( key ) + { + case 27 : + this.hide(); + processed = 1; + break; + + case 9 : + case CKEDITOR.SHIFT + 9 : + this.changeFocus( true ); + processed = 1; + } + + processed && domEvent.preventDefault(); + }, this ); + + editor.fire( 'ariaWidget', new CKEDITOR.dom.element( win.frameElement ) ); + } + return { - title : editor.lang.clipboard.title, + title : lang.title, minWidth : CKEDITOR.env.ie && CKEDITOR.env.quirks ? 370 : 350, minHeight : CKEDITOR.env.quirks ? 250 : 245, - htmlToLoad : '
', - onShow : function() { - if ( CKEDITOR.env.ie ) - this.getParentEditor().document.getBody().$.contentEditable = 'false'; - // FIREFOX BUG: Force the browser to render the dialog to make the to-be- // inserted iframe editable. (#3366) this.parts.dialog.$.offsetHeight; - var container = this.getContentElement( 'general', 'editing_area' ).getElement(), - iframe = CKEDITOR.dom.element.createFromHtml( '' ); + var htmlToLoad = '' + + ''; + + var iframe = CKEDITOR.dom.element.createFromHtml( + '' ); - var lang = this.getParentEditor().lang; + iframe.on( 'load', function( e ) + { + e.removeListener(); + var doc = iframe.getFrameDocument().$; + // Custom domain handling is needed after each document.open(). + doc.open(); + if ( isCustomDomain ) + doc.domain = document.domain; + doc.write( htmlToLoad ); + doc.close(); + }, this ); iframe.setStyles( @@ -54,46 +104,16 @@ iframe.setCustomData( 'dialog', this ); - var accTitle = lang.editorTitle.replace( '%1', lang.clipboard.title ); + var field = this.getContentElement( 'general', 'editing_area' ), + container = field.getElement(); + container.setHtml( '' ); + container.append( iframe ); + field.getInputElement = function(){ return iframe }; + + // Force container to scale in IE. if ( CKEDITOR.env.ie ) - container.setHtml( '' ); - else { - container.setHtml( '' ); - container.setAttributes( - { - role : 'region', - title : accTitle - } ); - iframe.setAttributes( - { - role : 'region', - title : ' ' - } ); - } - container.append( iframe ); - if ( CKEDITOR.env.ie ) + container.setStyle( 'display', 'block' ); container.setStyle( 'height', ( iframe.$.offsetHeight + 2 ) + 'px' ); - - if ( isCustomDomain ) - { - CKEDITOR._cke_htmlToLoad = this.definition.htmlToLoad; - iframe.setAttribute( 'src', - 'javascript:void( (function(){' + - 'document.open();' + - 'document.domain="' + document.domain + '";' + - 'document.write( window.parent.CKEDITOR._cke_htmlToLoad );' + - 'delete window.parent.CKEDITOR._cke_htmlToLoad;' + - 'document.close();' + - '})() )' ); - } - else - { - var doc = iframe.$.contentWindow.document; - doc.open(); - doc.write( this.definition.htmlToLoad ); - doc.close(); } }, @@ -132,10 +152,10 @@ type : 'html', id : 'securityMsg', - html : '