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
https://addons.mozilla.org/en-US/firefox/addon/tab-search-and-manage/
# Version: 1.3.5
* Fixed search backspaceing not working
* Fixed controls being over search bar
* applied thin scrollbar
# Version: 1.3.6
* Added create new window button
***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

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,
"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.",
"applications": {

View File

@ -18,8 +18,9 @@
<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="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="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="goBottom" title="To Bottom" src="../icons/down-arrow.png"/>
</div>

View File

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

View File

@ -1,5 +1,6 @@
const storageArea = browser.storage.local;
const tabsAction = browser.tabs;
const windowsAction = browser.windows;
const searchBar = document.getElementById("searchBar");
const errHandler = document.getElementById("errorZone");
const listZone = document.getElementById("listZone");
@ -94,22 +95,27 @@ function createTab() {
tabsAction.create({})
.then(function (tab) {
createContainer(tab);
})
});
}
function createWin() {
windowsAction.create({});
}
function moveTabControlTo(elm) {
let tabControls = document.getElementById("tabControls");
let rect = elm.getBoundingClientRect();
let tabControls = document.getElementById("tabControls");
let hideTgglBttn = tabControls.querySelector("#hideTgglBttn")
let rect = elm.getBoundingClientRect();
tabControls.style.left = (rect.left - 46) + "px";
tabControls.style.top = rect.top + "px";
hoverTarget = elm;
if (elm.className == "block hiddenBGColor")
document.getElementById("tabControls").querySelector("#hideTgglBttn").src = "../icons/eyeClosed.png";
hideTgglBttn.src = "../icons/eyeClosed.png";
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}`); }