Added new window button

This commit is contained in:
Maxim Stewart 2020-03-26 19:29:05 -05:00
parent 5c3b0b0a05
commit 3edbf0ab70
6 changed files with 21 additions and 13 deletions

View File

@ -4,13 +4,12 @@ Search Firefox tabs and get a list or automatic direct to the searched tab.
# Download # Download
https://addons.mozilla.org/en-US/firefox/addon/tab-search-and-manage/ https://addons.mozilla.org/en-US/firefox/addon/tab-search-and-manage/
# Version: 1.3.5 # Version: 1.3.6
* Fixed search backspaceing not working * Added create new window button
* Fixed controls being over search bar
* applied thin scrollbar
***Note: ***Note:
To get tab hiding functionality, you must go to <b>about:config</b> and search for <b>extensions.webextensions.tabhide.enabled</b>. Set it to <b>true</b> by double clicking it. Then tabs can be shown or hidden via the eyes. To get tab hiding functionality, you must have Firefox 61. Then go to <b>about:config</b> and search for <b>extensions.webextensions.tabhide.enabled</b>. Set it to <b>true</b> by double clicking it. Then tabs can be shown or hidden via the eyes.
# Images # Images

BIN
src/icons/add-window.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1,7 +1,7 @@
{ {
"manifest_version": 2, "manifest_version": 2,
"name": "Tab Search and Manage", "name": "Tab Search and Manage",
"version": "1.3.5", "version": "1.3.6",
"description": "This plugin can search, drag-n-drop ordering, and (un)hide all or some tabs.", "description": "This plugin can search, drag-n-drop ordering, and (un)hide all or some tabs.",
"applications": { "applications": {

View File

@ -18,8 +18,9 @@
<input type="image" id="goTop" title="To Top" src="../icons/up-arrow.png" /> <input type="image" id="goTop" title="To Top" src="../icons/up-arrow.png" />
<input type="image" id="showAllBttn" title="Unhide All Tabs" src="../icons/eyeOpen.png" /> <input type="image" id="showAllBttn" title="Unhide All Tabs" src="../icons/eyeOpen.png" />
<input type="image" id="goToTab" title="Scroll Current Tab To View" src="../icons/go2-arrow.png" /> <input type="image" id="goToTab" title="Scroll Current Tab To View" src="../icons/go2-arrow.png" />
<input type="image" id="searchMode" searchwindowsmode="false" src="../icons/window.png" />
<input type="image" id="newTab" title="New Tab" src="../icons/plus.png" /> <input type="image" id="newTab" title="New Tab" src="../icons/plus.png" />
<input type="image" id="searchMode" searchwindowsmode="false" src="../icons/window.png" />
<input type="image" id="newWin" title="New Window" src="../icons/add-window.png" />
<input type="image" id="hideAllBttn" title="Hide All Tabs" src="../icons/eyeClosed.png"/> <input type="image" id="hideAllBttn" title="Hide All Tabs" src="../icons/eyeClosed.png"/>
<input type="image" id="goBottom" title="To Bottom" src="../icons/down-arrow.png"/> <input type="image" id="goBottom" title="To Bottom" src="../icons/down-arrow.png"/>
</div> </div>

View File

@ -23,6 +23,8 @@ document.addEventListener("click", (e) => {
scrollToView(200); scrollToView(200);
} else if (targetID == "newTab") { } else if (targetID == "newTab") {
createTab(); createTab();
} else if (targetID == "newWin") {
createWin();
} else if (targetID == "hideTgglBttn") { } else if (targetID == "hideTgglBttn") {
if (hoverTarget) { if (hoverTarget) {
hideSelectedTabAction(hoverTarget, hoverTarget.id); hideSelectedTabAction(hoverTarget, hoverTarget.id);

View File

@ -1,5 +1,6 @@
const storageArea = browser.storage.local; const storageArea = browser.storage.local;
const tabsAction = browser.tabs; const tabsAction = browser.tabs;
const windowsAction = browser.windows;
const searchBar = document.getElementById("searchBar"); const searchBar = document.getElementById("searchBar");
const errHandler = document.getElementById("errorZone"); const errHandler = document.getElementById("errorZone");
const listZone = document.getElementById("listZone"); const listZone = document.getElementById("listZone");
@ -94,22 +95,27 @@ function createTab() {
tabsAction.create({}) tabsAction.create({})
.then(function (tab) { .then(function (tab) {
createContainer(tab); createContainer(tab);
}) });
}
function createWin() {
windowsAction.create({});
} }
function moveTabControlTo(elm) { function moveTabControlTo(elm) {
let tabControls = document.getElementById("tabControls"); let tabControls = document.getElementById("tabControls");
let hideTgglBttn = tabControls.querySelector("#hideTgglBttn")
let rect = elm.getBoundingClientRect(); let rect = elm.getBoundingClientRect();
tabControls.style.left = (rect.left - 46) + "px"; tabControls.style.left = (rect.left - 46) + "px";
tabControls.style.top = rect.top + "px"; tabControls.style.top = rect.top + "px";
hoverTarget = elm; hoverTarget = elm;
if (elm.className == "block hiddenBGColor") if (elm.className == "block hiddenBGColor")
document.getElementById("tabControls").querySelector("#hideTgglBttn").src = "../icons/eyeClosed.png"; hideTgglBttn.src = "../icons/eyeClosed.png";
else else
document.getElementById("tabControls").querySelector("#hideTgglBttn").src = "../icons/eyeOpen.png"; hideTgglBttn.src = "../icons/eyeOpen.png";
document.getElementById("tabControls").style.display = ""; tabControls.style.display = "";
} }
function onError(error) { console.log(`Error: ${error}`); } function onError(error) { console.log(`Error: ${error}`); }