Commit
This commit is contained in:
parent
3058f8d81b
commit
11cba978b7
@ -1,7 +1,14 @@
|
||||
<?php
|
||||
if (!isset($focused)) {
|
||||
$focused = FALSE;
|
||||
}
|
||||
?>
|
||||
<div id="alertBox" class="alert danger hidden" role="alert"></div>
|
||||
|
||||
<?php if ($focused == FALSE): ?>
|
||||
<h1>Resultater</h1>
|
||||
<br>
|
||||
<span class="float-right">[ <a class="info" href="?focused=1" target="_blank">Fokusert visning</a> ]</span>
|
||||
<?php endif; ?>
|
||||
|
||||
<noscript>
|
||||
Denne siden krever JavaScript
|
||||
@ -11,6 +18,16 @@ Denne siden krever JavaScript
|
||||
Laster inn...
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.b {
|
||||
animation: coolFlash 1s;
|
||||
}
|
||||
|
||||
@keyframes coolFlash {
|
||||
from { background: lightgreen; }
|
||||
}
|
||||
</style>
|
||||
|
||||
<script src="<?=$this->config['root_url']?>static/js/ResultService.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
|
@ -4,7 +4,7 @@
|
||||
<hr class="hidden">
|
||||
|
||||
<div id="footer">
|
||||
<small>Kopieringsrettigheter © 2021-2022 <a target="_blank" href="http://willy.club">WillySoft Solutions</a></small>
|
||||
<small>Kopieringsrettigheter © 2021-2022 <a target="_blank" href="http://willy.club">WillySoft Solutions</a>, Kvadraturen Videregående Skole 3ELDEA</small>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
@ -1,3 +1,12 @@
|
||||
<?php
|
||||
if (!isset($hide_nav)) {
|
||||
$hide_nav = FALSE;
|
||||
}
|
||||
|
||||
if (!isset($hide_menu)) {
|
||||
$hide_menu = FALSE;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@ -16,6 +25,7 @@
|
||||
|
||||
<hr class="hidden">
|
||||
|
||||
<?php if ($hide_menu == FALSE): ?>
|
||||
<div id="menu">
|
||||
<small>
|
||||
|
||||
@ -29,12 +39,15 @@
|
||||
|
||||
</small>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<hr class="hidden">
|
||||
|
||||
<div id="container">
|
||||
|
||||
<?php if ($hide_nav == FALSE): ?>
|
||||
<div id="nav">
|
||||
|
||||
<h4>Felles</h4>
|
||||
<ul>
|
||||
<li><a href="<?=$this->config['root_url']?>index.php">Forside</a></li>
|
||||
@ -52,6 +65,7 @@
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<hr class="hidden">
|
||||
|
||||
|
@ -1,5 +1,17 @@
|
||||
<?php $app = require '../../app/inc.php';
|
||||
|
||||
$app->view('template/header', ["title" => "Resultater"]);
|
||||
$app->view('pages/race/results');
|
||||
$app->view('template/footer');
|
||||
$focused = filter_input(INPUT_GET, 'focused');
|
||||
|
||||
if ($focused) {
|
||||
$app->view('template/header', [
|
||||
"title" => "Resultater",
|
||||
"hide_nav" => TRUE,
|
||||
"hide_menu" => TRUE
|
||||
]);
|
||||
$app->view('pages/race/results', ["focused" => TRUE]);
|
||||
$app->view('template/footer');
|
||||
} else {
|
||||
$app->view('template/header', ["title" => "Resultater"]);
|
||||
$app->view('pages/race/results');
|
||||
$app->view('template/footer');
|
||||
}
|
||||
|
@ -14,6 +14,9 @@ class ResultService {
|
||||
|
||||
this.hash = 0;
|
||||
|
||||
// cool flashy flashy thingy
|
||||
this.prevTableRowsLength = null;
|
||||
|
||||
this.loop();
|
||||
}
|
||||
|
||||
@ -99,11 +102,17 @@ class ResultService {
|
||||
tableHTML += "<th>Passert</th>";
|
||||
tableHTML += "</tr>";
|
||||
|
||||
let tableRowsLength = tableRows.length;
|
||||
|
||||
if (this.prevTableRowsLength == null) {
|
||||
this.prevTableRowsLength = tableRowsLength;
|
||||
}
|
||||
|
||||
let iterator = tableRows.length + 1;
|
||||
tableRows.forEach(row => {
|
||||
iterator--;
|
||||
|
||||
tableHTML += "<tr>";
|
||||
tableHTML += "<tr" + ((iterator > this.prevTableRowsLength) ? ' class="b"' : '' ) + ">";
|
||||
tableHTML += "<td>" + iterator + "</td>";
|
||||
tableHTML += "<td>" + row.team.name + "</td>";
|
||||
tableHTML += "<td>" + row.team.company + "</td>";
|
||||
@ -116,6 +125,9 @@ class ResultService {
|
||||
tableHTML += "<table>";
|
||||
|
||||
this.rankingTable.innerHTML = tableHTML;
|
||||
|
||||
// used for cool green flashy flashy thingy
|
||||
this.prevTableRowsLength = tableRowsLength;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user