Changed new tab workings.
|
@ -4,11 +4,8 @@ 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-smarter/
|
https://addons.mozilla.org/en-US/firefox/addon/tab-search-smarter/
|
||||||
|
|
||||||
# Version: 1.1.8
|
# Version: 1.2.0
|
||||||
Added To Top, To Tab, and To Bottom buttons.
|
Changed how new-tab works in the plugin...
|
||||||
Added New Tab button in tab list
|
|
||||||
Added visual indicator of currently selected tab
|
|
||||||
Set initial scroll to go to selected tab
|
|
||||||
|
|
||||||
|
|
||||||
# Images
|
# Images
|
||||||
|
|
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 5.0 KiB |
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 5.4 KiB |
After Width: | Height: | Size: 420 B |
After Width: | Height: | Size: 446 B |
After Width: | Height: | Size: 4.4 KiB |
BIN
src/icons/x.png
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 6.7 KiB |
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "Tab Search",
|
"name": "Tab Search",
|
||||||
"version": "1.1.8",
|
"version": "1.2.0",
|
||||||
"description": "Search Tabs and switch to them quickly.",
|
"description": "Search Tabs and switch to them quickly.",
|
||||||
|
|
||||||
"applications": {
|
"applications": {
|
||||||
|
|
|
@ -15,9 +15,18 @@
|
||||||
<div id="errorZone" style="display: none;"></div>
|
<div id="errorZone" style="display: none;"></div>
|
||||||
|
|
||||||
<div id="udArrows">
|
<div id="udArrows">
|
||||||
<button id="goTop" type="button" title="To Top">⋀</button>
|
<button id="goTop" type="button" title="To Top">
|
||||||
<button id="goToTab" type="button" title="Scroll Current Tab To View">—</button>
|
<img style="width:1em; height:1em;" src="../icons/up-arrow.png"/>
|
||||||
<button id="goBottom" type="button" title="To Bottom">⋁</button>
|
</button>
|
||||||
|
<button id="goToTab" type="button" title="Scroll Current Tab To View">
|
||||||
|
<img style="width:1em; height:1em;" src="../icons/go2-arrow.png"/>
|
||||||
|
</button>
|
||||||
|
<button id="newTab" type="button" title="New Tab">
|
||||||
|
<img style="width:1em; height:1em;" src="../icons/plus.png"/>
|
||||||
|
</button>
|
||||||
|
<button id="goBottom" type="button" title="To Bottom">
|
||||||
|
<img style="width:1em; height:1em;" src="../icons/down-arrow.png"/>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Set click events
|
// Set click events for tab blocks
|
||||||
document.addEventListener("click", (e) => {
|
document.addEventListener("click", (e) => {
|
||||||
var target = e.target;
|
var target = e.target;
|
||||||
var targetID = target.id;
|
var targetID = target.id;
|
||||||
|
@ -15,12 +15,12 @@ document.addEventListener("click", (e) => {
|
||||||
if (targetID == "faveIcon")
|
if (targetID == "faveIcon")
|
||||||
target = parentElm.parentElement;
|
target = parentElm.parentElement;
|
||||||
|
|
||||||
|
id = parseInt(target.getAttribute("tabID"));
|
||||||
|
browser.tabs.update(id, { active: true });
|
||||||
|
|
||||||
oldElm.setAttribute("class", "block");
|
oldElm.setAttribute("class", "block");
|
||||||
oldElm = target;
|
oldElm = target;
|
||||||
target.setAttribute("class", "block block-focused");
|
target.setAttribute("class", "block block-focused");
|
||||||
|
|
||||||
id = parseInt(target.getAttribute("tabID"));
|
|
||||||
browser.tabs.update(id, { active: true });
|
|
||||||
} else if (targetID == "goTop") {
|
} else if (targetID == "goTop") {
|
||||||
window.scrollTo(0,0);
|
window.scrollTo(0,0);
|
||||||
} else if (targetID == "goBottom") {
|
} else if (targetID == "goBottom") {
|
||||||
|
@ -29,6 +29,8 @@ document.addEventListener("click", (e) => {
|
||||||
// Go to selected and 100px up
|
// Go to selected and 100px up
|
||||||
oldElm.scrollIntoView();
|
oldElm.scrollIntoView();
|
||||||
window.scrollBy(0, -100);
|
window.scrollBy(0, -100);
|
||||||
|
} else if (targetID == "newTab") {
|
||||||
|
createTab();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ function logTabs(tabs) {
|
||||||
for (let tab of tabs) {
|
for (let tab of tabs) {
|
||||||
createContainer(tab);
|
createContainer(tab);
|
||||||
}
|
}
|
||||||
addPlusContainer();
|
|
||||||
// Set poped-out-window position and 100px up from selected elm
|
// Set poped-out-window position and 100px up from selected elm
|
||||||
oldElm.scrollIntoView();
|
oldElm.scrollIntoView();
|
||||||
window.scrollBy(0, -100);
|
window.scrollBy(0, -100);
|
||||||
|
@ -53,23 +52,6 @@ function createContainer(tab) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function addPlusContainer() {
|
|
||||||
var spanTag = document.createElement("SPAN");
|
|
||||||
var centerTag = document.createElement("CENTER");
|
|
||||||
var icoImgTag = document.createElement("IMG");
|
|
||||||
|
|
||||||
spanTag .addEventListener("click", createTab);
|
|
||||||
spanTag.title = "Open a new tab...";
|
|
||||||
spanTag.className = "block";
|
|
||||||
icoImgTag.style = "width: 100%; height:auto";
|
|
||||||
icoImgTag.src = "../icons/plus.png";
|
|
||||||
|
|
||||||
centerTag.appendChild(icoImgTag);
|
|
||||||
spanTag.appendChild(centerTag);
|
|
||||||
listZone.appendChild(spanTag);
|
|
||||||
plusTag = spanTag;
|
|
||||||
}
|
|
||||||
|
|
||||||
function createTab() {
|
function createTab() {
|
||||||
tabsAction.create({})
|
tabsAction.create({})
|
||||||
.then(function (tab) {
|
.then(function (tab) {
|
||||||
|
|