Subversion Repositories eFlore/Applications.cel

Rev

Rev 1035 | Rev 1037 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1035 Rev 1036
Line 424... Line 424...
424
 
424
 
425
function chargerObs(depart, total) {
425
function chargerObs(depart, total) {
426
	if (depart == 0 || depart < total) {
426
	if (depart == 0 || depart < total) {
427
		var limite = 300;
427
		var limite = 300;
428
		if (depart == 0) {
428
		if (depart == 0) {
429
			obsStation = new Array();	
-
 
430
			surClicPagePagination(0, null);
429
			viderTableauObs();
Line 431... Line 430...
431
		}
430
		}
432
		
431
		
433
		var urlObs = observationsUrl+'&start={start}&limit='+limite;
432
		var urlObs = observationsUrl+'&start={start}&limit='+limite;
434
		urlObs = urlObs.replace(/\{stationId\}/g, pointClique.stationInfos.id);
433
		urlObs = urlObs.replace(/\{stationId\}/g, pointClique.stationInfos.id);
Line 435... Line 434...
435
		urlObs = urlObs.replace(/\{nt\}/g, nt);
434
		urlObs = urlObs.replace(/\{nt\}/g, nt);
436
		urlObs = urlObs.replace(/\{start\}/g, depart);
435
		urlObs = urlObs.replace(/\{start\}/g, depart);
437
		
-
 
438
		$.getJSON(urlObs, function(observations){
-
 
439
			obsStation = obsStation.concat(observations.observations);
-
 
440
			if (depart == 0) {
-
 
441
				actualiserInfosStation(observations);
-
 
442
				actualiserPagineur();
436
		
443
				creerTitreInfoBulle();
437
		$.getJSON(urlObs, function(observations){
444
			}
438
			surRetourChargementObs(observations, depart, total);
-
 
439
			chargerObs(depart+limite, observations.total);
-
 
440
		});
445
			chargerObs(depart+limite, observations.total);
441
	}
-
 
442
}
446
		});
443
 
447
	} else {
444
function viderTableauObs() {
-
 
445
	obsStation = new Array();	
-
 
446
	surClicPagePagination(0, null);
-
 
447
}
-
 
448
 
-
 
449
function surRetourChargementObs(observations, depart, total) {
-
 
450
	obsStation = obsStation.concat(observations.observations);
448
		if (pagineur.limite < total) {
451
	if (depart == 0) {
449
			afficherPagination();
452
		actualiserInfosStation(observations);
450
		}
453
		creerTitreInfoBulle();
-
 
454
		selectionnerOnglet("#obs-vue-"+pagineur.format);
-
 
455
		surClicPagePagination(0, null);
-
 
456
	}
-
 
457
	
-
 
458
	if (pagineur.limite < total) {
451
		selectionnerOnglet("#obs-vue-"+pagineur.format);
459
		afficherPagination();
Line 452... Line 460...
452
		surClicPagePagination(0, null);
460
	}
453
	}
461
	actualiserPagineur();
454
}
462
}