Changeset 2601 for trunk/phpgwapi
- Timestamp:
- 04/20/10 11:50:19 (14 years ago)
- Location:
- trunk/phpgwapi/js/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpgwapi/js/tools/xconnector.js
r2583 r2601 333 333 Connector.prototype.cache = function( ) 334 334 { 335 this._cache = true; 335 _cache = true; 336 337 if ( arguments.length == 1 && arguments[ 0 ].constructor == Boolean ) 338 _cache = arguments[ 0 ]; 339 340 this._cache = _cache; 341 342 return this; 336 343 }; 337 344 window.XConnector = Connector; -
trunk/phpgwapi/js/tools/xlink.js
r2578 r2601 26 26 _container.appendChild( _loading ); 27 27 28 if ( pLink.hasAttribute( 'cacheit' ) && pLink.getAttribute( 'cacheit' ) === 'true' ) 29 _connector.cache( ); 28 var _cacheit = ( ( pLink.hasAttribute( 'cacheit' ) && pLink.getAttribute( 'cacheit' ) === 'true' ) ? true : false ); 30 29 31 var request = _connector. go( {30 var request = _connector.cache( _cacheit ).go( { 32 31 'access' : action, 33 32 'handler' : function( data ) … … 43 42 var _loaded = _head.getElementsByTagName( 'script' ); 44 43 var _scripts = el.getElementsByTagName( 'script' ); 45 fix : for ( var i = 0; i < _scripts.length; i++ ) 44 var _new_scripts = [ ]; 45 46 while ( _scripts.length ) 47 _new_scripts[ _new_scripts.length ] = el.removeChild( _scripts.item( 0 ) ); 48 49 _container.innerHTML = ''; 50 while ( el.hasChildNodes( ) ) 51 _container.appendChild( el.firstChild ); 52 53 fix : for ( var i = 0; i < _new_scripts.length; i++ ) 46 54 { 47 var _script = _ scripts.item( i );55 var _script = _new_scripts[ i ]; 48 56 if ( _script.getAttribute( 'src' ) == null ) 57 { 58 _container.appendChild( _script ); 49 59 continue; 60 } 50 61 else 51 62 { 52 63 for ( var j = 0; j < _loaded.length; j++ ) 53 64 if ( _script.getAttribute( 'src' ) === _loaded.item( j ).getAttribute( 'src' ) ) 54 {55 el.removeChild( _script );56 65 continue fix; 57 }58 66 59 67 _head.appendChild( _script ); 60 i--;61 68 } 62 69 } 63 64 _container.innerHTML = '';65 while ( el.hasChildNodes( ) )66 _container.appendChild( el.firstChild );67 70 } 68 71 } );
Note: See TracChangeset
for help on using the changeset viewer.