-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
135 lines (106 loc) · 5.12 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html>
<title>Am I supposed to be gathering?</title>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
var currentDate = new Date();
var currentHour = currentDate.getHours();
var currentMinute = currentDate.getMinutes();
if (currentMinute < 10)
{
currentMinute = "0" + currentMinute;
}
function myFunction2() {
location.reload();
}
function myFunction() {
var x = document.getElementById("shifts").value;
var currentTime = currentHour + ":" + currentMinute;
var addButton = "<br\/><br\/><button type=\"button\" onclick=\"myFunction2()\">Try again<\/button><br\/><br\/>";
document.getElementById("time").innerHTML = "Current time is " + currentTime + " ET";
document.getElementById("nameofshift").innerHTML = "Your shift is " + x;
if(((x=="Chase-1" || x=="Digi News-1" || x=="Planning") && currentHour < 10) ||((currentHour >=10 && currentHour < 14) && (x=="Chase-2")) || ((currentHour >= 14 && currentHour <22) && x=="News-3" ) || (currentHour >= 22 && x=="Digi News-3" ) )
{
document.getElementById("gathering").innerHTML = "You're supposed to be gathering. Whip out that Capture login!" + addButton;
}
else if (currentHour == 16 && x=="Control 51-2")
{
document.getElementById("gathering").innerHTML = "No gathering for you, but time to run over and do some Exchange pretapes (if needed)." + addButton;
}
else if (currentHour == 16 && x=="National")
{
document.getElementById("gathering").innerHTML = "No gathering for you, but time to run up to Control 51 and handle that fun last hour of News Now." + addButton;
}
else if (x=="Control 51-1" || x=="Control 51-2")
{
document.getElementById("gathering").innerHTML = "You're supposed to be in the control room with no access to a Capture station. Get someone at the desk to do it." + addButton;
}
else if (currentHour >= 21 && x=="News Now Vancouver")
{
document.getElementById("gathering").innerHTML = "If everyone else is busy, you gotta do it. But, more importantly, it's time to get cracking on that morning prep note!" + addButton;
}
else if (currentHour == 16 && x=="Control 51-2")
{
document.getElementById("gathering").innerHTML = "No gathering for you, but time to run over and do some Exchange pretapes (if needed)." + addButton;
}
else if (x=="Local Toronto")
{
document.getElementById("gathering").innerHTML = "You do have access to a Capture station but chances are you're nowhere near it."+ addButton;
}
else if (x=="French Services")
{
document.getElementById("gathering").innerHTML = "Oui. Vous devriez utiliser la Pool neuf!"+ addButton;
}
else if(x=="Greg Clarke")
{
document.getElementById("gathering").innerHTML = "You're " + x + "<p> You'll do it anyway and then write a nice long note about it!"+ addButton;
}
else{
document.getElementById("gathering").innerHTML = "You're <b>NOT</b> supposed to be gathering. But do help out when you can."+ addButton;
}
}
</script>
</head>
<body>
<div class="container">
<div class="jumbotron">
<h2> This website helps you figure out if you're supposed to be gathering on your shift. It takes your current time and what shift you're on and tell you if you're supposed to be gathering or just helping out.</h2>
<h2> </h2>
<h2>Click the button to see if you're supposed to be gathering.</h2>
<form>
Select your shift:
<select id="shifts">
<option value="Control 51-1">Control 51-1</option>
<option value="Control 51-2">Control 51 -2</option>
<option value="Chase-1">Chase - 1</option>
<option value="Chase-2">Chase - 2</option>
<option value="Digi News-1">Digi News - 1 </option>
<option value="Digi News-2">Digi News - 2 </option>
<option value="Digi News-3">Digi News - 3 </option>
<option value="Local Toronto">Local News - Toronto</option>
<option value ="French Services">French services</option>
<option value="National">National</option>
<option value="News-3">News - 3 </option>
<option value="News Now Vancouver">News Now - Vancouver</option>
<option value="Planning">Planning</option>
<option value="Supervisor">Supervisor</option>
<option value="Greg Clarke">Greg Clarke</option>
</select>
</form>
<br/>
<button type="button" class="btn btn-lg btn-success"onclick="myFunction()">Check your shift!</button>
<p> </p>
<p id="time"></p>
<p id="nameofshift"></p>
<p id="gathering"></p>
</div>
</div>
</body>
</html>