document.addEventListener('DOMContentLoaded', function() { function calculateSize(size) { var sufixes = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'EiB']; var q = 0; while (size / 1024 > 1) { size = size / 1024; q++; } return (Math.round(size * 100) / 100) + ' ' + sufixes[q]; } if (window.location.pathname == '/') { document.querySelector('.directory.go-up').style.display = 'none'; } var path = window.location.pathname.split('/'); var nav = document.querySelector("nav#breadcrumbs ul"); var pathSoFar = ''; for (var i = 1; i < path.length - 1; i++) { pathSoFar += '/' + decodeURI(path[i]); nav.innerHTML += '