Ticket #3291: 3291.patch
File 3291.patch, 4.7 KB (added by , 15 years ago) |
---|
-
_source/plugins/pastefromword/dialogs/pastefromword.js
16 16 + 'document.body.contentEditable = "true";' 17 17 + 'else ' 18 18 + 'document.designMode = "on";' 19 + 'window.focus();' 19 + 'var iframe = new window.parent.CKEDITOR.dom.element( frameElement );' 20 + 'var dialog = iframe.getCustomData( "dialog" );' 21 + 'dialog.fire( "iframeAdded", { iframe : iframe } );' 20 22 + '};' 21 23 + '</script><style>body { margin: 3px; height: 95%; } </style><body></body>', 22 24 cleanWord : function( editor, html, ignoreFont, removeStyles ) … … 138 140 }, 139 141 onShow : function() 140 142 { 143 if ( CKEDITOR.env.ie ) 144 this.getParentEditor().document.getBody().$.contentEditable = 'false'; 145 141 146 var container = this.getContentElement( 'general', 'editing_area' ).getElement(), 142 147 iframe = CKEDITOR.dom.element.createFromHtml( '<iframe src="javascript:void(0)" frameborder="0" allowtransparency="1"></iframe>' ); 143 148 149 var lang = this.getParentEditor().lang; 150 144 151 iframe.setStyles( 145 152 { 146 153 width : '346px', … … 148 155 'background-color' : 'white', 149 156 border : '1px solid black' 150 157 } ); 151 container.setHtml( '' ); 158 iframe.setCustomData( 'dialog', this ); 159 160 var accTitle = lang.editorTitle.replace( '%1', lang.pastefromword.title ); 161 162 if ( CKEDITOR.env.ie ) 163 container.setHtml( '<legend style="position:absolute;top:-1000000px;left:-1000000px;">' 164 + CKEDITOR.tools.htmlEncode( accTitle ) 165 + '</legend>' ); 166 else 167 { 168 container.setHtml( '' ); 169 container.setAttributes( 170 { 171 role : 'region', 172 title : accTitle 173 } ); 174 iframe.setAttributes( 175 { 176 role : 'region', 177 title : ' ' 178 } ); 179 } 152 180 container.append( iframe ); 153 181 if ( CKEDITOR.env.ie ) 154 182 container.setStyle( 'height', ( iframe.$.offsetHeight + 2 ) + 'px' ); … … 185 213 186 214 editor.insertHtml( html ); 187 215 }, 216 onHide : function() 217 { 218 if ( CKEDITOR.env.ie ) 219 this.getParentEditor().document.getBody().$.contentEditable = 'true'; 220 }, 188 221 contents : 189 222 [ 190 223 { … … 210 243 type : 'html', 211 244 id : 'editing_area', 212 245 style : 'width: 100%; height: 100%;', 213 html : '<div> </div>' 246 html : '<fieldset></fieldset>', 247 focus : function() 248 { 249 var div = this.getElement(); 250 var iframe = div.getElementsByTag( 'iframe' ); 251 if ( iframe.count() < 1 ) 252 return; 253 iframe = iframe.getItem( 0 ); 254 255 // #3291 : JAWS needs the 500ms delay to detect that the editor iframe 256 // iframe is no longer editable. So that it will put the focus into the 257 // Paste from Word dialog's editable area instead. 258 setTimeout( function() 259 { 260 iframe.$.contentWindow.focus(); 261 }, 500 ); 262 } 214 263 }, 215 264 { 216 265 type : 'vbox', -
_source/plugins/dialogui/plugin.js
701 701 if ( theirHtml.charAt( 0 ) != '<' ) 702 702 theirHtml = '<span>' + theirHtml + '</span>'; 703 703 704 // Look for focus function in definition. 705 if ( elementDefinition.focus ) 706 { 707 var oldFocus = this.focus; 708 this.focus = function() 709 { 710 oldFocus.call( this ); 711 elementDefinition.focus.call( this ); 712 this.fire( 'focus' ); 713 }; 714 if ( elementDefinition.isFocusable ) 715 { 716 var oldIsFocusable = this.isFocusable; 717 this.isFocusable = oldIsFocusable; 718 } 719 this.keyboardFocusable = true; 720 } 721 704 722 CKEDITOR.ui.dialog.uiElement.call( this, dialog, elementDefinition, myHtmlList, 'span', null, null, '' ); 705 723 706 724 // Append the attributes created by the uiElement call to the real HTML. -
_source/plugins/dialog/plugin.js
337 337 { 338 338 CKEDITOR.document.removeListener( 'keydown', focusKeydownHandler ); 339 339 } ); 340 this.on( 'iframeAdded', function( evt ) 341 { 342 var doc = new CKEDITOR.dom.document( evt.data.iframe.$.contentWindow.document ); 343 doc.on( 'keydown', focusKeydownHandler, this, null, 0 ); 344 } ); 340 345 341 346 // Auto-focus logic in dialog. 342 347 this.on( 'show', function()