Changeset 2642 for trunk/phpgwapi
- Timestamp:
- 04/27/10 16:58:10 (14 years ago)
- Location:
- trunk/phpgwapi/js/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpgwapi/js/tools/xconnector.js
r2628 r2642 108 108 try 109 109 { 110 110 _request( _data ); 111 111 } 112 catch (e )112 catch ( _e ) 113 113 { 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); 115 115 } 116 116 … … 126 126 catch( e ) 127 127 { 128 //alert( "e\n\n" + e ); 128 129 } 129 130 break; … … 141 142 142 143 var _SEND = null; 143 144 //if ( _THREADS[_ID]._METHOD == 'GET' )145 // _TARGET += '?' + _ACTION;146 147 //_TARGET += _ID;148 144 149 145 _THREADS[ _ID ]._XHR.open( ( ( _THREADS[ _ID ]._POST ) ? 'POST' : 'GET' ), _TARGET, true); -
trunk/phpgwapi/js/tools/xlink.js
r2630 r2642 62 62 _container.appendChild( el.firstChild ); 63 63 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 ] ); 68 73 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 } 73 85 74 var _it_has_loaded = _script.load( function()86 if ( _new_scripts.length ) 75 87 { 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 } 82 91 } 83 92 } ); -
trunk/phpgwapi/js/tools/xscript.js
r2630 r2642 18 18 function _load( ) 19 19 { 20 if ( ! _new.length )21 return false;22 23 20 var _handler = null; 24 21 if ( arguments.length && typeof arguments[ 0 ] == 'function' ) 25 22 _handler = arguments[ 0 ]; 26 23 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 ]; 33 27 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( ';' ); 35 37 36 window.eval( data ); 38 for ( var i = 0; i < _new.length; i++ ) 39 _loaded[ _loaded.length ] = _new[ i ]; 37 40 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 } 42 54 } 43 55
Note: See TracChangeset
for help on using the changeset viewer.