-
Notifications
You must be signed in to change notification settings - Fork 0
/
shortPage.html
84 lines (71 loc) · 2.71 KB
/
shortPage.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
<html>
<head>
<meta name="google-site-verification" content="2QLKtDFPPQwFab4Tx2Gf0TJ1SVMI1lSA4VfKsA90SaY" /> <!-- ssshhh... -->
<title>Dwarfism 2.0</title>
<link rel="stylesheet" type="text/css" href="/css/global.css" />
<script src='https://www.google.com/recaptcha/api.js' async defer></script>
<meta name="msvalidate.01" content="864046E07A1B992B74A4682F7D3CCD7E" />
</head>
<div id="container">
<body>
<div id="header">
<h1>Dwarfism 2.0</h1> <br>
<h2>A subsection of <a href="https://imagen.click">Imagen Dot Click</a></h2>
<h4> <a href="https://github.com/gidoBOSSftw5731/dwarfism-2.0">See the code!</h4></a>
</div>
<div id="form">
<form action="{{.URLPrefix}}dform/" method="post" id="uploadform">
<div class="loggedout">
To make a custom output URL, <a href="/login">login here!</a> <br>
</div>
URL: <input type="text" id="lURL" name="lURL"><br>
<div class="loggedin">
Custom Short URL Extension (random by default): <input type="text" id="sURL" name="sURL"><br>
</div>
<div id="submit">
<div id="submit">
<button class="g-recaptcha" data-sitekey="{{.CaptchaPub}}" data-callback='onSubmit'>Shrink!</button>
</div>
</div>
</form>
</div>
<a href="{{.ExtraString}}">{{.ExtraString}}</a>
<div id="footer">
<a href="{{.URLPrefix}}"> Home Page </a> <a class='loggedout' href="/login"> Log In </a> <a class='loggedin' href="/logout"> Log Out </a> <a href="directory"> Directory </a>
</div>
<script>
function onSubmit(token) {
document.getElementById("uploadform").submit();
}
</script>
<script>
var sessval = httpGet( "/verifysession" );
if (sessval.includes("true") ) {
hide(document.querySelectorAll('.loggedout'));
//show(documents.querySelectorAll('#loggedin'));
} else {
hide(document.querySelectorAll('.loggedin'));
}
function httpGet(theUrl)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false ); // false for synchronous request
xmlHttp.send( null );
return xmlHttp.responseText;
}
function hide (elements) {
elements = elements.length ? elements : [elements];
for (var index = 0; index < elements.length; index++) {
elements[index].style.display = 'none';
}
}
function show (elements, specifiedDisplay) {
elements = elements.length ? elements : [elements];
for (var index = 0; index < elements.length; index++) {
elements[index].style.display = specifiedDisplay || 'block';
}
}
</script>
</body>
</div>
</html>