Ignore:
Timestamp:
05/06/10 17:30:43 (14 years ago)
Author:
rodsouza
Message:

Ticket #1058 - Corrigindo problema do caregamento do contactcenter.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/js/tools/xlink.js

    r2712 r2729  
    7878                if ( js ) 
    7979                { 
    80                         var tag = /<script([^>]* src="(\S+)"|[^>]*)>(.*?)<\/script>/; 
     80                        var tag = /<script([^>]*src="(\S+)"[^>]*|[^>]*)>(.*?)<\/script>/; 
    8181                        for ( var i = 0; i < js.length; i++ ) 
    8282                        { 
    8383                                var type = tag.exec( js[ i ] ); 
    84                                 data = data.replace( "\n\t\t" + type[ 0 ], '' ); 
     84                                data = data.replace( type[ 0 ], '' ); 
    8585                                _new_scripts[ _new_scripts.length ] = type; 
    8686                        } 
     
    9898                        _container.appendChild( el.firstChild ); 
    9999 
    100                 var _count = 0; 
    101                 function _scripts( ) 
     100                for ( var i = 0; i < _new_scripts.length; i++ ) 
    102101                { 
    103                         if ( _new_scripts[ _count ][ 2 ] == undefined || _new_scripts[ _count ][ 2 ].length == 0 ) 
    104                                 _script.load( function( ) 
    105                                 { 
    106                                         if ( ++_count < _new_scripts.length ) 
    107                                                 _scripts( ); 
    108                                 }, _new_scripts[ _count ][ 3 ] ); 
     102                        if ( _new_scripts[ i ][ 2 ] == undefined || _new_scripts[ i ][ 2 ].length == 0 ) 
     103                                _script.inline( _new_scripts[ i ][ 3 ] ); 
    109104                        else 
    110105                        { 
    111                                 if ( _new_scripts[ _count ][ 2 ].indexOf( window.location.host ) < 0 ) 
    112                                         _new_scripts[ _count ][ 2 ] = window.location.protocol + '//' + window.location.host + _new_scripts[ _count ][ 2 ]; 
     106                                if ( _new_scripts[ i ][ 2 ].indexOf( window.location.host ) < 0 ) 
     107                                        _new_scripts[ i ][ 2 ] = window.location.protocol + '//' + window.location.host + _new_scripts[ i ][ 2 ]; 
    113108 
    114                                 _script.add( 
    115                                         _new_scripts[ _count ][ 2 ].substr( 
     109                                _script.external( 
     110                                        _new_scripts[ i ][ 2 ].substr( 
    116111                                                _path.length - 1, 
    117                                                 _new_scripts[ _count ][ 2 ].length - _path.length + 1 - ( 
    118                                                         ( _new_scripts[ _count ][ 2 ].indexOf( '?' ) < 0 ) ? 
    119                                                                 0 : ( _new_scripts[ _count ][ 2 ].length - _new_scripts[ _count ][ 2 ].indexOf( '?' ) ) 
     112                                                _new_scripts[ i ][ 2 ].length - _path.length + 1 - ( 
     113                                                        ( _new_scripts[ i ][ 2 ].indexOf( '?' ) < 0 ) ? 
     114                                                                0 : ( _new_scripts[ i ][ 2 ].length - _new_scripts[ i ][ 2 ].indexOf( '?' ) ) 
    120115                                                ) 
    121116                                        ) 
    122117                                ); 
    123                                 if ( ++_count < _new_scripts.length ) 
    124                                         _scripts( ); 
    125118                        } 
    126119                } 
    127120 
    128                 if ( _new_scripts.length ) 
    129                 { 
    130                         _scripts( ); 
    131                         _script.load( ); 
    132                 } 
     121                _script.load( ); 
    133122        } 
    134123 
Note: See TracChangeset for help on using the changeset viewer.