From 1f9851d5a39a8b060378a1ed1d0257fa3f7b246b Mon Sep 17 00:00:00 2001
From: Ansyth <tanguy.charles@ensiie.fr>
Date: Wed, 11 Dec 2019 20:19:13 +0100
Subject: [PATCH] rien

---
 public/js/picture_displayer.js | 33 ++++++++++++++++++++-------------
 public/leaderboard.php         |  8 ++------
 2 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/public/js/picture_displayer.js b/public/js/picture_displayer.js
index 48797d5..779f997 100644
--- a/public/js/picture_displayer.js
+++ b/public/js/picture_displayer.js
@@ -148,15 +148,24 @@ var displayerNbCDC = {
 
 		var liste = $('#'+idToDat+" li");		
 		$('#'+whereToDisplay).html('<div id="'+whereToDisplay+'row" class="row"></div>');
-		liste.each(function() {
-		// 	console.log("__");
-		
-			var texte_li = $(this).text();
-			var tab = texte_li.split(",");
-			// console.log("ascii:" + tab[0] + ", " + tab[1]);
-			var currentID = intListToString(tab[0]);
-			var nbCDC = parseInt( tab[1]);
-			if( nbCDC >= 25 )
+		liste.each(
+								function() {			
+									// 	console.log("__");
+								
+									var texte_li = $(this).text();
+									var tab = texte_li.split(",");
+									// console.log("ascii:" + tab[0] + ", " + tab[1]);
+									var currentID = intListToString(tab[0]);
+									var nbCDC = parseInt( tab[1]);
+									console.log(10000*parseInt(tab[2], 10));
+									setTimeout(affiche_dans_lordre(whereToDisplay, tab, currentID, nbCDC), 100*parseInt(tab[2], 10));			
+								}
+							);
+	}
+}
+
+function affiche_dans_lordre(whereToDisplay, tab, currentID, nbCDC ) {
+	if( nbCDC >= 25 )
 				var color = "yellow"
 			else
 			{
@@ -165,7 +174,7 @@ var displayerNbCDC = {
 				else
 					var color = "white";
 			}
-
+			
 			var place = parseInt( tab[2] );
 			if( place > 1 )
 				tab[2] += "eme"
@@ -173,6 +182,7 @@ var displayerNbCDC = {
 				tab[2] += "er"
 			// console.log("decode:" +currentID);
 			// console.log(currentID);
+			
 			requestHandler.retrieveJsonFromUrl('https://images-api.nasa.gov/search?nasa_id='+currentID, function(json) {
 				var real_im = json.collection.items[0];
 				$('#'+whereToDisplay+'row').append('<div class="view container-fluid">'+
@@ -202,9 +212,6 @@ var displayerNbCDC = {
 					'</div>'+
 				'</div>');
 			});
-		});
-	}
-
 }
 
 
diff --git a/public/leaderboard.php b/public/leaderboard.php
index 4e10495..d4659ba 100644
--- a/public/leaderboard.php
+++ b/public/leaderboard.php
@@ -54,18 +54,14 @@ urlHasArgument();
 	generateNavBar('leaderboard');
 	?>
 	<!-- balises cachées contenant les images par ordre de notation -->
-<<<<<<< HEAD
-	<div id="NoteLeaderboard" style="display: none"> <!-- display: none -->
-=======
 	<div id="NoteLeaderboard" style="display:none"> <!-- display: none -->
->>>>>>> fe4f8bc2d8e0b89af8f7b3f8e536301fdd4af310
 		<?php
 			$test = $orderRepository->fetchAvgNoteOrder();
 
 			$i = 1;
 			foreach ($test as $elem): 
-				echo "<li><div class='idPhoto'>".$elem->getIdPhoto().",</div>";
-				echo "<div class='moyenne'>".$elem->getNote()."</div>";
+				echo "<li><div class='idPhoto'>".$elem->getIdPhoto()."</div>";
+				echo ",<div class='moyenne'>".$elem->getNote()."</div>";
 				echo ",<div>".$i."</div></li>";
 				$i++;
 			endforeach
-- 
GitLab