From 7a705fbaae9ddf11f1e7ec8fd7a81e46eb3d8092 Mon Sep 17 00:00:00 2001 From: pengfeng05 Date: Thu, 20 May 2021 00:19:40 +0800 Subject: [PATCH] =?UTF-8?q?style:=E5=88=9D=E6=AD=A5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/popup.js | 20 +++++++-------- assets/srch-res.css | 25 +++++++++++++------ manifest.json | 4 +-- srch-res.html | 3 ++- ...47\277\274\346\235\200\346\211\2132049.md" | 24 ------------------ 5 files changed, 30 insertions(+), 46 deletions(-) delete mode 100644 "\351\223\266\347\277\274\346\235\200\346\211\2132049.md" diff --git a/assets/popup.js b/assets/popup.js index a01fdf8..0a9af0c 100644 --- a/assets/popup.js +++ b/assets/popup.js @@ -25,24 +25,22 @@ function initDisplay() { } function judgeGo(){ - var word = $("#keyword").val().trim(); - if(word == "" && $("#keyword").hasClass("wait")){ + var word = $("#keyword").val().trim(); + if(word == "" && $("#keyword").hasClass("wait")){ alert("Please enter keywords first."); return; } initDisplay(); + if(word == "") { + return; + } goSearching(word.toUpperCase()); } +// no btn needed function goSearching(word) { - let changeColor = document.getElementById("seach-tabs"); - - // 一旦变绿直接变绿 8D /xs - changeColor.style.backgroundColor = "lightgreen"; - queryTabs(word); } - document.getElementById("seach-tabs").addEventListener("click", judgeGo); document.onkeydown=keyListener; @@ -64,13 +62,13 @@ function goSearching(word) { function queryTabs(keywords) { let tabs = []; traverseTabsOfCurWindow(function (tab) { - if (tab.title.toUpperCase().indexOf(keywords) != -1 - || tab.url.toUpperCase().indexOf(keywords) != -1 + if ((tab.title && tab.title.toUpperCase().indexOf(keywords) != -1) + || (tab.url && tab.url.toUpperCase().indexOf(keywords) != -1) || (tab.pendingUrl && tab.pendingUrl.toUpperCase().indexOf(keywords) != -1)) { tabs.push(tab); } }, function () { - $(".container").append('
Results in tabs:
'); + $(".container").append('
'); for (let j in tabs) { let tab = tabs[j]; $('.tab-result').append('

' + tab.title + '

'); diff --git a/assets/srch-res.css b/assets/srch-res.css index 521327e..3220557 100644 --- a/assets/srch-res.css +++ b/assets/srch-res.css @@ -1,8 +1,17 @@ -button { - height: 30px; - width: 30px; - outline: none; - margin: 10px; - border: ridge; - border-radius: 4px; - } \ No newline at end of file +input{ + outline-style: none ; + border: 1px solid #ccc; + border-radius: 3px; + padding: 13px 14px; + width: 180px; + font-size: 10px; + font-weight: 666; + font-family: "Microsoft soft"; +} + +input:focus{ + border-color: #66afe9; + outline: 0; + -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6); + box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6) +} \ No newline at end of file diff --git a/manifest.json b/manifest.json index baf9f52..aaacab6 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "Where is my tab ?", - "description": "Search for tabs in the opened window, may can also search for bookmarks and history in future versions.", - "version": "1.2", + "description": "Search for tabs in the opened window, can also increase your speed of switching tabs.", + "version": "1.3", "manifest_version": 3, "permissions": [ "tabs","commands","windows" diff --git a/srch-res.html b/srch-res.html index 56ad5be..925c072 100644 --- a/srch-res.html +++ b/srch-res.html @@ -8,7 +8,8 @@

Where is my tab ?

- + +