-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.html
136 lines (130 loc) · 5.37 KB
/
signup.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
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>サインアップ</title>
<!--
<script src="//cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<style>
/* Remove the navbar's default margin-bottom and rounded borders */
.navbar {
margin-bottom: 0;
border-radius: 0;
}
.row.content {height: 450px}
.sidenav {
padding-top: 20px;
background-color: #f1f1f1;
height: 100%;
}
footer {
background-color: #555;
color: white;
padding: 15px;
}
@media screen and (max-width: 767px) {
.sidenav {
height: auto;
padding: 15px;
}
.row.content {height:auto;}
}
</style>
<script>
$(document).ready(function(){
var errorMsg = $("#errorMsg");
$(".btn_ajax").on("click", function(e) {
errorMsg.html("");
var button = $(this);
var form =$("#"+$(button).attr("action"));
var password = $('#password', form).val();
var passwordAgain = $('#passwordAgain', form).val();
if (password.trim().length > 0 && password === passwordAgain) {
$.ajax({
url: form.attr('action'),
type: form.attr('method'),
data: form.serialize(),
timeout: 10000,
success:ajaxSuccess
});
} else {
errorMsg.append(" <div class='alert alert-danger' id='myAlert'></div>");
$("#myAlert", errorMsg).append("<string>Password</string>を正しく入力してください。");
}
});
function ajaxSuccess(result){
if(result.result === "failure"){
errorMsg.html("");
errorMsg.append(" <div class='alert alert-danger' id='myAlert'></div>");
$("#myAlert", errorMsg).append("すでに登録されています。");
}else{
window.location.href = "//devdebu.github.io/index.html";
}
}
});
</script>
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="index.html">DevDebu</a>
</div>
<!--
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-edit"></span>Sign up</a></li>
</ul>
</div>
-->
</div>
</nav>
<div class="container-fluid text-center ">
<div class="row content">
<div class="col-sm-3 sidenav">
</div>
<div class="col-sm-6 text-left">
<h2 class="margin-bottom-30">Sign Up</h2>
<div id = "errorMsg">
</div>
<form action = "https://deboo.mybluemix.net/v1/user" method ="post" id="login">
<div class="login-block">
<div class="input-group margin-bottom-20">
<span class="input-group-addon rounded-left glyphicon glyphicon-user"></span>
<input type="email" class="form-control rounded-right" placeholder="E-mailを入力してください。" name="mail" id="mail" pattern="/^[-a-z0-9~!$%^&*_=+}{\'?]+(\.[-a-z0-9~!$%^&*_=+}{\'?]+)*@([a-z0-9_][-a-z0-9_]*(\.[-a-z0-9_]+)*\.(aero|arpa|biz|com|coop|edu|gov|info|int|mil|museum|name|net|org|pro|travel|mobi|[a-z][a-z])|([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}))(:[0-9]{1,5})?$/i">
</div>
<div class="input-group margin-bottom-20">
<span class="input-group-addon rounded-left glyphicon glyphicon-lock"></span>
<input type="password" class="form-control rounded-right" placeholder="Passwordを入力してください。" name="password" id="password" >
</div>
<div class="input-group margin-bottom-20">
<span class="input-group-addon rounded-left glyphicon glyphicon-lock"></span>
<input type="password" class="form-control rounded-right" placeholder="Passwordを再度入力してください。" name="passwordAgain" id="passwordAgain" >
</div>
<div class="row margin-bottom-70">
<div class="col-md-12">
<button type="button" class ="btn btn-danger btn-block btn_ajax" action = "login" >Sign Up</button>
</div>
</div>
</div>
</form>
</div>
<div class="col-sm-3 sidenav">
</div>
</div>
</div>
<footer class="container-fluid text-center">
<p></p>
</footer>
</body>
</html>