Skip to content

Commit

Permalink
24.2.7 Some fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tablacus committed Feb 7, 2024
1 parent 5ac513e commit 25a07c6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 43 deletions.
60 changes: 28 additions & 32 deletions Debug/script/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -782,15 +782,13 @@ function MoveX(mode, n) {
async function CreateMenuX(mode) {
const sel = g_x[mode];
if (sel && sel.selectedIndex >= 0) {
InputDialog((await Promise.all([GetText("Menus"), GetText("Name")])).join("\n"), "", "callback_CreateMenuX", mode);
}
}

async function callback_CreateMenuX(sName, mode) {
WebBrowser.Focus();
if (sName) {
const sOrg = (await api.GetKeyState(VK_SHIFT) >= 0) ? "1" : "";
CreateMenu(mode, sName, sOrg);
InputDialog((await Promise.all([GetText("Menus"), GetText("Name")])).join("\n"), "", async function (sName, mode) {
WebBrowser.Focus();
if (sName) {
const sOrg = (await api.GetKeyState(VK_SHIFT) >= 0) ? "1" : "";
CreateMenu(mode, sName, sOrg);
}
}, mode);
}
}

Expand Down Expand Up @@ -1578,32 +1576,30 @@ OpenIcon = function (o) {

async function SearchIcon(o) {
document.F.ButtonSearch.disabled = true;
InputDialog(system32, "*.exe;*.cpl", "callback_SearchIcon", o.id)
}

async function callback_SearchIcon (sFilter, id1) {
WebBrowser.Focus();
if (sFilter) {
if (!/^[A-Z]:\\|^\\\\/i.test(sFilter)) {
dllPath = BuildPath(system32, sFilter);
}
const eFN = document.getElementById("footnote");
const str = await GetTextR("@shell32.dll,-13581");
eFN.innerHTML = str;
for (let fn, FileList = await GetFileList(BuildPath(system32, sFilter), false, window.chrome); fn = FileList.shift();) {
eFN.innerText = str + " " + FileList.length;
const nCount = await api.ExtractIconEx(BuildPath(system32, fn), -1, null, null, 0);
if (nCount) {
const id = "i," + fn.toLowerCase();
if (!document.getElementById(id)) {
document.getElementById(id1).insertAdjacentHTML("beforeend", '<div id="' + id + '" onclick="OpenIcon(this)" style="cursor: pointer"><span class="tab">' + fn + ' : ' + nCount + '</span></div>');
document.getElementById(id).scrollIntoView(false);
InputDialog(system32, "*.exe;*.cpl", async function(sFilter, id1) {
WebBrowser.Focus();
if (sFilter) {
if (!/^[A-Z]:\\|^\\\\/i.test(sFilter)) {
dllPath = BuildPath(system32, sFilter);
}
const eFN = document.getElementById("footnote");
const str = await GetTextR("@shell32.dll,-13581");
eFN.innerHTML = str;
for (let fn, FileList = await GetFileList(BuildPath(system32, sFilter), false, window.chrome); fn = FileList.shift();) {
eFN.innerText = str + " " + FileList.length;
const nCount = await api.ExtractIconEx(BuildPath(system32, fn), -1, null, null, 0);
if (nCount) {
const id = "i," + fn.toLowerCase();
if (!document.getElementById(id)) {
document.getElementById(id1).insertAdjacentHTML("beforeend", '<div id="' + id + '" onclick="OpenIcon(this)" style="cursor: pointer"><span class="tab">' + fn + ' : ' + nCount + '</span></div>');
document.getElementById(id).scrollIntoView(false);
}
}
}
eFN.innerText = "";
}
eFN.innerText = "";
}
document.F.ButtonSearch.disabled = false;
document.F.ButtonSearch.disabled = false;
}, o.id)
}

ReturnDialogResult = async function (WB) {
Expand Down
8 changes: 2 additions & 6 deletions Debug/script/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ g_.IconChg = [

AboutTE = function (n) {
if (n == 0) {
return te.Version < 20240206 ? te.Version : 20240206;
return te.Version < 20240206 ? te.Version : 20240207;
}
if (n == 1) {
const v = AboutTE(0);
Expand Down Expand Up @@ -3343,11 +3343,7 @@ InputDialog = function (text, defaultText, cb, data) {
if (eo && eo.length) {
const r = InvokeFunc(eo[0], [text, defaultText]);
if (cb) {
if ("string" === typeof cb) {
setTimeout(InvokeUI, 9, cb, r, data);
} else {
setTimeout(cb, 9, r, data);
}
InvokeFunc(cb, [r, data]);
return;
}
return r;
Expand Down
9 changes: 4 additions & 5 deletions Debug/script/sync1.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ te.ClearEvents();
te.About = AboutTE(2);
Init = false;
g_arBM = [];
g_tmWindowRegistered = -1;

GetAddress = null;
ShowContextMenu = null;
Expand Down Expand Up @@ -2838,8 +2837,10 @@ g_.event.handleicon = function (Ctrl, pid, iItem) {
}

g_.event.windowregistered = function (Ctrl) {
if (g_tmWindowRegistered > 0 && new Date().getTime() > g_tmWindowRegistered) {
if (!g_.tmWindowRegistered || new Date().getTime() > g_.tmWindowRegistered) {
RunEvent1("WindowRegistered", Ctrl);
} else {
g_.tmWindowRegistered = void 0;
}
}

Expand Down Expand Up @@ -3019,9 +3020,7 @@ KeyExecEx = function (Ctrl, mode, nKey, hwnd) {
}

CancelWindowRegistered = function () {
if (g_tmWindowRegistered > 0) {
g_tmWindowRegistered = new Date().getTime() + 3000;
}
g_.tmWindowRegistered = new Date().getTime() + 9999;
}

importScripts = function () {
Expand Down

0 comments on commit 25a07c6

Please sign in to comment.