-
Notifications
You must be signed in to change notification settings - Fork 2
/
upload.html
48 lines (40 loc) · 1.28 KB
/
upload.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
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="google-site-verification" content="ilalb0jZKO_byQAVbT-l4p7ivwqYNEbHAdryZd5jfP0" />
<title>Giffer - Uploader</title>
</head>
<body>
<!-- site-canvas -->
<div class="site-canvas">
<form>
pwd:
<input type="password" name="pwd" id="input-pwd"/> <br />
<input type="text" name="url" id="input-url"/>
<button type="submit" id="bttn-sub">upload</button>
</form>
</div>
<!--/ site-canvas -->
<script>
document.querySelector('#bttn-sub').addEventListener('click', function (e) {
e.preventDefault();
var url = document.querySelector('#input-url').value;
var pwd = document.querySelector('#input-pwd').value;
if (!url) return;
fetch('https://giffer-projector.herokuapp.com/gif?token=' + pwd, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: url
})
}).then(function () {
document.querySelector('#input-url').value = '';
})
});
</script>
</body>
</html>