-
Notifications
You must be signed in to change notification settings - Fork 1
/
formprueba.html
231 lines (188 loc) · 8.04 KB
/
formprueba.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title></title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" ></script>
<script src="https://oss.maxcdn.com/bootbox/4.2.0/bootbox.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.9.3/js/bootstrap-select.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.9.3/css/bootstrap-select.min.css">
</head>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-72535013-1', 'auto');
ga('send', 'pageview');
</script>
<style>
body{
background-image: url("starsPrueba.jpg");
}
p{
font-size:1.5em;
color:white;
/* text-align: auto !important;*/
}
hr{
width:80%;
}
</style>
<body>
<div style="text-align:center;display:none" id="mainDiv">
<h2 id="mainTitle" style="margin-top:100px;color:white"> Welcome to the Chat app!</h2>
<br>
<br>
<p class="container-fluid" style="color:white;text-align:center;"> Join and start discussing in classes being offered at PSU in Spring 2016! (More to come soon)</p>
<br>
<hr>
</div>
<form id="loginForm" method="post" class="form-horizontal" style="display: none;" onsubmit="return validateForm();">
<!-- <div class="form-group"> -->
<label class="col-xs-3 control-label">Class:</label>
<select class="selectpicker" id="classes">
<option value="-1">Select a Class</option>
<option value="MATH141Fabbri">Math141 Fabbri</option>
<option value="MATH141Kazimierz">Math141 Kazimierz</option>
<option value="ECON102Brown">Econ102 Brown</option>
<option value="ECON104Brown">Econ104 Brown</option>
<!-- <option value="PHYS211Costantino">Phys211 Costantino</option> -->
<!-- <option value="-1">Select a Class</option>
<option value="CMPSC100Domico">CMPSC 100 Domico</option>
<option value="CMPSC101Parimalarangan">CMPSC 101 Parimalarangan</option>
<option value="CMPSC101Li">CMPSC 101 Li</option>
<option value="CMPSC101Tehranchi">CMPSC 101 Tehranchi</option> -->
<!-- <option value="CMPSC101Verbanek">CMPSC 101 Verbanec</option>
<option value="CMPSC101Kachurak">CMPSC 101 Kachurak</option>
<option value="CMPSC111SHannan">CMPSC 111S Hannan</option>
<option value="CMPSC121Shaffer">CMPSC 121 Shaffer</option>
<option value="CMPSC121Quick">CMPSC 121 Quick</option>
<option value="CMPSC122Christman">CMPSC 122 Christman</option>
<option value="CMPSC200Scottile">CMPSC 200 Scottile</option>
<option value="CMPSC201Quick">CMPSC 201 Quick</option>
<option value="CMPSC203Fukuyama">CMPSC 203 Fukuyama</option>
<option value="CMPSC221Verbanec">CMPSC 221 Verbanec</option>
<option value="CMPSC296">CMPSC 296 </option>
<option value="CMPSC311Urgaonkar">CMPSC 311 Urgaonkar</option>
<option value="CMPSC431WLin">CMPSC 431W Lin</option>
<option value="CMPSC443Tan">CMPSC 443 Tan </option>
<option value="CMPSC450Madduri">CMPSC 450 Madduri </option>
<option value="CMPSC451Madduri">CMPSC 451 Madduri </option>
<option value="CMPSC455Ma">CMPSC 455 Ma </option>
<option value="CMPSC456Harlim">CMPSC 456 Harlim </option>
<option value="CMPSC461">CMPSC 461 </option>
<option value="CMPSC465Berman">CMPSC 465 Berman </option>
<option value="CMPSC465Berman">CMPSC 465 Smith </option>
<option value="CMPSC473Jaeger">CMPSC 473 Jaeger </option>
<option value="CMPSC483WVerbanec">CMPSC 483W Verbanec </option>
<option value="CMPSC497CKifer">CMPSC 497C Kifer </option>
<option value="CMPSC497EFast">CMPSC 497E Fast </option> -->
</select>
<script>
$('.selectpicker').selectpicker({
size: 10
});
</script>
<br>
<br>
<label class="col-xs-3 control-label">Name:</label>
<!-- <div class="col-xs-5"> -->
<input type="text" class="form-control" name="user[name]" id="username" style="width:220px"/>
<!-- </div> -->
<!-- </div> -->
<br>
<br>
<div class="alert alert-danger" role="alert" style="display:none" id="emptyUser">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only" id="error">Error:</span>
</div>
<div class="form-group">
<div class="col-xs-5 col-xs-offset-3">
<button type="submit" class="btn btn-default">Login</button>
</div>
</div>
</form>
<br>
<br>
<div id="roomsDiv" class="row" class="container-fluid" style="margin-top:50px;padding-left:50px;display:none">
<div class="col-md-6">
<h2 style="color:white"> Join a Chat Room</h2>
<p>
Join an existing chat room in which you can discover new topics, people and more!
</p>
<button class="btn btn-primary" id="joinRoomButton" style="color:white;font-size:1.5em" type="button">Join Room</button>
</div>
<div class="col-md-6">
<h2 style="color:white"> Create a Chat Room (Coming soon!)</h2>
<p >
If you have an idea to share so that others can join and talk about it, click here to create your own chat room!
</p>
<button class="btn btn-primary" style="color:white;font-size:1.5em" id="login">Create a room</button>
</div>
<br>
</div>
<script>
// var notification = new Notification('Email received', {
// body: 'You have a total of 3 unread emails'
// });
function validateForm(){
if(document.getElementById("username").value == "")
{
document.getElementById("emptyUser").style.display = "inherit";
document.getElementById("emptyUser").innerHTML = "ERROR: Please enter a nonempty username";
return false;
}
if(document.getElementById("classes").value==-1)
{
document.getElementById("emptyUser").style.display = "inherit";
document.getElementById("emptyUser").innerHTML = "ERROR: Please select a class";
return false;
}
var dd = document.getElementById("classes");
var className = dd.options[dd.selectedIndex].value;
document.getElementById("loginForm").action ="/class/" + className;
}
$(document).ready(function() {
if (window.webkitNotifications && navigator.userAgent.indexOf("Chrome") > -1) {
console.log("Web Notifications are supported with the WebKit API");
Notification.requestPermission();
} else if (window.Notification) {
console.log("Web Notifications are supported with the W3C/Safari API");
Notification.requestPermission();
} else {
console.log("Web Notifications are not supported in this browser");
}
// Let's check if the browser supports notifications
// Finally, if the user has denied notifications and you
// want to be respectful there is no need to bother them any more.
$( "#mainDiv" ).fadeIn( 1200, function() {
// Animation complete
});
$( "#roomsDiv" ).fadeIn( 1200, function() {
// Animation complete
});
// Login button click handler
$('#joinRoomButton').on('click', function() {
bootbox
.dialog({
title: 'Login',
message: $('#loginForm'),
})
.on('shown.bs.modal', function() {
$('#loginForm')
.show() // Show the login form
})
.on('hide.bs.modal', function(e) {
// Bootbox will remove the modal (including the body which contains the login form)
// after hiding the modal
// Therefor, we need to backup the form
$('#loginForm').hide().appendTo('body');
})
.modal('show');
});
});
</script>
</body>
</html>