diff --git a/Debug/addons/tabplus/script.js b/Debug/addons/tabplus/script.js
index d3182993..90d6dbd4 100644
--- a/Debug/addons/tabplus/script.js
+++ b/Debug/addons/tabplus/script.js
@@ -1,4 +1,4 @@
-const Addon_Id = "tabplus";
+const Addon_Id = "tabplus";
let item = GetAddonElement(Addon_Id);
if (!item.getAttribute("Set")) {
item.setAttribute("Icon", 1);
@@ -23,6 +23,19 @@ if (window.Addon == 1) {
tids: [],
nSelected: [],
+ IsWin10OrLater: async function () {
+ let appVer, res, osVer;
+ appVer = await navigator.appVersion.split(';');
+ if (appVer[2]) {
+ res = /^\s*Windows NT\s+(\d+\.\d+)/i.exec(appVer[2]);
+ if (res && res[1] && parseFloat(res[1]) >= 10) {
+ return 1;
+ }
+ }
+
+ return 0;
+ },
+
Arrange: async function (Id, bWait) {
delete Addons.TabPlus.tids[Id];
const o = document.getElementById("tabplus_" + Id);
@@ -36,6 +49,9 @@ if (window.Addon == 1) {
if (o.lastChild && Addons.TabPlus.opt.New) {
o.removeChild(o.lastChild);
}
+ if (o.lastChild && Addons.TabPlus.opt.CloseAll) {
+ o.removeChild(o.lastChild);
+ }
let nDisp = o.getElementsByTagName("li").length;
while (nDisp > nCount) {
o.removeChild(o.lastChild);
@@ -60,7 +76,15 @@ if (window.Addon == 1) {
if (Addons.TabPlus.opt.Align > 1 && Addons.TabPlus.opt.Width) {
s.push(' style="text-align: center; width: 100%"');
}
- s.push('>+');
+ s.push('>', Addons.TabPlus.ImgNewTab, '');
+ o.insertAdjacentHTML("beforeend", s.join(""));
+ }
+ if (Addons.TabPlus.opt.CloseAll) {
+ let s = ['
1 && Addons.TabPlus.opt.Width) {
+ s.push(' style="text-align: center; width: 100%"');
+ }
+ s.push('>', Addons.TabPlus.ImgCloseAll, '');
o.insertAdjacentHTML("beforeend", s.join(""));
}
Addons.TabPlus.SetActiveColor(Id);
@@ -109,6 +133,15 @@ if (window.Addon == 1) {
}
},
+ CloseAll: async function (Id) {
+ const TC = await te.Ctrl(CTRL_TC, Id);
+ if (TC) {
+ for (var i = TC.Count; i--;) {
+ TC[i].Close();
+ }
+ }
+ },
+
Style: async function (TC, i, bRedraw, wait) {
let r = await Promise.all([TC[i], TC.Id]);
const FV = r[0];
@@ -511,6 +544,11 @@ if (window.Addon == 1) {
$.importScript("addons\\" + Addon_Id + "\\sync.js");
+ let newTabImage = "font:Segoe UI Emoji,0x271a";
+ if (Addons.TabPlus.IsWin10OrLater()) {
+ newTabImage = "font:Segoe UI Symbol,0xe109";
+ }
+
AddEvent("PanelCreated", async function (Ctrl, Id) {
const s = ['
= 0) {
const item = items[i];
- SetData(g_x[mode][i], [item.getAttribute("Name"), item.text || item.textContent, item.getAttribute("Type"), item.getAttribute("Icon"), item.getAttribute("Height")]);
+ const values = [];
+ for (let index = 0; index < g_arFields.length; index++) {
+ if (index != 1) {
+ values.push(item.getAttribute(g_arFields[index]));
+ } else {
+ values.push(item.text || item.textContent);
+ }
+ }
+ if (arExtFields) {
+ for (let index = 0; index < arExtFields.length; index++) {
+ values.push(item.getAttribute(arExtFields[index]));
+ }
+ }
+
+ SetData(g_x[mode][i], values);
}
}
EnableSelectTag(g_x[mode]);
diff --git a/Debug/script/sync1.js b/Debug/script/sync1.js
index f3c0daa2..1b68f44b 100644
--- a/Debug/script/sync1.js
+++ b/Debug/script/sync1.js
@@ -1,4 +1,4 @@
-//Tablacus Explorer
+//Tablacus Explorer
te.ClearEvents();
te.About = AboutTE(2);
@@ -1288,6 +1288,27 @@ AddEvent("Refresh", function (Ctrl, pt) {
}
});
+InsertFavoriteItem = function (xml, menus, item, FolderItem, s) {
+ if (s) {
+ item.setAttribute("Name", s.replace(/\\/g, "/"));
+ item.setAttribute("Filter", "");
+ let path = api.GetDisplayNameOf(FolderItem, SHGDN_FORADDRESSBAR | SHGDN_FORPARSING | SHGDN_FORPARSINGEX);
+ if ("string" === typeof path) {
+ path = FolderItem.Path;
+ }
+ if (!FolderItem.Enum && fso.FileExists(path)) {
+ path = PathQuoteSpaces(path);
+ item.setAttribute("Type", "Exec");
+ } else {
+ item.setAttribute("Type", "Open");
+ }
+ item.text = path;
+ menus[0].appendChild(item);
+ SaveXmlEx("menus.xml", xml);
+ FavoriteChanged();
+ }
+}
+
AddFavorite = function (FolderItem) {
const xml = te.Data.xmlMenus;
const menus = xml.getElementsByTagName("Favorites");
@@ -1302,26 +1323,14 @@ AddFavorite = function (FolderItem) {
if (!FolderItem) {
return;
}
- InputDialog("Add Favorite", GetFolderItemName(FolderItem), function (s) {
- if (s) {
- item.setAttribute("Name", s.replace(/\\/g, "/"));
- item.setAttribute("Filter", "");
- let path = api.GetDisplayNameOf(FolderItem, SHGDN_FORADDRESSBAR | SHGDN_FORPARSING | SHGDN_FORPARSINGEX);
- if ("string" === typeof path) {
- path = FolderItem.Path;
- }
- if (!FolderItem.Enum && fso.FileExists(path)) {
- path = PathQuoteSpaces(path);
- item.setAttribute("Type", "Exec");
- } else {
- item.setAttribute("Type", "Open");
- }
- item.text = path;
- menus[0].appendChild(item);
- SaveXmlEx("menus.xml", xml);
- FavoriteChanged();
- }
- });
+
+ if (0) {
+ InputDialog("Add Favorite", GetFolderItemName(FolderItem), function (s) {
+ InsertFavoriteItem(xml, menus, item, FolderItem, s);
+ });
+ } else {
+ InsertFavoriteItem(xml, menus, item, FolderItem, GetFolderItemName(FolderItem));
+ }
}
}
@@ -1564,7 +1573,15 @@ AddEvent("Close", function (Ctrl) {
break;
case CTRL_SB:
case CTRL_EB:
- return CanClose(Ctrl) || api.ILIsEqual(Ctrl, "about:blank") && Ctrl.Parent.Count < 2 ? S_FALSE : CloseView(Ctrl);
+ // When the user closes the last tab, navigate to "This PC".
+ let retValue = CanClose(Ctrl);
+ if (retValue == S_OK && Ctrl.Parent.Count <= 1) {
+ retValue = (api.ILIsEqual(Ctrl, ssfDRIVES) || api.ILIsEqual(Ctrl, "about:blank")) ? S_FALSE : S_OK;
+ if (!api.ILIsEqual(Ctrl, ssfDRIVES)) {
+ Ctrl.Navigate(ssfDRIVES, SBSP_NEWBROWSER);
+ }
+ }
+ return retValue;
case CTRL_TC:
SetDisplay("Panel_" + Ctrl.Id, "none");
break;