Refactor downloads and ToC
This commit is contained in:
parent
7fe44f2813
commit
4a93affc30
|
|
@ -19,5 +19,5 @@ Private Key:
|
||||||
A user by the name of coke<sub><sup>[Citation needed]</sup></sub> made an application which generates RSA pairs for the client, the download can be found [here](/hidden/Download#906c8ec652e43b043603b97fc0e31a626448e65bdf4819c7a8c4bc18a768d8a8).
|
A user by the name of coke<sub><sup>[Citation needed]</sup></sub> made an application which generates RSA pairs for the client, the download can be found [here](/hidden/Download#906c8ec652e43b043603b97fc0e31a626448e65bdf4819c7a8c4bc18a768d8a8).
|
||||||
|
|
||||||
|
|
||||||
### See Also:
|
<h3 id="see-also">See Also:</h3>
|
||||||
- [What are signatures?](/Client Security/Signatures)
|
- [What are signatures?](/Client Security/Signatures)
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
|
let fileSpan = document.getElementById("file-span");
|
||||||
let dlText = document.getElementById("download-text");
|
let dlText = document.getElementById("download-text");
|
||||||
let descText = document.getElementById("description-text");
|
let descText = document.getElementById("description-text");
|
||||||
|
let sizeText = document.getElementById("size-text");
|
||||||
|
|
||||||
const hash = window.location.hash.substr(1);
|
const hash = window.location.hash.substr(1);
|
||||||
|
|
||||||
|
|
@ -11,9 +13,25 @@ fetch("/api/getFile?id=" + hash).then(function(response) {
|
||||||
|
|
||||||
function setupPage(data) {
|
function setupPage(data) {
|
||||||
if (data["Error"]) redirect404();
|
if (data["Error"]) redirect404();
|
||||||
|
if (data["Author"])
|
||||||
|
{
|
||||||
|
showElement(document.getElementById("author-div"));
|
||||||
|
document.getElementById("author-text").innerText = data["Author"];
|
||||||
|
}
|
||||||
|
|
||||||
dlText.innerText = `Download '${data["Name"]}'`;
|
dlText.innerText = `Download '${data["Name"]}'`;
|
||||||
descText.innerText = data["Description"];
|
descText.innerText = data["Description"];
|
||||||
|
document.title = "Download " + data["Name"] + " - ROBLOX Reverse Engineering";
|
||||||
|
|
||||||
|
sizeText.innerText = FileSize(data["Size"])
|
||||||
|
|
||||||
|
let btn = document.createElement("button");
|
||||||
|
btn.className = "md-button md-button--primary downloadIcon";
|
||||||
|
btn.onclick = downloadFile;
|
||||||
|
btn.innerText = "Download File";
|
||||||
|
fileSpan.appendChild(btn);
|
||||||
|
|
||||||
|
showElement(fileSpan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -25,3 +43,12 @@ function redirect404() {
|
||||||
function downloadFile() {
|
function downloadFile() {
|
||||||
window.location.href = "/api/dlFile?id=" + hash;
|
window.location.href = "/api/dlFile?id=" + hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showElement(element) {
|
||||||
|
element.style.display = "block";
|
||||||
|
}
|
||||||
|
|
||||||
|
function FileSize(size) {
|
||||||
|
var i = size == 0 ? 0 : Math.floor(Math.log(size) / Math.log(1024));
|
||||||
|
return (size / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + ['B', 'kB', 'MB', 'GB', 'TB'][i];
|
||||||
|
}
|
||||||
|
|
@ -1,16 +1,22 @@
|
||||||
# Download Text
|
<h1 id="download-text">Getting File Information...</h1>
|
||||||
|
|
||||||
##### File Description:
|
<div id="file-span" style="display:none">
|
||||||
<p id="description-text">Description Text</p>
|
<h5 id="file-description">File Description:</h5>
|
||||||
|
<p id="description-text">Description Text</p>
|
||||||
|
|
||||||
<br>
|
<div id="author-div" style="display:none">
|
||||||
<button class="md-button md-button--primary downloadIcon" onClick="downloadFile()">Download File</button>
|
<h5 id="file-author" style="display:inline">Author:</h5>
|
||||||
|
<p id="author-text" style="display:inline">Author Text</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h5 id="file-size" style="display:inline">File Size:</h5>
|
||||||
|
<p id="size-text" style="display:inline">1GB</p>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
</div>
|
||||||
<script src="/assets/Download.js"></script>
|
<script src="/assets/Download.js"></script>
|
||||||
<style>
|
<style>
|
||||||
.md-nav--secondary {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.downloadIcon {
|
.downloadIcon {
|
||||||
background-image: url(/assets/download-24.png);
|
background-image: url(/assets/download-24.png);
|
||||||
background-position: 9px;
|
background-position: 9px;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue