Ticket #7932: 7932_5.patch
File 7932_5.patch, 6.7 KB (added by , 11 years ago) |
---|
-
_source/plugins/selection/plugin.js
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
341 341 restoreEnabled = 1; 342 342 }); 343 343 344 // In IE6/7 the blinking cursor appears, but contents are345 // not editable. (#5634)346 if ( CKEDITOR.env.ie && ( CKEDITOR.env.ie7Compat || CKEDITOR.env.version < 8 || CKEDITOR.env.quirks ) )347 {348 // The 'click' event is not fired when clicking the349 // scrollbars, so we can use it to check whether350 // the empty space following <body> has been clicked.351 html.on( 'click', function( evt )352 {353 if ( evt.data.getTarget().getName() == 'html' )354 editor.getSelection().getRanges()[ 0 ].select();355 });356 }357 358 344 var scroll; 359 345 // IE fires the "selectionchange" event when clicking 360 346 // inside a selection. We don't want to capture that. … … 399 385 saveSelection(); 400 386 }); 401 387 388 // When content doc is in standards mode, IE doesn't focus the editor when 389 // clicking at the region below body (on html element) content, we emulate 390 // the normal behavior on old IEs. (#1659, #7932) 391 if ( ( CKEDITOR.env.ie7Compat || CKEDITOR.env.ie6Compat ) 392 && doc.$.compatMode != 'BackCompat' ) 393 { 394 html.on( 'mousedown', function( evt ) 395 { 396 evt = evt.data.$; 397 398 // Expand the text range along with mouse move. 399 function onHover( evt ) 400 { 401 evt = evt.data.$; 402 if ( textRng ) 403 { 404 // Read the current cursor. 405 var rngEnd = body.$.createTextRange(); 406 rngEnd.moveToPoint( evt.x, evt.y ); 407 408 // Handle drag directions. 409 textRng.setEndPoint( 410 textRng.compareEndPoints( 'StartToStart', rngEnd ) < 0 ? 411 'EndToEnd' : 412 'StartToStart', 413 rngEnd ); 414 415 // Update selection with new range. 416 textRng.select(); 417 } 418 } 419 420 // We're sure that the click happens at the region 421 // below body, but not on scrollbar. 422 if ( evt.y < html.$.clientHeight 423 && evt.y > body.$.clientHeight 424 && evt.x < html.$.clientWidth ) 425 { 426 // Start to build the text range. 427 var textRng = body.$.createTextRange(); 428 textRng.moveToPoint( evt.x, evt.y ); 429 textRng.select(); 430 431 html.on( 'mousemove', onHover ); 432 433 html.on( 'mouseup', function( evt ) 434 { 435 html.removeListener( 'mousemove', onHover ); 436 evt.removeListener(); 437 textRng.select(); 438 textRng = null; 439 } ); 440 } 441 }); 442 } 443 444 // It's much simpler for IE8, we just need to reselect the reported range. 445 if ( CKEDITOR.env.ie8 ) 446 { 447 html.on( 'mouseup', function( evt ) 448 { 449 // The event is not fired when clicking on the scrollbars, 450 // so we can safely check the following to understand 451 // whether the empty space following <body> has been clicked. 452 if ( evt.data.getTarget().getName() == 'html' ) 453 { 454 var sel = CKEDITOR.document.$.selection, 455 range = sel.createRange(); 456 // The selection range is reported on host, but actually it should applies to the content doc. 457 if ( sel.type != 'None' && range.parentElement().ownerDocument == doc.$ ) 458 range.select(); 459 } 460 } ); 461 } 402 462 403 463 // IE is the only to provide the "selectionchange" 404 464 // event. -
_source/plugins/wysiwygarea/plugin.js
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
689 689 } ); 690 690 } 691 691 692 // IE standard compliant in editing frame doesn't focus the editor when693 // clicking outside actual content, manually apply the focus. (#1659)694 if ( editable &&695 CKEDITOR.env.ie && domDocument.$.compatMode == 'CSS1Compat'696 || CKEDITOR.env.gecko697 || CKEDITOR.env.opera )698 {699 var htmlElement = domDocument.getDocumentElement();700 htmlElement.on( 'mousedown', function( evt )701 {702 // Setting focus directly on editor doesn't work, we703 // have to use here a temporary element to 'redirect'704 // the focus.705 if ( evt.data.getTarget().equals( htmlElement ) )706 {707 if ( CKEDITOR.env.gecko && CKEDITOR.env.version >= 10900 )708 blinkCursor();709 focusGrabber.focus();710 }711 } );712 }713 714 692 var focusTarget = CKEDITOR.env.ie ? iframe : domWindow; 715 693 focusTarget.on( 'blur', function() 716 694 { … … 1196 1174 body.setAttribute( 'contentEditable', true ); 1197 1175 // Try it again once.. 1198 1176 !retry && blinkCursor( 1 ); 1199 }); 1200 } 1201 1202 // Create an invisible element to grab focus. 1203 if ( CKEDITOR.env.gecko || CKEDITOR.env.ie || CKEDITOR.env.opera ) 1204 { 1205 var focusGrabber; 1206 editor.on( 'uiReady', function() 1207 { 1208 focusGrabber = editor.container.append( CKEDITOR.dom.element.createFromHtml( 1209 // Use 'span' instead of anything else to fly under the screen-reader radar. (#5049) 1210 '<span tabindex="-1" style="position:absolute;" role="presentation"></span>' ) ); 1211 1212 focusGrabber.on( 'focus', function() 1213 { 1214 editor.focus(); 1215 } ); 1216 1217 editor.focusGrabber = focusGrabber; 1218 } ); 1219 editor.on( 'destroy', function() 1220 { 1221 CKEDITOR.tools.removeFunction( contentDomReadyHandler ); 1222 focusGrabber.clearCustomData(); 1223 delete editor.focusGrabber; 1224 } ); 1177 }); 1225 1178 } 1226 1179 1227 1180 // Disable form elements editing mode provided by some browers. (#5746) -
_source/plugins/clipboard/plugin.js
IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8
226 226 // Wait a while and grab the pasted contents 227 227 window.setTimeout( function() 228 228 { 229 mode == 'text' && CKEDITOR.env.gecko && editor.focusGrabber.focus(); 229 // Gecko need to move focus back from the textarea 230 // to blink the cursor. (#5684) 231 if ( mode == 'text' && CKEDITOR.env.gecko ) 232 editor.document.getBody().focus(); 233 230 234 pastebin.remove(); 231 235 editor.removeListener( 'selectionChange', cancel ); 232 236