diff --git a/wserver.py b/wserver.py index f9f77c9..68a684a 100644 --- a/wserver.py +++ b/wserver.py @@ -239,14 +239,15 @@ input[type="submit"]:hover, input[type="submit"]:focus{ }); }); + if(document.getElementsByTagName("ul").length >= 10){ var labels = document.querySelectorAll("label"); //Shorting the file/folder names labels.forEach(function (label) { - if (label.innerText.toString().split(" ").length != 4) { + if (label.innerText.toString().split(" ").length >= 6) { let FirstPart = label.innerText .toString() .split(" ") - .slice(0, 2) + .slice(0, 3) .join(" "); let SecondPart = label.innerText .toString() @@ -255,7 +256,21 @@ input[type="submit"]:hover, input[type="submit"]:focus{ .join(" "); label.innerText = `${FirstPart}... ${SecondPart}`; } + if (label.innerText.toString().split(".").length >= 6) { + let first = label.innerText + .toString() + .split(".") + .slice(0, 3) + .join(" "); + let second = label.innerText + .toString() + .split(".") + .splice(-3) + .join("."); + label.innerText = `${first}... ${second}`; + } }); + }