Changeset 31987
- Timestamp:
- 04/02/2015 09:10:28 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/press-this.js
r31925 r31987 530 530 }).on( 'keyup', function() { 531 531 saveAlert = true; 532 }).on( 'paste', function() { 532 }).on( 'paste', function( event ) { 533 var text, range, 534 clipboard = event.originalEvent.clipboardData || window.clipboardData; 535 536 if ( clipboard ) { 537 try{ 538 text = clipboard.getData( 'Text' ) || clipboard.getData( 'text/plain' ); 539 540 if ( text ) { 541 text = $.trim( text.replace( /\s+/g, ' ' ) ); 542 543 if ( window.getSelection ) { 544 range = window.getSelection().getRangeAt(0); 545 546 if ( range ) { 547 if ( ! range.collapsed ) { 548 range.deleteContents(); 549 } 550 551 range.insertNode( document.createTextNode( text ) ); 552 } 553 } else if ( document.selection ) { 554 range = document.selection.createRange(); 555 556 if ( range ) { 557 range.text = text; 558 } 559 } 560 } 561 } catch ( er ) {} 562 563 event.preventDefault(); 564 } 565 533 566 saveAlert = true; 534 567 535 568 setTimeout( function() { 536 569 $titleField.text( getTitleText() ); 537 }, 100 );570 }, 50 ); 538 571 }); 539 572
Note: See TracChangeset
for help on using the changeset viewer.