-
Notifications
You must be signed in to change notification settings - Fork 8
/
settings.html
99 lines (75 loc) · 3.89 KB
/
settings.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
<!DOCTYPE html>
<html>
<head>
<!-- Title, so we can keep track of what page this is, even if PhoneGap doesn't display it. -->
<title>VirPong Mobile Client: Authentication Prompt</title>
<!-- Defining the size of the viewport. This is useful for -->
<!-- mobile devices for the sake of scaling and disabling resizing. -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" charset="utf-8" />
<!-- Defining our main styles. "main.css" is basic stuff, -->
<!-- and the two others provide sizing relativity for the iPad -->
<!-- and Android respectively. -->
<link rel="stylesheet" href="css/main.css" type="text/css" />
<link rel="stylesheet" media="only screen and (device-width: 768px)" href="css/ipad.css" type="text/css" />
<link rel="stylesheet" media="only screen and (device-width: 800px)" href="css/android.css" type="text/css" />
<link rel="stylesheet" media="only screen and (device-width: 320px)" href="css/iphone.css" type="text/css" />
<link rel="stylesheet" media="only screen and (device-width: 480px)" href="css/iphone.css" type="text/css" />
<!-- Include PhoneGap! -->
<script type="text/javascript" charset="utf-8" src="phonegap-1.2.0-iOS.js"></script>
<!-- Some basic JS for this document. -->
<script type="text/javascript">
/*
* This function takes an event and disables the default behavior.
* @param event e The event we're preventing the behavior of.
*/
function preventBehavior(e)
{
e.preventDefault();
}
/*
* Use local storage to store username/pin for the playGame
* page (where authentication actually takes place in the socket
* connection. Once data is stored, move on to playGame.
*/
function handleForm(){
// Store the data from the input elements in the localStorage K/V pairs.
window.localStorage.setItem("username", document.pinEntry.userName.value);
window.localStorage.setItem("pin", document.pinEntry.userPIN.value);
// Move on to the home page.
window.location.href = "./index.html";
};
</script>
</head>
<body>
<!-- Our nice little menu at the top, with a link back to the main menu. -->
<div id="topBar">
<a class="topBarButton" href="index.html">Main Menu</a>
</div>
<!-- Main page wrapper -->
<div id="mainWrapper">
<center>
<!-- Displyay pinEntry form. -->
<form name="pinEntry" id="pinEntry">
<div style="font-size: 18pt;">U/N:</div>
<!-- Username -->
<input type="text" value="" name="userName" id="userName" "+
"onFocus="this.value=''" autocapitalize="off" autocorrect="off" />
<div style="font-size: 18pt;">PIN:</div>
<!-- PIN -->
<input type="password" value="" name="userPIN" id="userPIN" "+
"onFocus="this.value=''" autocapitalize="off" autocorrect="off" />
<br />
<!-- Submit -->
<a class="button" value="Log In" id="logIn" onClick="handleForm()">
Save & Go To Game</a>
<a class="button" href="javascript:window.localStorage.clear(); "+
"window.location.reload();">Clear Username/PIN</a>
</form>
</center>
<br />
<!-- Display footer. -->
<span id="footerMeta">© 2011 Vir-Pong, Inc. All rights reserverd.
</span>
</div>
</body>
</html>