From ffebbf1928046c8db2b3d137e90d130199a6ee37 Mon Sep 17 00:00:00 2001 From: MatthewHana Date: Mon, 18 Mar 2024 06:45:10 +1100 Subject: [PATCH] Rearrange functions to resolve false conflict. --- radicale/web/internal_data/fn.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/radicale/web/internal_data/fn.js b/radicale/web/internal_data/fn.js index a9170e35..207e77f8 100644 --- a/radicale/web/internal_data/fn.js +++ b/radicale/web/internal_data/fn.js @@ -1336,22 +1336,6 @@ function CreateEditCollectionScene(user, password, collection) { }; } -/** - * Format bytes to human-readable text. - * - * @param bytes Number of bytes. - * - * @return Formatted string. - */ -function bytesToHumanReadable(bytes, dp=1) { - let isNumber = !isNaN(parseFloat(bytes)) && !isNaN(bytes - 0); - if(!isNumber){ - return ""; - } - var i = bytes == 0 ? 0 : Math.floor(Math.log(bytes) / Math.log(1024)); - return (bytes / Math.pow(1024, i)).toFixed(dp) * 1 + ' ' + ['b', 'kb', 'mb', 'gb', 'tb'][i]; -} - /** * Removed invalid HREF characters for a collection HREF. * @@ -1386,6 +1370,22 @@ function isValidHREF(href) { return true; } +/** + * Format bytes to human-readable text. + * + * @param bytes Number of bytes. + * + * @return Formatted string. + */ +function bytesToHumanReadable(bytes, dp=1) { + let isNumber = !isNaN(parseFloat(bytes)) && !isNaN(bytes - 0); + if(!isNumber){ + return ""; + } + var i = bytes == 0 ? 0 : Math.floor(Math.log(bytes) / Math.log(1024)); + return (bytes / Math.pow(1024, i)).toFixed(dp) * 1 + ' ' + ['b', 'kb', 'mb', 'gb', 'tb'][i]; +} + function main() { // Hide startup loading message document.getElementById("loadingscene").classList.add("hidden");