Add hidden service and downloads page

This commit is contained in:
Yakov5776 2022-10-11 23:10:02 -04:00
parent e7beba2f11
commit ae6eaa6c53
5 changed files with 55 additions and 2 deletions

View File

@ -4,9 +4,10 @@ TODO
# How do I build this?
This project uses material mkdocs.
To install materal mkdocs, simply run:
To install materal mkdocs (and it's dependencies), simply run:
pip install mkdocs-material
pip install mkdocs-exclude-search
Then run `mkdocs serve` to preview it.

27
docs/assets/Download.js Normal file
View File

@ -0,0 +1,27 @@
let dlText = document.getElementById("download-text");
let descText = document.getElementById("description-text");
const hash = window.location.hash.substr(1);
if (!hash || hash === "" || hash.length !== 64) redirect404();
fetch("/api/getFile?id=" + hash).then(function(response) {
return response.json();
}).then(function(data) {setupPage(data)});
function setupPage(data) {
if (data["Error"]) redirect404();
dlText.innerText = `Download '${data["Name"]}'`;
descText.innerText = data["Description"];
}
function redirect404() {
window.location.replace("/404");
throw new Error("404");
}
function downloadFile() {
window.location.href = "/api/dlFile?id=" + hash;
}

BIN
docs/assets/download-24.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

20
docs/hidden/Download.md Normal file
View File

@ -0,0 +1,20 @@
# Download Text
##### File Description:
<p id="description-text">Description Text</p>
<br>
<button class="md-button md-button--primary downloadIcon" onClick="downloadFile()">Download File</button>
<script src="/assets/Download.js"></script>
<style>
.md-nav--secondary {
display: none;
}
.downloadIcon {
background-image: url(/assets/download-24.png);
background-position: 9px;
background-repeat: no-repeat;
padding-right: 1em !important;
}
</style>

View File

@ -28,4 +28,9 @@ extra:
generator: false
extra_css:
- assets/CustomText.css
plugins:
- search
- exclude-search:
exclude:
- hidden/*
copyright: We're not affiliated, associated, authorized, or endorsed by ROBLOX Corporation in any way, shape, or form.