From: longpanda Date: Mon, 27 Jun 2022 11:42:18 +0000 (+0800) Subject: Auto remove the redundant trailing slash when set directory path on VentoyPlugson... X-Git-Tag: v1.0.78~4 X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/Ventoy.git/commitdiff_plain/598af7f45c8112321b10da3c38e70468e62ea6a6?ds=sidebyside Auto remove the redundant trailing slash when set directory path on VentoyPlugson page. --- diff --git a/Plugson/www/index.html b/Plugson/www/index.html index e6f5fd1..49ce8e6 100644 --- a/Plugson/www/index.html +++ b/Plugson/www/index.html @@ -743,10 +743,10 @@ - + - - + + diff --git a/Plugson/www/static/js/vtoy.js b/Plugson/www/static/js/vtoy.js index 283bf07..6871925 100644 --- a/Plugson/www/static/js/vtoy.js +++ b/Plugson/www/static/js/vtoy.js @@ -2,6 +2,13 @@ function ventoy_replace_slash(str) { var str1 = str.replace(/\\/g, '/'); var str2 = str1.replace(/\/\//g, '/'); + + if (str2 && str2.length > 0) { + if (str2.substr(-1) === "/") { + return str2.substr(0, str2.length - 1); + } + } + return str2; }