Compare commits
No commits in common. "aef2a1ae602507859e8e96647d66a8f9e3a1516e" and "01089aaf12408833686f83518ccf1a3121aaa6f9" have entirely different histories.
aef2a1ae60
...
01089aaf12
@ -36,10 +36,12 @@
|
||||
document.write(qp.action ? (qp.action + "<br>Room " + qp.room) : 'FTracker<br>V1.1')
|
||||
</script></h1>
|
||||
<div id="startpage">
|
||||
This is a web app to track which people were in the same rooms at
|
||||
which times in order to backtrace potential viral infections.<br><br>
|
||||
If you've reached this page that either means your're testing
|
||||
things or something has gone quite wrong with the URL.<br>
|
||||
This is a web app to track which people
|
||||
were in the same rooms at which times in order to backtrace
|
||||
potential viral infections.<br><br>
|
||||
If you've reached this page that either means your're
|
||||
testing things or something has gone quite wrong with the\
|
||||
URL.<br>
|
||||
In the former case: Yay it works! In the latter you should
|
||||
probably contact an admin or a dev nearby :(<br><br>
|
||||
Here are a few links for testing:<br>
|
||||
|
11
web/main.js
11
web/main.js
@ -6,17 +6,10 @@ if (qp.action) {
|
||||
mform.style.display = 'block'
|
||||
}
|
||||
|
||||
// Get the name field if it was successfully entered before
|
||||
// Prefill the name field if it was successfully entered before
|
||||
var savedName = localStorage.getItem('name')
|
||||
if (qp && qp.name) {
|
||||
// Forced Admin checkout - prefill qp name and auto-agree
|
||||
document.getElementById('name').value = qp.name.replace(/-/g, ' ').toUpperCase();
|
||||
document.getElementById('agree').checked = true
|
||||
document.getElementById('agree').parentElement.style.display = 'none'
|
||||
} else if (savedName && qp) {
|
||||
// Prefill the client's locally saved name
|
||||
if (savedName && qp)
|
||||
document.getElementById('name').value = savedName
|
||||
}
|
||||
|
||||
// 2nd script, server API communication
|
||||
var name, datetime, agreed, tested
|
||||
|
13
web/view.js
13
web/view.js
@ -88,14 +88,6 @@ function exportCSV() {
|
||||
|
||||
}
|
||||
|
||||
function offerUserCheckout(event) {
|
||||
|
||||
var name = event.target.getAttribute('data-name')
|
||||
var room = event.target.textContent
|
||||
window.open(`/?departure=${room}&edittime=1&name=${name}`, '_blank').focus();
|
||||
|
||||
}
|
||||
|
||||
function renderData() {
|
||||
|
||||
if (data == null) {
|
||||
@ -173,11 +165,8 @@ function renderData() {
|
||||
if (entry.tested)
|
||||
block.classList.add('tested') // = 3G
|
||||
|
||||
if (dur > 60 * 24) {
|
||||
if (dur > 60 * 24)
|
||||
block.classList.add('implausible')
|
||||
block.setAttribute('data-name', name)
|
||||
block.addEventListener('click', offerUserCheckout);
|
||||
}
|
||||
|
||||
row.appendChild(block)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user