From 644940932e5be5a8110d82417073d4eff755e2ea Mon Sep 17 00:00:00 2001 From: Gaku Date: Tue, 8 Oct 2024 22:03:38 +0900 Subject: [PATCH] 24.10.8 Some fix --- Debug/script/sync.js | 19 +++++-------------- Debug/script/sync1.js | 2 +- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Debug/script/sync.js b/Debug/script/sync.js index cf9cbff..02e76f9 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 < 20240616 ? te.Version : 20241007; + return te.Version < 20240616 ? te.Version : 20241008; } if (n == 1) { const v = AboutTE(0); @@ -479,16 +479,6 @@ OrganizePath = function (fn, base) { return fn; } -SelectedParent = function (path) { - if ("string" !== typeof path) { - if (!path || !path.Count) { - return; - } - path = path.Item(0).Path; - } - return /^[A-Z]:\\.+?\\|^\\\\.+?\\/i.test(path) ? GetParentFolderName(path) : null; -} - OpenAdodbFromTextFile = function (fn, charset, base) { fn = OrganizePath(fn, base || te.Data.Installed); const ado = api.CreateObject("ads"); @@ -2239,7 +2229,7 @@ IsFolderEx = function (Item) { if (Item.IsFolder && !api.ILIsParent(ssfBITBUCKET, Item, true)) { const wfd = api.Memory("WIN32_FIND_DATA"); const hr = api.SHGetDataFromIDList(Item, SHGDFIL_FINDDATA, wfd, wfd.Size); - return (hr < 0) || (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0 || !/^[A-Z]:\\|^\\\\\w.*\\.*\\/i.test(Item.Path); + return (hr < 0) || (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0 || !/^[A-Z]:\\|^\\\\\w.*\\.*\\/i.test(Item.Path) || !Item.IsFileSystem; } if (/^ftp:|^https?:/i.test(Item.Path)) { return Item.IsFolder; @@ -2582,7 +2572,8 @@ ExecMenu4 = function (Ctrl, Name, pt, hMenu, arContextMenu, nVerb, FV) { } } } - if (ContextMenu.InvokeCommand(0, te.hwnd, nVerb - ContextMenu.idCmdFirst, null, SelectedParent(ContextMenu.Items()), SW_SHOWNORMAL, 0, 0) == S_OK) { + const Items = ContextMenu.Items(); + if (ContextMenu.InvokeCommand(0, te.hwnd, nVerb - ContextMenu.idCmdFirst, null, Items ? Items.Item(-1).Path : null, SW_SHOWNORMAL, 0, 0) == S_OK) { api.DestroyMenu(hMenu); return S_OK; } @@ -3231,7 +3222,7 @@ PopupContextMenu = function (Item, FV, pt) { } const nVerb = api.TrackPopupMenuEx(hMenu, TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, te.hwnd, null, ContextMenu); if (nVerb) { - ContextMenu.InvokeCommand(0, te.hwnd, nVerb - 1, null, SelectedParent(Item), SW_SHOWNORMAL, 0, 0); + ContextMenu.InvokeCommand(0, te.hwnd, nVerb - 1, null, Item.Item(-1).Path, SW_SHOWNORMAL, 0, 0); } } api.DestroyMenu(hMenu); diff --git a/Debug/script/sync1.js b/Debug/script/sync1.js index e62355b..330d281 100644 --- a/Debug/script/sync1.js +++ b/Debug/script/sync1.js @@ -2294,7 +2294,7 @@ te.OnDefaultCommand = function (Ctrl) { return S_OK; } } - return InvokeCommand(Selected, 0, te.hwnd, null, null, SelectedParent(path), SW_SHOWNORMAL, 0, 0, Ctrl, CMF_DEFAULTONLY); + return InvokeCommand(Selected, 0, te.hwnd, null, null, Selected.Item(-1).Path, SW_SHOWNORMAL, 0, 0, Ctrl, CMF_DEFAULTONLY); } return S_FALSE; }