Skip to content

Commit

Permalink
24.5.30 Some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tablacus committed May 30, 2024
1 parent 61fe0b0 commit 5dfff6d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Debug/script/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]';
Expand Down
2 changes: 1 addition & 1 deletion Debug/script/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions Debug/script/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 5dfff6d

Please sign in to comment.