-
Notifications
You must be signed in to change notification settings - Fork 0
/
create.html
113 lines (95 loc) · 3.68 KB
/
create.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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Storm</title>
<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/github-dark.css">
<link rel="stylesheet" href="stylesheets/custom.css">
<script src='https://cdn.firebase.com/js/client/2.2.1/firebase.js'></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="javascripts/main.js"></script>
<script src="javascripts/util.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
</head>
<body>
<header>
<h1><a class="invisible" href="index.html">Storm</a></h1>
</header>
<div id="banner">
</div><!-- end banner -->
<div class="wrapper">
<nav>
<ul></ul>
</nav>
<section>
<div id="section-title" class="section-title">Create an Event</div>
<form onsubmit="return submitToFirebase(event)">
<label>Date</label>
<input type="date" id="date" min="2015-11-22" placeholder="mm/dd/yyyy"><br><br>
<label>Time</label>
<input type="time" id="time"><br><br>
<label>Duration </label>
<select id="duration">
<option value="30">30</option>
<option value="60">60</option>
<option value="90">90</option>
</select>
<label> minutes</label><br><br><br>
<label>Goal</label>
<input type="text" id="goal" placeholder="goal" class="long-input"><br><br>
<label>Criteria</label><br>
<input type="text" id="criteria1" placeholder="ex. efficiency"><br>
<input type="text" id="criteria2"placeholder="ex. aesthetics"><br>
<input type="text" id="criteria3" placeholder="ex. cost"><br><br>
<input type="submit" class="button" id="submit-button">
</form>
<script>
var newSessionRef = null;
function submitToFirebase(event) {
event.preventDefault();
var goal = $('#goal').val();
var date = $('#date').val();
var time = $('#time').val();
var duration = $('#duration').val();
var criteria1 = $('#criteria1').val();
var criteria2 = $('#criteria2').val();
var criteria3 = $('#criteria3').val();
var key = "";
var ref = new Firebase(getSessionUrl(key));
newSessionRef = ref.push({
goal: goal,
date: date,
time: time,
duration: duration,
criteria1: criteria1,
criteria2: criteria2,
criteria3: criteria3,
},
onSubmitToFirebaseComplete);
return false;
}
function onSubmitToFirebaseComplete(error) {
if (error) {
alert("Sorry, an error occurred");
}
else {
// redirect to success page with the key
var key = newSessionRef.key();
if (isDeployed()) {
window.location.replace("http://www.willhennessy.com/storm/begin?creator=1&session="+key);
} else {
window.location.replace("/Users/willhennessy/Documents/CS%20598%20-%20Social/storm/begin.html?creator=1&session="+key);
}
}
}
</script>
</section>
</div>
<!--[if !IE]><script>fixScale(document);</script><![endif]-->
</body>
</html>