diff --git a/README.md b/README.md index 54f7af0..3c8b55c 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,8 @@ 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-smarter/ -# Version: 1.1.8 -Added To Top, To Tab, and To Bottom buttons. -Added New Tab button in tab list -Added visual indicator of currently selected tab -Set initial scroll to go to selected tab +# Version: 1.2.0 +Changed how new-tab works in the plugin... # Images diff --git a/src/icons/down-arrow.png b/src/icons/down-arrow.png new file mode 100644 index 0000000..32cb984 Binary files /dev/null and b/src/icons/down-arrow.png differ diff --git a/src/icons/go2-arrow.png b/src/icons/go2-arrow.png new file mode 100644 index 0000000..b67fe01 Binary files /dev/null and b/src/icons/go2-arrow.png differ diff --git a/src/icons/plus.png b/src/icons/plus.png index 6bd00fd..92dd529 100644 Binary files a/src/icons/plus.png and b/src/icons/plus.png differ diff --git a/src/icons/tab.png b/src/icons/tab.png index 353a4ed..b5231de 100644 Binary files a/src/icons/tab.png and b/src/icons/tab.png differ diff --git a/src/icons/tabsGroups_48.png b/src/icons/tabsGroups_48.png new file mode 100644 index 0000000..80477b9 Binary files /dev/null and b/src/icons/tabsGroups_48.png differ diff --git a/src/icons/tabsGroups_96.png b/src/icons/tabsGroups_96.png new file mode 100644 index 0000000..7723eb3 Binary files /dev/null and b/src/icons/tabsGroups_96.png differ diff --git a/src/icons/up-arrow.png b/src/icons/up-arrow.png new file mode 100644 index 0000000..c54b456 Binary files /dev/null and b/src/icons/up-arrow.png differ diff --git a/src/icons/x.png b/src/icons/x.png index 557b3e2..a69ff6a 100644 Binary files a/src/icons/x.png and b/src/icons/x.png differ diff --git a/src/manifest.json b/src/manifest.json index 56c2ee2..944e4de 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "Tab Search", - "version": "1.1.8", + "version": "1.2.0", "description": "Search Tabs and switch to them quickly.", "applications": { diff --git a/src/pages/tabsSearch.html b/src/pages/tabsSearch.html index 6ba1777..9b2ce3c 100755 --- a/src/pages/tabsSearch.html +++ b/src/pages/tabsSearch.html @@ -15,9 +15,18 @@
- - - + + + +
diff --git a/src/scripts/eventListeners.js b/src/scripts/eventListeners.js index 4430f6f..ced42f4 100644 --- a/src/scripts/eventListeners.js +++ b/src/scripts/eventListeners.js @@ -1,4 +1,4 @@ -// Set click events +// Set click events for tab blocks document.addEventListener("click", (e) => { var target = e.target; var targetID = target.id; @@ -15,12 +15,12 @@ document.addEventListener("click", (e) => { if (targetID == "faveIcon") target = parentElm.parentElement; + id = parseInt(target.getAttribute("tabID")); + browser.tabs.update(id, { active: true }); + oldElm.setAttribute("class", "block"); oldElm = target; target.setAttribute("class", "block block-focused"); - - id = parseInt(target.getAttribute("tabID")); - browser.tabs.update(id, { active: true }); } else if (targetID == "goTop") { window.scrollTo(0,0); } else if (targetID == "goBottom") { @@ -29,6 +29,8 @@ document.addEventListener("click", (e) => { // Go to selected and 100px up oldElm.scrollIntoView(); window.scrollBy(0, -100); + } else if (targetID == "newTab") { + createTab(); } }); diff --git a/src/scripts/generateView.js b/src/scripts/generateView.js index 2d592a3..1af34f4 100644 --- a/src/scripts/generateView.js +++ b/src/scripts/generateView.js @@ -11,7 +11,6 @@ function logTabs(tabs) { for (let tab of tabs) { createContainer(tab); } - addPlusContainer(); // Set poped-out-window position and 100px up from selected elm oldElm.scrollIntoView(); 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() { tabsAction.create({}) .then(function (tab) {