Genera Improvements, Added Uniform Days Option

This commit is contained in:
2018-10-26 10:25:33 +00:00
parent 1a03821473
commit f211706772
4 changed files with 39 additions and 15 deletions
+4 -2
View File
@@ -24,7 +24,9 @@
firebase.initializeApp(config);
</script>
</head>
<body onload="javascript:setData('nextformation','date','Date');setData('nextformation','uniform','Uniform');setData('nextformation','location','Location');setData('nextformation','time','Time')">
The next formation is on <b><span id="date"> loading... </span></b> in the <b><span id="location">loading...</span></b> during <b><span id="time">loading...</span></b>. You are to wear the <b><span id="uniform"> loading... </span> uniform.</b>
<body onload="formationOnLoad()">
<div id="box">
Loading...
</div>
</body>
+21 -3
View File
@@ -1,5 +1,21 @@
// JROTC Firebase Interaction Script
// Specific Webpage Scripts
function formationOnLoad() {
var data = readData("nextEvent", function (data) {
if (data.Event == "UNI") {
console.log(data.Event)
document.getElementById("box").innerHTML = 'The next uniform day is on <b><span id="date">loading...</span></b>. You are to wear the <b><span id="uniform">loading...</span></b> uniform.';
setData("nextEvent","date","Date");
setData("nextEvent","uniform","Uniform");
} else {
document.getElementById("box").innerHTML = 'The next formation is on <b><span id="date"> loading... </span></b> in the <b><span id="location">loading...</span></b> during <b><span id="time">loading...</span></b>. You are to wear the <b><span id="uniform"> loading... </span> uniform.</b>';
setData("nextEvent","date","Date");
setData("nextEvent","location","Location");
setData("nextEvent","time","Time");
setData("nextEvent","uniform","Uniform");
}
})
}
// Key Handles (allows enter key to be pressed to send)
@@ -13,18 +29,20 @@ function setKeyHandle (element, name) {
}
// Key handle sending functions
function formationSend() {
function eventSend() {
var array = {
Event: document.getElementById("event").value,
Date: document.getElementById("date").value,
Uniform: document.getElementById("uniformtype").value,
Location: document.getElementById('location').value,
Time: document.getElementById('time').value
}
sendData("nextformation/", array);
sendData("nextEvent/", array);
document.getElementById('date').value = '';
document.getElementById('uniformtype').value = '';
document.getElementById('time').value = '';
document.getElementById('location').value = '';
document.getElementById('event').value = '';
}
function cupSend() {
var array = {
+13 -9
View File
@@ -21,12 +21,13 @@
document.getElementById("alphacurrentpoints").innerHTML = data.Alpha
document.getElementById("bravocurrentpoints").innerHTML = data.Bravo
});
setKeyHandle("uniformtype",formationSend);
setKeyHandle("date",formationSend);
setKeyHandle("time",formationSend);
setKeyHandle("location",formationSend);
setKeyHandle("uniformtype",eventSend);
setKeyHandle("date",eventSend);
setKeyHandle("time",eventSend);
setKeyHandle("location",eventSend);
setKeyHandle("alpha",cupSend);
setKeyHandle("bravo",cupSend);
setKeyHandle("event",eventSend)
var x = document.getElementById("write-box")
x.style.display = 'none'
}
@@ -62,17 +63,20 @@
Consult <a href="https://www.asus.com/us/support/FAQ/1007483/"> this website </a>for more information on how to enable popups on chrome.
</div>
<div id="write-box">
Next Formation Update:<br>
Next Battalion Event Update:<br>
Event Type: (UNI = Uniform only, FOR = Formation)
<input type="text" id="event"><br>
Uniform Type:
<input type="text" id="uniformtype"><br>
Formation Date:
Date:
<input type="text" id="date"><br>
Time of Formation:
<div id="section1">
Time of Formation:
<input type="text" id="time"><br>
Location (i.e Gym, etc):
<input type="text" id="location"><br>
<input type="text" id="location"><br></div>
<input type="button" value="Update" onclick="var array = {Date: document.getElementById('date').value, Uniform: document.getElementById('uniformtype').value, Location: document.getElementById('location').value, Time: document.getElementById('time').value};sendData('nextformation/', array);document.getElementById('date').value = '';document.getElementById('uniformtype').value = '';document.getElementById('time').value = '';document.getElementById('location').value = '';">
</div>
<br>
<br>
Commanders Cup Points Update:<br>
+1 -1
View File
@@ -3,6 +3,6 @@ echo "Starting Send..."
echo "Commit name:"
read name
git add *
git commit -m $name
git commit -m "$name"
git push
echo "Sent!"