Add hidden service and downloads page
This commit is contained in:
parent
e7beba2f11
commit
ae6eaa6c53
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 239 B |
|
|
@ -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>
|
||||
|
|
@ -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.
|
||||
Loading…
Reference in New Issue