mirror of
https://github.com/rikkaneko/paste.git
synced 2025-06-06 16:45:41 +00:00
Fix typo
This commit is contained in:
parent
9c72be7133
commit
bd26de1a67
1 changed files with 6 additions and 1 deletions
|
@ -78,13 +78,18 @@
|
|||
}
|
||||
|
||||
function update_file_status() {
|
||||
const status = document.getElementById('file_stats');
|
||||
if (this.files[0] === undefined) {
|
||||
status.textContent = '0 bytes';
|
||||
return;
|
||||
}
|
||||
let bytes = this.files[0]?.size ?? 0;
|
||||
let size = bytes + ' bytes';
|
||||
const units = ['KiB', 'MiB', 'GiB', 'TiB'];
|
||||
for (let i = 0, approx = bytes / 1024; approx > 1; approx /= 1024, i++) {
|
||||
size = approx.toFixed(3) + ' ' + units[i];
|
||||
}
|
||||
document.getElementById('file_size').textContent = `${this.files[0]?.type ?? 'application/application/octet-stream'}, ${size}`;
|
||||
status.textContent = `${this.files[0]?.type ?? 'application/application/octet-stream'}, ${size}`;
|
||||
}
|
||||
|
||||
function toggle_password() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue