Changeset 2507
- Timestamp:
- 04/13/10 15:56:10 (14 years ago)
- Location:
- trunk/phpgwapi/js/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/phpgwapi/js/tools/xconnector.js
r2420 r2507 105 105 try 106 106 { 107 if ( this._cache ) 108 { 109 this._CACHED[ _ID ] = _data; 110 this._cache = false; 111 } 112 107 113 _request( _data ); 108 114 } … … 135 141 136 142 var _ACTION = 'act=' + _ID; 137 //var _TARGET = this._PATH + _THREADS[ _ID ]._ACCESS;138 143 var _TARGET = _THREADS[ _ID ]._ACCESS; 139 144 140 145 var _SEND = null; 141 142 //_TARGET += ( this._CONTROLLER ) ?143 // this._CONTROLLER : 'controller.php';144 146 145 147 //if ( _THREADS[_ID]._METHOD == 'GET' ) … … 161 163 if ( this._CONTROLLER_KEY && typeof _SEND.documentElement == 'object' ) 162 164 _SEND.documentElement.setAttribute( 'ControllerKey', this._CONTROLLER_KEY ); 163 164 165 } 165 166 … … 255 256 } 256 257 257 if ( ! ( _THREADS[ _ID ]._XHR = _xhr( ) ) ) 258 { 259 delete _THREADS[_ID]; 260 return { 'error' : "#3 it cannot make a xhr object" }; 261 } 262 263 _execute.call(this, _ID); 258 if ( this._cache && this._CACHED[ _ID ] ) 259 { 260 if ( _THREADS[ _ID ]._HANDLER.request ) 261 _THREADS[ _ID ]._HANDLER.request( this._CACHED[ _ID ] ); 262 } 263 else 264 { 265 if ( ! ( _THREADS[ _ID ]._XHR = _xhr( ) ) ) 266 { 267 delete _THREADS[_ID]; 268 return { 'error' : "#3 it cannot make a xhr object" }; 269 } 270 271 _execute.call( this, _ID ); 272 } 264 273 265 274 return { 'success' : "your thread is running and the response will be manipulated by the handler" }; … … 288 297 var _argv = arguments; 289 298 299 this._PATH = ''; 300 301 this._CONTROLLER = ''; 302 303 this._cache = false; 304 305 this._CACHED = [ ]; 306 290 307 if ( ( _argv.length == 1 ) && ( typeof _argv[0] == 'object' ) ) 291 308 { 292 309 _argv = _argv[ 0 ]; 293 294 this._PATH = '';295 310 296 311 if ( _argv.path && ( typeof _argv.path == 'string' ) && this._PATH.length ) … … 305 320 } 306 321 307 this._CONTROLLER = ( _argv.controller ) ?308 _argv.controller : false;322 if ( _argv.controller ) 323 this._CONTROLLER = _argv.controller; 309 324 310 325 this._CONTROLLER_KEY = ( _argv.key ) ? … … 315 330 Connector.prototype.go = go; 316 331 Connector.prototype.abort = _abort; 332 Connector.prototype.cache = function( ) 333 { 334 this._cache = true; 335 }; 317 336 window.XConnector = Connector; 318 337 -
trunk/phpgwapi/js/tools/xlink.js
r2495 r2507 29 29 _container.innerHTML = ''; 30 30 _container.appendChild( _loading ); 31 _connector.cache( ); 31 32 var request = _connector.go( { 32 33 'access' : action,
Note: See TracChangeset
for help on using the changeset viewer.