@loadPage = (pagePath) -> window.location.href = pagePath + '.html' @formatBytes = (bytes, decimals = 2) -> if bytes == 0 return '0 Bytes' k = 1024 dm = if decimals < 0 then 0 else decimals sizes = [ 'Bytes' 'KB' 'MB' 'GB' 'TB' 'PB' 'EB' 'ZB' 'YB' ] i = Math.floor(Math.log(bytes) / Math.log(k)) parseFloat((bytes / k ** i).toFixed(dm)) + ' ' + sizes[i]