X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Ffind%2Fdialogs%2Ffind.js;h=6711fe58740d6907dc6c99dd1abea9df4ee4ea5c;hb=refs%2Ftags%2Fv3.6.1;hp=ccf4cf62da0abb6646ddc954f80b261681c5c6e3;hpb=48b1db88210b4160dce439c6e3e32e14af8c106b;p=ckeditor.git diff --git a/_source/plugins/find/dialogs/find.js b/_source/plugins/find/dialogs/find.js index ccf4cf6..6711fe5 100644 --- a/_source/plugins/find/dialogs/find.js +++ b/_source/plugins/find/dialogs/find.js @@ -628,6 +628,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }, { type : 'button', + id : 'btnFind', align : 'left', style : 'width:100%', label : lang.find, @@ -693,6 +694,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }, { type : 'button', + id : 'btnFindReplace', align : 'left', style : 'width:100%', label : lang.replace, @@ -726,6 +728,7 @@ For licensing, see LICENSE.html or http://ckeditor.com/license }, { type : 'button', + id : 'btnReplaceAll', align : 'left', style : 'width:100%', label : lang.replaceAll, @@ -850,7 +853,17 @@ For licensing, see LICENSE.html or http://ckeditor.com/license // Establish initial searching start position. finder.searchRange = getSearchRange(); + // Fill in the find field with selected text. + var selectedText = this.getParentEditor().getSelection().getSelectedText(), + patternFieldId = ( startupPage == 'find' ? 'txtFindFind' : 'txtFindReplace' ); + + var field = this.getContentElement( startupPage, patternFieldId ); + field.setValue( selectedText ); + field.select(); + this.selectPage( startupPage ); + + this[ ( startupPage == 'find' && this._.editor.readOnly? 'hide' : 'show' ) + 'Page' ]( 'replace'); }, onHide : function() {