Changeset 7748 for trunk/expressoMail1_2/js/connector.js
- Timestamp:
- 01/15/13 08:29:50 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/connector.js
r5210 r7748 171 171 } 172 172 173 174 173 //Unserialize Data Method 175 174 cConnector.prototype.unserialize = function(str) … … 182 181 do 183 182 { 184 nOpen = str.indexOf('{', nClose+1); 185 nClose = str.indexOf('}', nClose+1); 186 187 if (nOpen == -1) 188 { 189 return nClose; 190 } 191 if (nOpen < nClose ) 192 { 193 nClose = matchB(str, nOpen); 194 } 183 nOpen = str.substr(nClose+1).search(/[0-9]\:\{/ ); 184 185 if (nOpen > 0) 186 nOpen = nOpen + nClose+3; 187 188 nClose = (str.substr(nClose+1) == '}' || str.substr(nClose+1,1) == '}') ? nClose +1 : str.substr(nClose+1).search(/[0-9\"]\;\}/ ) + nClose + 3; 189 190 if (nOpen < 0) 191 { 192 return nClose; 193 } 194 if (nOpen < nClose ) 195 { 196 nClose = matchB(str, nOpen); 197 } 195 198 } while (nOpen < nClose); 196 199 … … 338 341 case 200: 339 342 if (typeof(handler) == 'function') 340 { 341 _thisObject.hideProgressBar(); 343 { 344 _thisObject.hideProgressBar(); 342 345 var data = _thisObject.unserialize(oxmlhttp.responseText); 343 346 if ( typeof data == 'undefined' ) 344 347 data = oxmlhttp.responseText; 345 // Verify user session 346 if(data && data.nosession){ 347 // If hold session is setted, dont reload the page ... 348 if(hold_session) { 349 if(typeof(write_msg) == "function" && typeof(get_lang) == "function") 350 write_msg(get_lang("your session could not be verified.")); 351 else 352 alert("your session could not be verified."); 353 } 354 else 355 window.location.reload(); 356 357 delete _thisObject.requests[id]; 358 _thisObject.requests[id] = null; 359 return false; 360 } 348 // Verify user session 349 if(data && data.nosession){ 350 // If hold session is setted, dont reload the page ... 351 if(hold_session) { 352 if(typeof(write_msg) == "function" && typeof(get_lang) == "function") 353 write_msg(get_lang("your session could not be verified.")); 354 else 355 alert("your session could not be verified."); 356 } 357 else 358 window.location.reload(); 359 360 delete _thisObject.requests[id]; 361 _thisObject.requests[id] = null; 362 return false; 363 } 361 364 if(debug_controller) { 362 365 document.getElementById("debug_controller").innerHTML += oxmlhttp.responseText; … … 365 368 366 369 _thisObject.addToCache(params?id+"&"+params:id,data); 367 delete _thisObject.requests[id]; 370 delete _thisObject.requests[id]; 368 371 _thisObject.requests[id] = null; 369 372 handler(data); … … 373 376 374 377 case 404: 375 378 376 379 alert(get_lang('Page Not Found!')); 377 380 break; 378 381 379 default: 382 default: 380 383 } 381 384 } 382 385 } 383 386 catch (e) 384 { 387 { 385 388 _thisObject.hideProgressBar(); 386 389 if(debug_controller) … … 389 392 throw(e); 390 393 } 391 394 392 395 } 393 396 394 397 try 395 { 398 { 396 399 if (method == '' || method == 'GET') 397 400 { … … 417 420 } 418 421 catch(e) 419 { 422 { 420 423 _thisObject.hideProgressBar(); 421 424 if(debug_controller) 422 425 alert(e); 423 // View Exception in Javascript Console 426 // View Exception in Javascript Console 424 427 throw(e); 425 428 }
Note: See TracChangeset
for help on using the changeset viewer.