-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
125 lines (116 loc) · 4.84 KB
/
index.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
<!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>
<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(){
$(".btn_ajax").on("click", function(e) {
var button = $(this);
var form =$("#"+$(button).attr("action"));
$.ajax({
url: form.attr('action'),
type: form.attr('method'),
data: form.serialize(),
timeout: 10000,
success:ajaxSuccess
})
});
function ajaxSuccess(result){
if(result.result === "failure"){
$("#errorMsg").html("");
$("#errorMsg").append(" <div class='alert alert-danger' id='myAlert'></div>");
$("#myAlert").append("<string>E-mail</string>または<string>Password</string>、をもう一度確認してください。");
}else{
localStorage.setItem("userId", result.userId);
window.location.href = "//devdebu.github.io/myroom.html";
}
}
});
</script>
</head>
<body>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<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="//devdebu.github.io/signup.html"><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">Login To Your Account</h2>
<div id = "errorMsg">
</div>
<form action = "//deboo.mybluemix.net/v1/login" method ="get" 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="row margin-bottom-70">
<div class="col-md-12">
<button type="button" class ="btn btn-danger btn-block btn_ajax" action = "login" >LOGIN</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>