remove byte counter

This commit is contained in:
2020-01-13 21:50:53 +01:00
parent 5445818051
commit 1702949632
8 changed files with 36 additions and 45 deletions

View File

@@ -173,6 +173,19 @@ function loadCaptcha(){
});
}
function formatDataVolume(amt) {
if (amt > 1e12) {
return Math.round(amt/1e9)/1e3 + " TB";
} else if (amt > 1e9) {
return Math.round(amt/1e6)/1e3 + " GB";
} else if (amt > 1e6) {
return Math.round(amt/1e3)/1e3 + " MB";
} else if (amt > 1e3) {
return Math.round(amt)/1e3 + " kB";
}
return amt + " B"
}
var DetailsWindow = {
visible: false,
fileID: "",
@@ -218,8 +231,8 @@ var DetailsWindow = {
+ "<tr><td>URL<td><td><a href=\"/u/" + data.id + "\">/u/" + data.id + "</a></td></tr>"
+ "<tr><td>Mime Type<td><td>" + escapeHTML(data.mime_type) + "</td></tr>"
+ "<tr><td>ID<td><td>" + data.id + "</td></tr>"
+ "<tr><td>Size<td><td class=\"bytecounter\">" + data.size + "</td></tr>"
+ "<tr><td>Bandwidth<td><td class=\"bytecounter\">" + data.bandwidth_used + "</td></tr>"
+ "<tr><td>Size<td><td>" + formatDataVolume(data.size) + "</td></tr>"
+ "<tr><td>Bandwidth<td><td>" + formatDataVolume(data.bandwidth_used) + "</td></tr>"
+ "<tr><td>Upload Date<td><td>" + data.date_upload + "</td></tr>"
+ "<tr><td>Description<td><td>" + escapeHTML(file.description) + "</td></tr>"
+ "</table>"
@@ -237,8 +250,8 @@ var DetailsWindow = {
+ "<tr><td>Name<td><td>" + escapeHTML(file.name) + "</td></tr>"
+ "<tr><td>Mime Type<td><td>" + escapeHTML(file.mime_type) + "</td></tr>"
+ "<tr><td>ID<td><td>" + file.id + "</td></tr>"
+ "<tr><td>Size<td><td class=\"bytecounter\">" + file.size + "</td></tr>"
+ "<tr><td>Bandwidth<td><td class=\"bytecounter\">" + file.bandwidth_used + "</td></tr>"
+ "<tr><td>Size<td><td>" + formatDataVolume(file.size) + "</td></tr>"
+ "<tr><td>Bandwidth<td><td>" + formatDataVolume(file.bandwidth_used) + "</td></tr>"
+ "<tr><td>Upload Date<td><td>" + file.date_upload + "</td></tr>"
+ "</table>"
);

View File

@@ -248,7 +248,7 @@ h3{font-size: 1.5em; font-family: "light"; font-weight: normal;}
h4{font-size: 1.25em; font-family: "default"; font-weight: normal;}
h5{font-size: 1em; font-family: "default"; font-weight: normal;}
h6{font-size: .75em; font-family: "default"; font-weight: normal;}
h3, h2{border-bottom: 1px var(--layer_3_color_border) solid;} /* Differentiate it a bit, else it just looks like bold text */
h2, h3{border-bottom: 1px var(--layer_3_color_border) solid;} /* Differentiate it a bit, else it just looks like bold text */
p, .indent {
margin: 10px;
@@ -289,7 +289,7 @@ a:hover {color: var(--highlight_color); text-decoration: underline;}
}
table:not(.form) {border-collapse: collapse; width: 100%;}
tr:not(.form) {border-bottom: 1px var(--layer_2_color_border) solid;}
tr > td {padding: 0.5em;}
tr > td {padding: 0.3em;}
@media(max-width: 30em) {
tr > td {
box-sizing: border-box;

View File

@@ -312,7 +312,6 @@
}
table {width: auto !important;}
table > tbody > tr {border: none !important;}
.corner-popup{
position: fixed;
@@ -328,21 +327,6 @@ table > tbody > tr {border: none !important;}
z-index: 200;
}
.bytecounter{
color: var(--text_color);
font-size: 16px;
font-family: monospace, monospace;
line-height: 20px;
text-align: right;
display: inline-block;
background-image: url("/res/img/bytecounter.png");
background-position: top right;
width: 136px;
height: 36px;
padding: 0;
padding-right: 1px;
}
/* ====================
|| LIST NAVIGATOR ||
==================== */