Diverse endringer fra de siste årene. Programmet er fortsatt 🍝
This commit is contained in:
		
							parent
							
								
									c25ef18f21
								
							
						
					
					
						commit
						150d6cb931
					
				| @ -158,10 +158,10 @@ h4 { | ||||
|   display: flex; | ||||
|   flex-flow: column wrap; | ||||
|   align-content: center; | ||||
|   gap: 1rem; | ||||
|   gap: 0.5rem; | ||||
|   /* Your container needs a fixed height, and it  | ||||
|    * needs to be taller than your tallest column. */ | ||||
|   height: 200rem;  | ||||
|   height: var(--row-count);;  | ||||
| } | ||||
| .all-result::before, | ||||
| .all-result::after { | ||||
| @ -170,9 +170,6 @@ h4 { | ||||
|   width: 0; | ||||
|   order: 2; | ||||
| } | ||||
| .all-result-div{ | ||||
|   margin-bottom: 2%; /* Optional */ | ||||
| } | ||||
| .all-result-div:nth-child(3n+1) { order: 1; } | ||||
| .all-result-div:nth-child(3n+2) { order: 2; } | ||||
| .all-result-div:nth-child(3n)   { order: 3; } | ||||
|  | ||||
| @ -81,7 +81,7 @@ function loadresults() { | ||||
|       } | ||||
|       document.getElementById("alle-cont").innerHTML = ""; | ||||
| 
 | ||||
|       //console.log(xmlObj);
 | ||||
|       let rowCount = 0; | ||||
| 
 | ||||
|       document.getElementById("header-brand").innerHTML=xmlObj.Event.Name; | ||||
| 
 | ||||
| @ -92,17 +92,21 @@ function loadresults() { | ||||
|         let winnerTime; | ||||
|         let controlArray = []; | ||||
| 
 | ||||
|         if(typeof(xmlObj.ClassResult[i].PersonResult)!== 'undefined'){ | ||||
|         if(typeof(xmlObj.ClassResult[i].PersonResult[0])!== 'undefined' && typeof(xmlObj.ClassResult[i].PersonResult[0].Result.SplitTime)!== 'undefined'){ | ||||
|           splitTimes += '<td></td>' | ||||
|           controlArray = Array.from(xmlObj.ClassResult[i].PersonResult[0].Result.SplitTime); | ||||
|           for (let s = 0; s < xmlObj.ClassResult[i].PersonResult[0].Result.SplitTime.length; s++){ | ||||
|             splitTimes += `<td ctrlcode="${xmlObj.ClassResult[i].PersonResult[0].Result.SplitTime[s].ControlCode}">${(s+1)}-${xmlObj.ClassResult[i].PersonResult[0].Result.SplitTime[s].ControlCode}</td>`; | ||||
|           } | ||||
| 	} | ||||
|         } | ||||
|          | ||||
|         splitTimes += '</tr>' | ||||
| 
 | ||||
|         if(typeof(xmlObj.ClassResult[i].PersonResult)!== 'undefined'){ | ||||
|         for (let k = 0; k < xmlObj.ClassResult[i].PersonResult.length; k++) { | ||||
| 	  rowCount += 1; | ||||
|           if(typeof(xmlObj.ClassResult[i].PersonResult[k].Result)!== 'undefined' && typeof(xmlObj.ClassResult[i].PersonResult[k].Result.Position)!== 'undefined'){ | ||||
|           	resultTable += `<tr><td id="Ranking">${xmlObj.ClassResult[i].PersonResult[k].Result.Position}.</td>`; | ||||
|           } | ||||
| @ -163,9 +167,14 @@ function loadresults() { | ||||
|             let controlTime = 0; | ||||
|             let controlTimeDelta = 0; | ||||
|             for (let t = 0; t < controlArray.length; t++) { | ||||
|               controlTime = parseInt(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime[t].Time, 10)-controlTimeDelta | ||||
|               controlTimeDelta += controlTime; | ||||
|               splitTimes +=  '<td>'+ TimeFormater(controlTime) +'<br>'+ TimeFormater(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime[t].Time)+'</td>' | ||||
| 	      if (typeof(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime[t])!== 'undefined'){ | ||||
|                 controlTime = parseInt(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime[t].Time, 10)-controlTimeDelta | ||||
|                 controlTimeDelta += controlTime; | ||||
|                 splitTimes +=  '<td>'+ TimeFormater(controlTime) +'<br>'+ TimeFormater(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime[t].Time)+'</td>' | ||||
| 	      } | ||||
| 	      else{ | ||||
| 		splitTimes +=  '<td><br></td>' | ||||
| 	      } | ||||
|             } | ||||
|           } | ||||
|           else if  (typeof(xmlObj.ClassResult[i].PersonResult[k])!== 'undefined' && typeof(xmlObj.ClassResult[i].PersonResult[0].Result.SplitTime)!== 'undefined' && persStatus == 'Disqualified'){ | ||||
| @ -173,11 +182,15 @@ function loadresults() { | ||||
|             let controlTimeDelta = 0; | ||||
| 
 | ||||
|             for (let t = 0; t < controlArray.length; t++) { | ||||
|               if (typeof(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime && typeof(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime[t].Time)!=='undefined')!== 'undefined'){ | ||||
|               if (typeof(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime)!== 'undefined'){ | ||||
|               if (typeof(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime[t])!== 'undefined'){ | ||||
|               if (typeof(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime[t].Time)!=='undefined'){ | ||||
|                 controlTime = parseInt(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime[t].Time, 10)-controlTimeDelta | ||||
|                 controlTimeDelta += controlTime; | ||||
|                 splitTimes +=  '<td>'+ TimeFormater(controlTime) +'<br>'+ TimeFormater(xmlObj.ClassResult[i].PersonResult[k].Result.SplitTime[t].Time)+'</td>' | ||||
|               } | ||||
| 	      } | ||||
| 	      } | ||||
|               else { | ||||
|                 splitTimes += '<td></td>' | ||||
|               } | ||||
| @ -186,6 +199,7 @@ function loadresults() { | ||||
|           splitTimes += '</tr>'; | ||||
| 
 | ||||
|         } | ||||
| 	} | ||||
|         resultTable += "</table></div>" | ||||
|         splitTimes += "</table></div>" | ||||
| 
 | ||||
| @ -208,6 +222,8 @@ function loadresults() { | ||||
|         resultTable = ""; | ||||
|         splitTimes = ""; | ||||
|       } | ||||
|     //sets the variable that controls height of the all results flex
 | ||||
|     document.documentElement.style.setProperty('--row-count', rowCount * 1.8 + "rem"); | ||||
|     } | ||||
|   }; | ||||
|   xmlhttp.open("GET", "xmlToJson.php", true); | ||||
| @ -258,7 +274,7 @@ if (typeof(EventSource) !== "undefined") { | ||||
|       loadresults() | ||||
|       //console.log("Update!!!!! :=)");
 | ||||
|       window.lastUpdate = parseInt(statusArray[1], 10); | ||||
|       var jdata = JSON.parse(statusArray[3]); | ||||
|       //var jdata = JSON.parse(statusArray[3]);
 | ||||
|     } else { | ||||
|       //console.log("No update");
 | ||||
|     } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user