Add favicons and verious styling fixes
This commit is contained in:
parent
2395418be2
commit
9f751fa2ad
|
@ -19,3 +19,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
------
|
||||
|
||||
img/default-favicon.png is Copyright (c) Google Inc.
|
BIN
img/default-favicon.png
Normal file
BIN
img/default-favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 231 B |
34
popup.css
34
popup.css
|
@ -11,10 +11,32 @@ body{
|
|||
ul#windows{
|
||||
max-height:600px;
|
||||
}
|
||||
.tab{
|
||||
background-color:#FFFFFF;
|
||||
ul.tabs{
|
||||
padding-left: .875em;
|
||||
}
|
||||
.tab:hover{
|
||||
li.tab{
|
||||
list-style: none;
|
||||
background-color:#FFFFFF;
|
||||
background-repeat: no-repeat;
|
||||
background-position-y: 3px;
|
||||
background-size: 16px 16px;
|
||||
padding-left: 18px;
|
||||
padding-top: 3px;
|
||||
padding-bottom: 3px;
|
||||
margin-left: 0px;
|
||||
}
|
||||
li.tab > span.tabName{
|
||||
width:400px;
|
||||
display:inline-block;
|
||||
text-overflow: ellipsis;
|
||||
overflow-x: hidden;
|
||||
white-space: nowrap;
|
||||
padding-right: 10px;
|
||||
max-width: 100%;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
}
|
||||
li.tab:hover{
|
||||
background-color:#B3B3B3;
|
||||
}
|
||||
.noselect {
|
||||
|
@ -23,10 +45,12 @@ ul#windows{
|
|||
cursor: pointer;
|
||||
}
|
||||
i.close{
|
||||
padding-left: 5px;
|
||||
position:absolute;
|
||||
top:3px;
|
||||
right:5px;
|
||||
font-size: 12px;
|
||||
color:#000;
|
||||
}
|
||||
i.close:hover{
|
||||
padding-left: 5px;
|
||||
color:#E53935
|
||||
}
|
10
popup.js
10
popup.js
|
@ -7,6 +7,7 @@ function getWindows(windowList,callback){
|
|||
var ul = document.createElement("ul");
|
||||
li.classList.add("window");
|
||||
li.classList.add("noselect");
|
||||
ul.classList.add("tabs");
|
||||
li.textContent="Window "+(i+1)+" - "+tabs.length+ (tabs.length>1 ? " tabs":" tab");
|
||||
tabs.forEach(function(currentTab){
|
||||
ul.appendChild(currentTab);
|
||||
|
@ -26,10 +27,13 @@ function getTabs(windowId,callback){
|
|||
tabs.forEach(function(currentTab){
|
||||
var li = document.createElement("li");
|
||||
var closeButton = document.createElement("i");
|
||||
var favicon = document.createElement("img");
|
||||
var textSpan = document.createElement("span");
|
||||
closeButton.classList.add("fa");
|
||||
closeButton.classList.add("fa-remove");
|
||||
closeButton.classList.add("close");
|
||||
closeButton.classList.add("noselect");
|
||||
textSpan.classList.add("tabName")
|
||||
closeButton.onclick = function(event){
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
@ -47,8 +51,10 @@ function getTabs(windowId,callback){
|
|||
});
|
||||
}
|
||||
li.classList.add("tab");
|
||||
li.textContent=currentTab.title;
|
||||
li.appendChild(closeButton);
|
||||
li.style.backgroundImage = "url(\'"+(currentTab.favIconUrl!==undefined && currentTab.favIconUrl!==null ? currentTab.favIconUrl:"img/default-favicon.png")+"\')"
|
||||
textSpan.textContent=currentTab.title;
|
||||
li.appendChild(textSpan);
|
||||
textSpan.appendChild(closeButton);
|
||||
windowTabs.push(li);
|
||||
});
|
||||
callback(windowTabs);
|
||||
|
|
Loading…
Reference in a new issue