Show
Ignore:
Timestamp:
2007-07-05 15:55:49 (18 months ago)
Author:
martinkou
Message:

Fixed #802 : Made the new replace code compatible with Internet Explorer and Opera.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/trunk/editor/dialog/fck_replace.html

    r408 r410  
    3333function OnLoad() 
    3434{ 
    35         // First of all, translate the dialog box texts 
     35        // First of all, translate the dialog box texts. 
    3636        oEditor.FCKLanguageManager.TranslatePage( document ) ; 
    3737         
    3838        window.parent.SetAutoSize( true ) ; 
     39 
     40        // Place the cursor at the start of document. 
     41        // This will be the starting point of our search. 
     42        var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ; 
     43        range.SetStart( oEditor.FCK.EditorDocument.body, 1 ) ; 
     44        range.SetEnd( oEditor.FCK.EditorDocument.body, 1 ) ; 
     45        range.Collapse( true ) ; 
     46        range.Select() ; 
    3947} 
    4048 
     
    141149                case 0x202f: 
    142150                case 0x205f: 
    143                 case 3000: 
     151                case 0x3000: 
    144152                        return true; 
    145153                default: 
     
    177185                while ( true ) 
    178186                { 
    179                         if ( c == this.Pattern[ this._State ] ) 
     187                        if ( c == this.Pattern.charAt( this._State ) ) 
    180188                        { 
    181189                                this._State++ ; 
     
    309317                selection.Collapse( false ) ; 
    310318                selection.Select() ; 
    311                 oEditor.FCK.EditorDocument.body.normalize() ; 
    312319        } 
    313320} 
     
    317324        oEditor.FCKUndo.SaveUndoStep() ; 
    318325 
    319         var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ; 
    320         range.SetStart( oEditor.FCK.EditorDocument.body, 1 ) ; 
    321         range.SetEnd( oEditor.FCK.EditorDocument.body, 1 ) ; 
    322         range.Collapse( true ) ; 
    323         range.Select() ; 
    324326        var replaceCount = 0 ; 
    325327 
     
    335337        if ( replaceCount == 0 ) 
    336338                alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ; 
    337         else 
    338                 oEditor.FCK.EditorDocument.body.normalize() ; 
    339339        window.parent.Cancel() ; 
    340340}