mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 16:06:21 +00:00
Updated albums public page
File size when JavaScript is disabled will now properly use B suffix. It's referring to the fact that their unit is bytes. Disclaimer about this. Back-end will only return the file size in bytes, front-end is supposed to convert them into prettier units (KB, MB, ...). Nothing much can be done if front-end have JavaScript disabled. I don't want to defer the task, prettying the units, to back-end.
This commit is contained in:
parent
ecb8afbe40
commit
b754470630
@ -23,7 +23,7 @@ page.getPrettyBytes = function (num, si) {
|
||||
window.onload = function () {
|
||||
const elements = document.getElementsByClassName('file-size')
|
||||
for (let i = 0; i < elements.length; i++)
|
||||
elements[i].innerHTML = page.getPrettyBytes(parseInt(elements[i].innerHTML))
|
||||
elements[i].innerHTML = page.getPrettyBytes(parseInt(elements[i].innerHTML.replace(/\s*B$/i, '')))
|
||||
|
||||
page.lazyLoad = new LazyLoad()
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
v3: CSS and JS files (libs such as bulma, lazyload, etc).
|
||||
v4: Renders in /public/render/* directories (to be used by render.js).
|
||||
#}
|
||||
{% set v1 = "DKoamSTKbO" %}
|
||||
{% set v1 = "VAH8ougx12" %}
|
||||
{% set v2 = "hiboQUzAzp" %}
|
||||
{% set v3 = "DKoamSTKbO" %}
|
||||
{% set v4 = "dplQUZqTnf" %}
|
||||
|
@ -42,7 +42,7 @@
|
||||
</div>
|
||||
<div class="level-item">
|
||||
<h1 id="count" class="subtitle">
|
||||
{{ count }} files (<span class="file-size">{{ totalSize }}</span>)
|
||||
{{ count }} files (<span class="file-size">{{ totalSize }} B</span>)
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
@ -84,7 +84,7 @@
|
||||
</a>
|
||||
<div class="details">
|
||||
<p><span class="name" title="{{ file.file }}">{{ file.name }}</span></p>
|
||||
<p class="file-size">{{ file.size }}</p>
|
||||
<p class="file-size">{{ file.size }} B</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
Loading…
Reference in New Issue
Block a user