Show
Ignore:
Timestamp:
2007-12-05 10:28:42 (12 months ago)
Author:
martinkou
Message:

Merged the changesets from trunk since the creation of the floating dialog branch.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • FCKeditor/branches/features/floating_dialog/editor/dialog/fck_replace.html

    r1054 r1179  
    4545        idMap['CheckCase'] = 'chkCase' + tabCode ; 
    4646        idMap['CheckWord'] = 'chkWord' + tabCode ; 
     47 
     48        if ( tabCode == 'Replace' ) 
     49                window.parent.SetAutoSize( true ) ; 
    4750} 
    4851 
     
    6164 
    6265        // Show the appropriate tab at startup. 
    63         if ( dialogArguments.CustomValue == 'Find' ) 
     66        if ( window.parent.name.search( 'Replace' ) == -1 ) 
     67        { 
    6468                window.parent.SetSelectedTab( 'Find' ) ; 
     69                window.parent.SetAutoSize( true ) ; 
     70        } 
    6571        else 
    6672                window.parent.SetSelectedTab( 'Replace' ) ; 
     
    108114function GetData( bookmark ) 
    109115{ 
    110         var currentNode = oEditor.FCK.EditorDocument.documentElement; 
    111         for( var i = 0 ; i < bookmark.length ; i++ ) 
    112         { 
    113                 if ( currentNode.childNodes.length > bookmark[i] ) 
    114                         currentNode = currentNode.childNodes.item( bookmark[i] ) ; 
    115                 else if ( currentNode.nodeType == 3 )   // text node 
     116        var cursor = oEditor.FCK.EditorDocument.documentElement ; 
     117        for ( var i = 0 ; i < bookmark.length ; i++ ) 
     118        { 
     119                var target = bookmark[i] ; 
     120                var currentIndex = -1 ; 
     121                if ( cursor.nodeType != 3 ) 
    116122                { 
    117                         var c = currentNode.nodeValue.charAt( bookmark[i] ) ; 
    118                         if ( i == bookmark.length - 1 ) 
    119                                 return c != "" ? c : null ; 
    120                         else 
     123                        for (var j = 0 ; j < cursor.childNodes.length ; j++ ) 
     124                        { 
     125                                var candidate = cursor.childNodes[j] ; 
     126                                if ( candidate.nodeType == 3 && 
     127                                                candidate.previousSibling && 
     128                                                candidate.previousSibling.nodeType == 3 ) 
     129                                        continue ; 
     130                                currentIndex++ ; 
     131                                if ( currentIndex == target ) 
     132                                { 
     133                                        cursor = candidate ; 
     134                                        break ; 
     135                                } 
     136                        } 
     137                        if ( currentIndex < target ) 
    121138                                return null ; 
    122139                } 
    123140                else 
    124                         return null; 
    125         } 
    126         return currentNode ; 
     141                { 
     142                        if ( i != bookmark.length - 1 ) 
     143                                return null ; 
     144                        while ( target >= cursor.length && cursor.nextSibling && cursor.nextSibling.nodeType == 3 ) 
     145                        { 
     146                                target -= cursor.length ; 
     147                                cursor = cursor.nextSibling ; 
     148                        } 
     149                        cursor = cursor.nodeValue.charAt( target ) ; 
     150                        if ( cursor == "" ) 
     151                                cursor = null ; 
     152                } 
     153        } 
     154        return cursor ; 
    127155} 
    128156 
     
    132160        // See if there's anything further down the tree. 
    133161        var next = bookmark.concat( [0] ) ; 
    134  
    135162        if ( GetData( next ) != null ) 
    136163                return next ; 
     
    253280                        { 
    254281                                if ( oEditor.FCKListsLib.BlockElements[ data.tagName.toLowerCase() ] ) 
     282                                { 
    255283                                        matcher.Reset(); 
     284                                        matchBookmark = null ; 
     285                                } 
    256286                        } 
    257287                        else if ( data.charAt != undefined ) 
     
    324354                while ( focus && focus.nodeType != 1 ) 
    325355                        focus = focus.parentNode ; 
     356 
    326357                if ( focus ) 
    327                 focus.scrollIntoView( false ) ; 
     358                { 
     359                        if ( oEditor.FCKBrowserInfo.IsSafari ) 
     360                                oEditor.FCKDomTools.ScrollIntoView( focus, false ) ; 
     361                        else 
     362                                focus.scrollIntoView( false ) ; 
     363                } 
     364 
    328365                return true; 
    329366        }