Changeset 2642 for trunk/phpgwapi


Ignore:
Timestamp:
04/27/10 16:58:10 (14 years ago)
Author:
rodsouza
Message:

Ticket #1009 - Corigindo problemas com o ordenamento referente aos javascripts.

Location:
trunk/phpgwapi/js/tools
Files:
3 edited

Legend:

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

    r2628 r2642  
    108108                                                                        try 
    109109                                                                        { 
    110                                                                                 _request( _data ); 
     110                                                                          _request( _data ); 
    111111                                                                        } 
    112                                                                         catch( e ) 
     112                                                                        catch ( _e ) 
    113113                                                                        { 
    114                                                                                 //alert("#request\n\n" + _ID + "\n\n" + _e + "\n\n" + _e.description); 
     114                                                                                alert("#request\n\n" + _ID + "\n\n" + _e + "\n\n" + _e.description); 
    115115                                                                        } 
    116116 
     
    126126                                        catch( e ) 
    127127                                        { 
     128                                                //alert( "e\n\n" + e ); 
    128129                                        } 
    129130                                break; 
     
    141142 
    142143                var _SEND = null; 
    143  
    144                 //if ( _THREADS[_ID]._METHOD == 'GET' ) 
    145                 //      _TARGET += '?' + _ACTION; 
    146  
    147                 //_TARGET += _ID; 
    148144 
    149145                _THREADS[ _ID ]._XHR.open( ( ( _THREADS[ _ID ]._POST ) ? 'POST' : 'GET' ), _TARGET, true); 
  • trunk/phpgwapi/js/tools/xlink.js

    r2630 r2642  
    6262                                                        _container.appendChild( el.firstChild ); 
    6363 
    64                                                 var _inline = [ ]; 
    65                                                 for ( var i = 0; i < _new_scripts.length; i++ ) 
    66                                                         if ( _new_scripts[ i ][ 2 ] == undefined || _new_scripts[ i ][ 2 ].length == 0 ) 
    67                                                                 _inline[ _inline.length ] = _new_scripts[ i ][ 3 ]; 
     64                                                var _count = 0; 
     65                                                function _scripts( ) 
     66                                                { 
     67                                                        if ( _new_scripts[ _count ][ 2 ] == undefined || _new_scripts[ _count ][ 2 ].length == 0 ) 
     68                                                                _script.load( function( ) 
     69                                                                { 
     70                                                                        if ( ++_count < _new_scripts.length ) 
     71                                                                                _scripts( ); 
     72                                                                }, _new_scripts[ _count ][ 3 ] ); 
    6873                                                        else 
    69                                                                 _script.add( _new_scripts[ i ][ 2 ].substr( 
    70                                                                         URL_SERVER.length - 1, 
    71                                                                         _new_scripts[ i ][ 2 ].indexOf( '?' ) - URL_SERVER.length + 1 
    72                                                                 ) ); 
     74                                                        { 
     75                                                                _script.add( 
     76                                                                        _new_scripts[ _count ][ 2 ].substr( 
     77                                                                                URL_SERVER.length - 1, 
     78                                                                                _new_scripts[ _count ][ 2 ].indexOf( '?' ) - URL_SERVER.length + 1 
     79                                                                        ) 
     80                                                                ); 
     81                                                                if ( ++_count < _new_scripts.length ) 
     82                                                                        _scripts( ); 
     83                                                        } 
     84                                                } 
    7385 
    74                                                 var _it_has_loaded = _script.load( function( ) 
     86                                                if ( _new_scripts.length ) 
    7587                                                { 
    76                                                         if ( _inline.length ) 
    77                                                                 window.eval( _inline.join( '' ) ); 
    78                                                 } ); 
    79  
    80                                                 if ( ! _it_has_loaded && _inline.length ) 
    81                                                         window.eval( _inline.join( '' ) ); 
     88                                                        _scripts( ); 
     89                                                        _script.load( ); 
     90                                                } 
    8291                                        } 
    8392                                } ); 
  • trunk/phpgwapi/js/tools/xscript.js

    r2630 r2642  
    1818        function _load( ) 
    1919        { 
    20                 if ( ! _new.length ) 
    21                         return false; 
    22  
    2320                var _handler = null; 
    2421                if ( arguments.length && typeof arguments[ 0 ] == 'function' ) 
    2522                        _handler = arguments[ 0 ]; 
    2623 
    27                 _connector.go( { 
    28                         "access" : URL_SERVER + 'controller.php?action=phpgwapi.javascript.get_source&source=' + _new.join( ';' ), 
    29                         "handler" : function( data ) 
    30                         { 
    31                                 for ( var i = 0; i < _new.length; i++ ) 
    32                                         _loaded[ _loaded.length ] = _new[ i ]; 
     24                var _inline = ''; 
     25                if ( arguments.length && typeof arguments[ 1 ] == 'string' ) 
     26                        _inline = arguments[ 1 ]; 
    3327 
    34                                 _new = [ ]; 
     28                if ( ! _new.length ) 
     29                { 
     30                        window.eval( _inline); 
     31                        if ( _handler ) 
     32                                _handler( ); 
     33                } 
     34                else 
     35                { 
     36                        var _scripts = _new.join( ';' ); 
    3537 
    36                                 window.eval( data ); 
     38                        for ( var i = 0; i < _new.length; i++ ) 
     39                                _loaded[ _loaded.length ] = _new[ i ]; 
    3740 
    38                                 if ( _handler ) 
    39                                         _handler( data ); 
    40                         } 
    41                 } ); 
     41                        _new = [ ]; 
     42 
     43                        _connector.go( { 
     44                                "access" : URL_SERVER + 'controller.php?action=phpgwapi.javascript.get_source&source=' + _scripts, 
     45                                "handler" : function( data ) 
     46                                { 
     47                                        window.eval( data + _inline); 
     48 
     49                                        if ( _handler ) 
     50                                                _handler( ); 
     51                                } 
     52                        } ); 
     53                } 
    4254        } 
    4355 
Note: See TracChangeset for help on using the changeset viewer.