mirror of https://github.com/gorhill/uBlock.git
[mv3] Move hostname label to top of popup panel
Related commit in uBO:
- b8cfa382e8
Additionally, render internationalized domain names in pretty Unicode
instead of ugly punycode.
This commit is contained in:
parent
5874312b35
commit
f282b43550
|
@ -51,9 +51,9 @@
|
||||||
"message": "Privacy policy",
|
"message": "Privacy policy",
|
||||||
"description": "Link to privacy policy on GitHub (English)"
|
"description": "Link to privacy policy on GitHub (English)"
|
||||||
},
|
},
|
||||||
"popupPowerSwitchInfo": {
|
"popupFilteringModeLabel": {
|
||||||
"message": "Disable/enable uBO Lite for this site",
|
"message": "filtering mode",
|
||||||
"description": "Tooltip for the main power button in the popup panel"
|
"description": "Label in the popup panel for the current filtering mode"
|
||||||
},
|
},
|
||||||
"popupTipDashboard": {
|
"popupTipDashboard": {
|
||||||
"message": "Open the dashboard",
|
"message": "Open the dashboard",
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
<div class="li"><span><a href="https://github.com/chrismsimpson/Metropolis" target="_blank">Metropolis font family</a> by <a href="https://github.com/chrismsimpson">Chris Simpson</a></span></div>
|
<div class="li"><span><a href="https://github.com/chrismsimpson/Metropolis" target="_blank">Metropolis font family</a> by <a href="https://github.com/chrismsimpson">Chris Simpson</a></span></div>
|
||||||
<div class="li"><span><a href="https://github.com/rsms/inter" target="_blank">Inter font family</a> by <a href="https://github.com/rsms">Rasmus Andersson</a></span></div>
|
<div class="li"><span><a href="https://github.com/rsms/inter" target="_blank">Inter font family</a> by <a href="https://github.com/rsms">Rasmus Andersson</a></span></div>
|
||||||
<div class="li"><span><a href="https://fontawesome.com/" target="_blank">FontAwesome font family</a> by <a href="https://github.com/davegandy">Dave Gandy</a></span></div>
|
<div class="li"><span><a href="https://fontawesome.com/" target="_blank">FontAwesome font family</a> by <a href="https://github.com/davegandy">Dave Gandy</a></span></div>
|
||||||
|
<div class="li"><span><a href="https://github.com/mathiasbynens/punycode.js" target="_blank">Punycode.js</a> by <a href="https://github.com/mathiasbynens">Mathias Bynens</a></span></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,8 @@ a {
|
||||||
|
|
||||||
#main {
|
#main {
|
||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
max-width: 340px;
|
max-width: 340px;
|
||||||
min-width: var(--popup-main-min-width);
|
min-width: var(--popup-main-min-width);
|
||||||
}
|
}
|
||||||
|
@ -47,13 +49,33 @@ hr {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#filteringModeText {
|
#hostname {
|
||||||
background-color: var(--surface-2);
|
align-items: center;
|
||||||
color: var(--ink-3);
|
background-color: var(--popup-toolbar-surface);
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: var(--default-gap-xsmall);
|
justify-content: center;
|
||||||
|
min-height: calc(var(--font-size) * 3);
|
||||||
|
padding: 0 var(--popup-gap-extra-thin);
|
||||||
|
text-align: center;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
#hostname > span {
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
#hostname > span + span {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
#filteringModeText {
|
||||||
|
color: var(--ink-3);
|
||||||
|
margin: var(--default-gap-small);
|
||||||
|
margin-top: 0;
|
||||||
|
text-align: center;
|
||||||
text-transform: lowercase;
|
text-transform: lowercase;
|
||||||
}
|
}
|
||||||
|
#filteringModeText > span {
|
||||||
|
color: var(--accent-surface-1);
|
||||||
|
}
|
||||||
#filteringModeText > span:nth-of-type(2) {
|
#filteringModeText > span:nth-of-type(2) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
@ -68,9 +90,9 @@ hr {
|
||||||
}
|
}
|
||||||
|
|
||||||
.filteringModeSlider {
|
.filteringModeSlider {
|
||||||
height: 32px;
|
align-self: center;
|
||||||
margin: 8px;
|
margin: var(--popup-gap);
|
||||||
width: 128px;
|
width: calc(var(--popup-main-min-width) - 1em);
|
||||||
}
|
}
|
||||||
|
|
||||||
.rulesetTools {
|
.rulesetTools {
|
||||||
|
@ -101,17 +123,6 @@ hr {
|
||||||
body.needReload #refresh {
|
body.needReload #refresh {
|
||||||
visibility: visible;
|
visibility: visible;
|
||||||
}
|
}
|
||||||
#hostname {
|
|
||||||
font-size: var(--font-size-larger);
|
|
||||||
margin: var(--popup-gap) var(--popup-gap-thin);
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
#hostname > span {
|
|
||||||
word-break: break-all;
|
|
||||||
}
|
|
||||||
#hostname > span + span {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
#rulesetStats {
|
#rulesetStats {
|
||||||
padding: 0 var(--popup-gap-thin);
|
padding: 0 var(--popup-gap-thin);
|
||||||
|
@ -141,7 +152,7 @@ body.needReload #refresh {
|
||||||
}
|
}
|
||||||
|
|
||||||
.toolRibbon {
|
.toolRibbon {
|
||||||
align-items: start;
|
align-items: center;
|
||||||
background-color: var(--popup-toolbar-surface);
|
background-color: var(--popup-toolbar-surface);
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-auto-columns: 1fr;
|
grid-auto-columns: 1fr;
|
||||||
|
|
|
@ -34,6 +34,7 @@ import {
|
||||||
|
|
||||||
import { dom, qs$ } from './dom.js';
|
import { dom, qs$ } from './dom.js';
|
||||||
import { i18n$ } from './i18n.js';
|
import { i18n$ } from './i18n.js';
|
||||||
|
import punycode from './punycode.js';
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
|
@ -300,7 +301,7 @@ async function init() {
|
||||||
|
|
||||||
setFilteringMode(popupPanelData.level);
|
setFilteringMode(popupPanelData.level);
|
||||||
|
|
||||||
dom.text('#hostname', tabHostname);
|
dom.text('#hostname', punycode.toUnicode(tabHostname));
|
||||||
|
|
||||||
const parent = qs$('#rulesetStats');
|
const parent = qs$('#rulesetStats');
|
||||||
for ( const details of popupPanelData.rulesetDetails || [] ) {
|
for ( const details of popupPanelData.rulesetDetails || [] ) {
|
||||||
|
|
|
@ -7,14 +7,14 @@
|
||||||
<link rel="stylesheet" href="css/default.css">
|
<link rel="stylesheet" href="css/default.css">
|
||||||
<link rel="stylesheet" href="css/common.css">
|
<link rel="stylesheet" href="css/common.css">
|
||||||
<link rel="stylesheet" href="css/fa-icons.css">
|
<link rel="stylesheet" href="css/fa-icons.css">
|
||||||
<link rel="stylesheet" href="css/popup.css">
|
|
||||||
<link rel="stylesheet" href="css/filtering-mode.css">
|
<link rel="stylesheet" href="css/filtering-mode.css">
|
||||||
|
<link rel="stylesheet" href="css/popup.css">
|
||||||
<title data-i18n="extName"></title>
|
<title data-i18n="extName"></title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="loading" data-section="">
|
<body class="loading" data-section="">
|
||||||
<div id="main">
|
<div id="main">
|
||||||
<div id="filteringModeText"><span>_</span><span></span></div>
|
<div id="hostname"><span></span>­<span></span></div>
|
||||||
<!-- -------- -->
|
<!-- -------- -->
|
||||||
<div class="filteringModeSlider">
|
<div class="filteringModeSlider">
|
||||||
<div class="filteringModeButton"><div></div></div>
|
<div class="filteringModeButton"><div></div></div>
|
||||||
|
@ -23,8 +23,8 @@
|
||||||
<span data-level="2"></span>
|
<span data-level="2"></span>
|
||||||
<span data-level="3"></span>
|
<span data-level="3"></span>
|
||||||
</div>
|
</div>
|
||||||
<div id="hostname"><span></span>­<span></span></div>
|
|
||||||
<!-- -------- -->
|
<!-- -------- -->
|
||||||
|
<div id="filteringModeText"><label data-i18n="popupFilteringModeLabel">_</label><br><span>_</span><span></span></div>
|
||||||
<div class="toolRibbon pageTools">
|
<div class="toolRibbon pageTools">
|
||||||
<span></span>
|
<span></span>
|
||||||
<span></span>
|
<span></span>
|
||||||
|
|
|
@ -55,6 +55,7 @@ cp src/css/fa-icons.css $DES/css/
|
||||||
cp src/js/dom.js $DES/js/
|
cp src/js/dom.js $DES/js/
|
||||||
cp src/js/fa-icons.js $DES/js/
|
cp src/js/fa-icons.js $DES/js/
|
||||||
cp src/js/i18n.js $DES/js/
|
cp src/js/i18n.js $DES/js/
|
||||||
|
cp src/lib/punycode.js $DES/js/
|
||||||
|
|
||||||
cp LICENSE.txt $DES/
|
cp LICENSE.txt $DES/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue