diff --git a/Debug/script/common.js b/Debug/script/common.js index e485162..88b65a1 100644 --- a/Debug/script/common.js +++ b/Debug/script/common.js @@ -475,6 +475,12 @@ if (!String.fromCodePoint) { } } +if (!String.prototype.trim) { + String.prototype.trim = function () { + return this.replace(/^\s+|\s+$/g, ""); + } +} + if (!Array.isArray) { Array.isArray = function (arg) { return Object.prototype.toString.call(arg) === '[object Array]'; diff --git a/Debug/script/options.js b/Debug/script/options.js index acc7a3e..4d4bf3b 100644 --- a/Debug/script/options.js +++ b/Debug/script/options.js @@ -1753,7 +1753,7 @@ InitDialog = async function () { let path = document.F.path.value; if (path) { if (!/^[A-Z]:\\|^\\/i.test(path)) { - path = BuildPath(ui_.ArgPath, path.replace(/^\s+/, "")); + path = BuildPath(ui_.ArgPath, path.trim()); } if (GetElement("folder").checked) { MainWindow.CreateFolder(path); diff --git a/Debug/script/sync.js b/Debug/script/sync.js index cfc22d5..a8a2d41 100644 --- a/Debug/script/sync.js +++ b/Debug/script/sync.js @@ -67,7 +67,7 @@ g_.Notify = {}; AboutTE = function (n) { if (n == 0) { - return te.Version < 20240511 ? te.Version : 20240511; + return te.Version < 20240511 ? te.Version : 20240530; } if (n == 1) { const v = AboutTE(0); @@ -1741,7 +1741,7 @@ NavigateFV = function (FV, Path, wFlags, bInputed) { FV = TC.Selected; } if ("string" === typeof Path) { - Path = ExtractMacro(FV, Path).replace(/^\s+|\s*$/g, ""); + Path = ExtractMacro(FV, Path).trim(); if (/\?|\*/.test(Path)) { if (!/\\\\\?\\|:/.test(Path)) { SetFilterView(FV, Path); @@ -2052,7 +2052,7 @@ FormatDate = function (s) { Navigate2 = function (path, NewTab) { const a = path.toString().split("\n"); for (let i in a) { - const s = a[i].replace(/^\s+/, ""); + const s = a[i].trim(); if (s != "") { Navigate(s, NewTab); NewTab |= SBSP_NEWBROWSER;