Skip to content

Commit

Permalink
1.16.1
Browse files Browse the repository at this point in the history
Align icons in Omnibar
  • Loading branch information
brookhong committed Jan 13, 2024
1 parent 08f3db7 commit f821819
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Surfingkeys",
"version": "1.16.0",
"version": "1.16.1",
"description": "Map your keys for web surfing, expand your browser with javascript and keyboard.",
"main": "background.js",
"directories": {
Expand Down
12 changes: 5 additions & 7 deletions src/content_scripts/ui/frontend.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ body {
}
#sk_omnibarSearchResult>ul>li {
padding: 0.2rem 0rem;
display: block;
display: flex;
align-items: center;
max-height: 600px;
overflow-x: hidden;
overflow-y: auto;
Expand All @@ -138,12 +139,9 @@ body {
vertical-align: middle;
display: table-cell;
}
#sk_omnibarSearchResult li.tab {
display: flex;
align-items: flex-start;
}
#sk_omnibarSearchResult li.tab img {
margin-right: 0.5rem;
#sk_omnibarSearchResult li .icon {
margin-right: 0.5rem;
width: 16px;
}
#sk_omnibarSearchResult li div.title {
text-align: left;
Expand Down
13 changes: 6 additions & 7 deletions src/content_scripts/ui/omnibar.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,18 +405,17 @@ function createOmnibar(front, clipboard) {
} else if(b.hasOwnProperty('width')) {
type = "🔖";
uid = "T" + b.windowId + ":" + b.id;
// } else if(b.type && /^\p{Emoji}$/u.test(b.type)) {
// } else if(b.type && /^\p{Emoji}$/u.test(b.type)) {
} else if(b.type && b.type.length === 2 && b.type.charCodeAt(0) > 255) {
type = b.type;
}
var li = createElementWithContent('li', `<div class="icon">${type}</div>`);
if (b.hasOwnProperty('favIconUrl')) {
var li = createElementWithContent('li',
`<img/><div class="text-container"><div class="title">${self.highlight(rxp, htmlEncode(b.title))} ${additional}</div><div class="url">${self.highlight(rxp, htmlEncode(safeDecodeURIComponent(b.url)))}</div></div>`, { "class": "tab" });
attachFaviconToImgSrc(b, li.querySelector('img'));
} else {
var li = createElementWithContent('li',
`<div class="title">${type} ${self.highlight(rxp, htmlEncode(b.title))} ${additional}</div><div class="url">${self.highlight(rxp, htmlEncode(safeDecodeURIComponent(b.url)))}</div>`);
li = createElementWithContent('li', `<img class="icon"/>`);
attachFaviconToImgSrc(b, li.querySelector('img'));
}
li.appendChild(createElementWithContent('div',
`<div class="title">${self.highlight(rxp, htmlEncode(b.title))} ${additional}</div><div class="url">${self.highlight(rxp, htmlEncode(safeDecodeURIComponent(b.url)))}</div>`, { "class": "text-container" }));
li.uid = uid;
li.url = b.url;
return li;
Expand Down

0 comments on commit f821819

Please sign in to comment.