-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
136 lines (104 loc) · 5.63 KB
/
test.html
File metadata and controls
136 lines (104 loc) · 5.63 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>Sign up a account</title>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<!-- Material Design Bootstrap -->
<link href="static/css/mdb.min.css" rel="stylesheet">
<!-- fontAwesome css-->
<link rel="stylesheet" href="css/fontawesome.min.css" type="text/css">
<link rel="stylesheet" href="css/main.css" type="text/css">
<!-- Custom styles for this template -->
<link href="css/signup.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="row">
<div class="col-sm-9 col-md-7 col-lg-5 mx-auto">
<div class="card card-signup my-5">
<div class="card-body">
<h5 class="card-title text-center">Sign Up</h5>
<form class="form-signup" id="newacc">
<div class="form-label-group">
<input type="text" id="inputName" class="form-control" placeholder="Name" required>
<label for="inputName">Name</label>
</div>
<div class="form-label-group">
<input type="email" id="inputEmail" class="form-control" placeholder="Email address" required>
<label for="inputEmail">Email address</label>
</div>
<div class="form-label-group">
<input type="password" id="inputPassword" class="form-control" placeholder="Password" required>
<label for="inputPassword">Password</label>
</div>
<button class="btn btn-lg btn-primary btn-block text- uppercase" type="submit">Sign UP</button>
<p>Already have an account? <a href="signin.html">Sign in</a></p>
<p>Don't want to sign up? <a href="WebAssignment.html">Click Here</a></p>
<hr class="my-4">
<button class="btn btn-lg btn-block btn-facebook socialbtn" type="button"><span class="fblogo"><i class="fab fa-facebook-f fa-lg"></i></span>Sign up with Facebook</button>
<button class="btn btn-lg btn-block btn-google socialbtn" type="button"><span class="glogo"><i class="fab fa-google fa-lg"></i></span>Sign up with Google</button>
</form>
</div>
</div>
</div>
</div>
<div id="response"></div>
</div>
<div></div>
<script src="https://code.jquery.com/jquery-3.3.1.js" integrity="sha256-2Kok7MbOyxpgUVvAk/HJ2jigOSYS2auK4Pfzbm7uH60=" crossorigin="anonymous"></script>
<!-- include firebase-->
<script src="https://www.gstatic.com/firebasejs/5.4.0/firebase.js"></script>
<script src="js/firebase.js"></script>
<!--fb, google authentication-->
<script src="https://apis.google.com/js/platform.js" async defer></script>
<!--font awesome icon-->
<script src="js/all.min.js" type="text/javascript"></script>
<script src="js/fontawesome.min.js" type="text/javascript"></script>
<script src="js/v4-shims.min.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<!-- sweetalert-->
<script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
<!--mdb-->
<script type="text/javascript" src="static/js/mdb.min.js"></script>
<script type="text/javascript">
$(function() { //onload
$("#newacc").submit(function(event) {
event.preventDefault();
//create new account
var name = $("#inputName").val();
var email = $("#inputEmail").val();
var password = $("#inputPassword").val();
updataUserdbs('12ewfsgsdgd0', name, email)
});
});
function updataUserdbs(uid, userName, email) {
var database = firebase.database().ref('user');
var updateUserdb = database.push();
updateUserdb.set({
uid: uid,
name: userName,
email: email
});
}
function initApp() {
//check user keep in cookie
// Listening for auth state changes.
// [START authstatelistener]
firebase.auth().onAuthStateChanged(function(user) {
if (user) {
// // User is signed up .
// if (user.displayName == null || user.photoURL == null) window.location.href = "WebAssignment.html";
// else window.location.href = "WebAssignment.html";
}
});
// [END authstatelistener]
}
</script>
</body>
</html>