Ticket #3790: 3790.patch

File 3790.patch, 1.8 KB (added by Garry Yao, 15 years ago)
  • _source/plugins/find/dialogs/find.js

     
    496496                        replaceCounter : 0,
    497497
    498498                        replace : function( dialog, pattern, newString, matchCase, matchWord,
    499                                 matchCyclic, matchReplaceAll )
     499                                matchCyclic )
    500500                        {
    501501                                // Successiveness of current replace/find.
    502502                                var result = false;
     
    531531                                else
    532532                                        result = this.find( pattern, matchCase, matchWord, matchCyclic );
    533533
    534                                 // Recusively replace all matches.
    535                                 if ( matchReplaceAll && result )
    536                                         this.replace.apply( this, Array.prototype.slice.call( arguments ) );
    537 
    538                                 return matchReplaceAll ?
    539                                         this.replaceCounter : result;
     534                                return result;
    540535                        }
    541536                };
    542537
     
    703698                                                                                // Scope to full document.
    704699                                                                                finder.searchRange = getSearchRange( true );
    705700                                                                                finder.matchRange = null;
    706                                                                                 if ( ( replaceNums = finder.replace( dialog,
     701                                                                                while( finder.replace( dialog,
    707702                                                                                        dialog.getValueOf( 'replace', 'txtFindReplace' ),
    708703                                                                                        dialog.getValueOf( 'replace', 'txtReplace' ),
    709704                                                                                        dialog.getValueOf( 'replace', 'txtReplaceCaseChk' ),
    710705                                                                                        dialog.getValueOf( 'replace', 'txtReplaceWordChk' ),
    711                                                                                         false, true ) ) )
    712                                                                                         alert( editor.lang.findAndReplace.replaceSuccessMsg.replace( /%1/, replaceNums ) );
     706                                                                                        false ) )
     707                                                                                ;
     708
     709                                                                                if ( finder.replaceCounter )
     710                                                                                        alert( editor.lang.findAndReplace.replaceSuccessMsg.replace( /%1/, finder.replaceCounter ) );
    713711                                                                                else
    714712                                                                                        alert( editor.lang.findAndReplace.notFoundMsg );
    715713                                                                        }
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy