Ticket #6492: 6492_3.patch
File 6492_3.patch, 1.4 KB (added by , 13 years ago) |
---|
-
_source/plugins/find/dialogs/find.js
598 598 searchRange.setEndAt( body, CKEDITOR.POSITION_BEFORE_END ); 599 599 return searchRange; 600 600 } 601 602 function getSelectedText( editor ) 603 { 604 var selectedText = '' 605 selection = editor.getSelection(); 601 606 607 if ( selection && selection.getType() == CKEDITOR.SELECTION_TEXT ) 608 { 609 if ( CKEDITOR.env.ie ) 610 { 611 selection.unlock( 1 ); 612 selectedText = selection.getNative().createRange().text; 613 selection.lock(); 614 } 615 else 616 selectedText = selection.getNative().toString(); 617 } 618 619 return selectedText; 620 } 621 602 622 var lang = editor.lang.findAndReplace; 603 623 return { 604 624 title : lang.title, … … 851 871 finder.searchRange = getSearchRange(); 852 872 853 873 this.selectPage( startupPage ); 874 875 // Fill in the find field with the user selected text. 876 var selectedContent = getSelectedText( this.getParentEditor() ), 877 pageId = this._.currentTabId, 878 patternFieldId = ( pageId == 'find' ? 'txtFindFind' : 'txtFindReplace' ); 879 880 this.getContentElement( pageId, patternFieldId ).setValue( selectedContent ); 854 881 }, 855 882 onHide : function() 856 883 {