-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.jsp
144 lines (141 loc) · 5.62 KB
/
index.jsp
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
<%@ page contentType="text/html;charset=utf-8" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="/github/blog/css/bootstrap.min.css">
<link rel="stylesheet" href="/github/blog/css/ecnuojcss.css">
<script src="/github/blog/js/jquery.min.js"></script>
<script src="/github/blog/js/bootstrap.min.js"></script>
<title>
Dark Temple
</title>
</head>
<body>
<div class="navbar-container container">
<div class="navbar-header">
<button aria-controls="bs-navbar" aria-expanded="false" class="collapsed navbar-toggle" data-target="#bs-navbar" data-toggle="collapse" type="button">
<span class="glyphicon glyphicon-menu-hamburger" aria-hidden="true"></span></button>
<a href="/github/blog" class="navbar-brand">Dark Temple</a>
</div>
<nav class="collapse navbar-collapse" id="bs-navbar">
<ul class="nav navbar-nav">
<li class=""><a href="Article/">Article</a></li>
<li class=""><a href="Photo/">Photo</a></li>
<li class=""><a href="Little_Tricky/">Little Tricky</a></li>
<li class=""><a href="Experience/">Experience</a></li>
<li class=""><a href="Others/">Others</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a data-toggle="modal" data-target="#LoginModal">Login</a>
</li>
<li>
<a data-toggle="modal" data-target="#myModal">Register</a>
</li>
</ul>
<div class="modal fade" id="LoginModal" tabindex="-1" role="dialog" aria-labelledby="LoginModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title" id="LoginModalLabel">
Login
</h4>
</div>
<div class="modal-body">
<div class="form-group">
<label>Username</label>
<input type="text" class="form-control" id="name" placeholder="Username..." onblur="check_username()">
<div id="namechecker"></div>
<label>Password</label>
<input type="password" class="form-control" id="password" placeholder="Password..." onblur="check_password()">
<div id="passwordchecker"></div>
<label>Password Confirm</label>
<input type="password" class="form-control" id="password_confirm" placeholder="Password..." onblur="confirm_password()">
<div id="passwordconfirmer"></div>
<label>Captcha</label>   
<button type="button" class="btn btn-info btn-xs" onclick="make_checker(0);check_checker();" id="show_checker">checker</button>
<input type="text" class="form-control" id="checker" placeholder="请输入验证码..." onfocus="make_checker(1)" onkeyup="check_checker()">
<div id="status_checker"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Submit</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
</nav>
</div>
<div class="masthead" style="background-image: url(image/1.jpg);">
<div class="masthead-container">
<h1>Dark Temple</h1>
<span> Und wenn du lange in einen Abgrund blickst, blickt der Abgrund auch in dich hinein. </span>
</div>
</div>
</body>
</html>
<script type="text/javascript">
function check_username(){
var status=0;
var str=document.getElementById("name").value;
if(str.length<6||str.length>13) status=1;
else{
for(var i=0;i<str.length;i++){
if(!((str.charAt(i)>='a'&&str.charAt(i)<='z')||(str.charAt(i)>='A'&&str.charAt(i)<='Z')||(str.charAt(i)>='0'&&str.charAt(i)<='9')||str.charAt(i)=='_')){
status=2;break;
}
}
}
if(status==1) str="The length of Username between 6 to 12 characters are expected.";
else if(status==2) str="Username should contain only Latin letters, digits or underscore.";
else str="";
document.getElementById("namechecker").innerHTML=str;
}
function check_password(){
var status=0;
var str=document.getElementById("password").value;
if(str.length<6||str.length>18) status=1;
else{
for(var i=0;i<str.length;i++){
if(!((str.charAt(i)>='a'&&str.charAt(i)<='z')||(str.charAt(i)>='A'&&str.charAt(i)<='Z')||(str.charAt(i)>='0'&&str.charAt(i)<='9')||str.charAt(i)=='_')){
status=2;break;
}
}
}
if(status==1) str="The length of Password between 6 to 18 characters are expected.";
else if(status==2) str="Password should contain only Latin letters, digits or underscore.";
else str="";
document.getElementById("passwordchecker").innerHTML=str;
}
function confirm_password(){
var str;
if(document.getElementById("password").value==document.getElementById("password_confirm").value) str="";
else str="Different Password";
document.getElementById("passwordconfirmer").innerHTML=str;
}
function make_checker(x){
if(x==0||document.getElementById("show_checker").innerHTML=="checker"){
var str="";
for(var i=0;i<4;i++)
str+=Math.ceil(Math.random()*10)%10;
document.getElementById("show_checker").innerHTML = str;
}
}
function check_checker(){
var str1=document.getElementById("show_checker").innerHTML;
var str2=checker.value;
var status="";
if(str1!=str2){
status="Wrong checker";
}
document.getElementById("status_checker").innerHTML=status;
}
setTimeout(function() {
$(".masthead-container").css('background', 'rgba(0, 0, 0, 0.5)');
}, 0);
</script>