-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshared_folder.html
138 lines (104 loc) · 2.92 KB
/
shared_folder.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
137
138
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="apple-touch-icon" sizes="180x180" href="images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/favicon-16x16.png">
<link rel="manifest" href="images/site.webmanifest">
<link rel="mask-icon" href="images/safari-pinned-tab.svg" color="#000000">
<link rel="shortcut icon" href="images/favicon.ico">
<meta name="apple-mobile-web-app-title" content="Vid Kuralt">
<meta name="application-name" content="Vid Kuralt">
<meta name="msapplication-TileColor" content="#00aba9">
<meta name="msapplication-TileImage" content="images/mstile-144x144.png">
<meta name="msapplication-config" content="images/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<style>
body {
background-image: url('images/grunge_patterns.jpg');
background-attachment: fixed;
color: #333;
}
.box {
border-radius: 3px;
background: rgba(101, 101, 101, 0.7); margin: auto; padding: 12px;
}
.lightbox {
zoom: 1.5;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(10, 10, 10, 0.8);
text-align: center;
margin: auto;
}
div.horizontal {
display: flex;
justify-content: center;
height: 100%;
}
div.vertical {
display: flex;
flex-direction: column;
justify-content: center;
width: 100%;
}
::-webkit-input-placeholder {
color: #955;
text-align: center;
}
::-moz-placeholder {
color: #955;
text-align: center;
}
:-ms-input-placeholder {
color: #955;
text-align: center;
}
</style>
<body>
<div id="loginbox" class="lightbox" >
<div class="horizontal">
<div class="vertical">
<div class="box">
<input style="margin: 16px; text-align: center;" id="password" type="password" placeholder="password" /> <br />
<button id="loginbutton" type="button">Enter</button>
<p id="wrongPassword" style="display: none">wrong password</p>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.0.min.js"></script>
<script type="text/javascript" src="https://rawcdn.githack.com/chrisveness/crypto/7067ee62f18c76dd4a9d372a00e647205460b62b/sha1.js"></script>
<script type="text/javascript">
"use strict";
function loadPage(pwd) {
var hash= pwd;
hash= Sha1.hash(pwd);
var url= hash + "/shared_folder.html";
$.ajax({
url : url,
dataType : "html",
success : function(data) {
window.location= url;
},
error : function(xhr, ajaxOptions, thrownError) {
parent.location.hash= hash;
//$("#wrongPassword").show();
$("#password").attr("placeholder","wrong password");
$("#password").val("");
}
});
}
$("#loginbutton").on("click", function() {
loadPage($("#password").val());
});
$("#password").keypress(function(e) {
if (e.which == 13) {
loadPage($("#password").val());
}
});
$("#password").focus();
</script>