Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #117 from NanoAdblocker/popup-make-reload-persistent
Browse files Browse the repository at this point in the history
Popup make reload persistent
  • Loading branch information
jspenguin2017 authored Feb 11, 2018
2 parents b38905e + 37ee3ae commit b2839b5
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 29 deletions.
3 changes: 2 additions & 1 deletion assets/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,8 @@
"title": "POL: Official Polish filters for AdBlock, uBlock Origin & AdGuard",
"lang": "pl",
"contentURL": "https://raw.githubusercontent.com/MajkiIT/polish-ads-filter/master/polish-adblock-filters/adblock.txt",
"supportURL": "https://github.com/MajkiIT/polish-ads-filter/issues"
"supportURL": "https://github.com/MajkiIT/polish-ads-filter/issues",
"instructionURL": "https://github.com/MajkiIT/polish-ads-filter#polish-filters-for-adblock-ublock-origin--adguard"
},
"RUS-0": {
"content": "filters",
Expand Down
16 changes: 14 additions & 2 deletions src/_nano-locales/en/messages.nano.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,26 @@
},

// Popup tooltips
"popupCacheControlPrompt": {
"message": "cache control",
"description": "The cache control strip name"
},
"popupTipOpenFirewallPane": {
"message": "Toggle the firewall pane",
"description": "Tooltip for toggle firewall pane button"
},
"popupTipRefreshButton": {
"message": "Click to refresh this page.\n\nCtrl+click to refresh this page while bypassing cache.",
"description": "English: Click to refresh this page.\n\nCtrl+click to refresh this page while bypassing cache."
},
// TODO 2018-02-02: Beta stage, do not translate!
"popupTipForceEnableScroll": {
"message": "(beta) Enter force scroll mode (will break layout)",
"description": "Force scroll button"
"description": "Tooltip for force scroll button"
},
"popupTipBugReporter": {
"message": "(beta) Open the bug reporter",
"description": "Bug reporter button"
"description": "Tooltip for bug reporter button"
},

// Based on message of about page
Expand Down
18 changes: 16 additions & 2 deletions src/_nano-locales/zh_CN/messages.nano.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,29 @@
},

// Popup tooltips
"popupCacheControlPrompt": {
"message": "缓存控制",
"description": "The cache control strip name"
},
"popupTipOpenFirewallPane": {
// TODO 2018-02-10: There must be a better translation, but translated like so to stay
// consistent with other strings of uBlock Origin
"message": "是否显示防火墙边窗",
"description": "Tooltip for toggle firewall pane button"
},
"popupTipRefreshButton": {
"message": "单击:刷新当前页面\n\nCtrl + 单击:无视缓存并刷新当前页面",
"description": "English: Click: refresh this page.\n\nCtrl+click: refresh this page bypassing cache."
},
// TODO 2018-02-02: Beta stage, do not translate!
/*
"popupTipForceEnableScroll": {
"message": "进入临时强制滚动模式(会破坏布局)",
"description": "Force scroll button"
"description": "Tooltip for force scroll button"
},
"popupTipBugReporter": {
"message": "打开问题汇报器",
"description": "Bug reporter button"
"description": "Tooltip for bug reporter button"
},
*/

Expand Down
47 changes: 25 additions & 22 deletions src/css/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ h2 {
background-color: #eee;
border: 0;
color: #666;

/* Patch 2018-02-10: Add explicit button for openeing firewall */
/*
cursor: pointer;
*/

font-size: 100%;
font-weight: normal;
padding: 0.2em;
Expand Down Expand Up @@ -124,11 +129,15 @@ p {
#switch .fa {
color: #0046ff;
cursor: pointer;
font-size: 700%;

/* Patch 2018-02-10: Make switch button smaller */
font-size: 600%;

margin: 0;
}
#switch .fa:hover {
opacity: 0.9;
/* Patch 2018-02-10: Adjust hover color */
opacity: 0.8;
}
body.off #switch .fa {
color: #ccc;
Expand All @@ -139,7 +148,7 @@ body.off #switch .fa {
}
#basicTools {
/* Patch 2018-02-01: Make it two rows */
margin-bottom: 1.0em;
margin-bottom: 1.2em;
}
.tool:first-child {
margin-left: 0;
Expand All @@ -148,8 +157,9 @@ body.off #switch .fa {
color: #aaa;
cursor: pointer;
visibility: hidden;

/* Patch 2018-02-01: Adjust spacing for two rows basic tools */
margin-left: 1.4em;
margin-left: 0.6em;

min-width: 1em;
padding: 0 0.2em;
Expand Down Expand Up @@ -220,26 +230,19 @@ body[dir="rtl"] #extraTools > span > span.badge {
color: #333;
}

#refresh {
background-color: #ffe;
border: 1px solid #ddc;
border-radius: 4px;
color: #888;
cursor: pointer;
display: none;
font-size: 3.5em;
left: 4px;
line-height: 1;
padding: 4px 8px;
position: absolute;
right: 4px;
text-align: center;
}
/* Patch 2018-02-10: Add explicit button for openeing firewall */
#nanoCacheControlStrip {
font-size: 2em;
margin: 0px;
}
#nanoCacheControlStrip .tool {
margin-left: 0px;
}
body.dirty #refresh {
display: block;
color: red;
}
body.dirty #refresh:hover {
color: black;
body #refresh:hover {
color: #444;;
}

#tooltip {
Expand Down
6 changes: 5 additions & 1 deletion src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -1095,11 +1095,15 @@ var onHideTooltip = function() {

uDom('#switch').on('click', toggleNetFilteringSwitch);
uDom('#gotoZap').on('click', gotoZap);

// Patch 2018-02-01: Add force enable scroll
uDom('#forceEnableScroll').on('click', forceEnableScroll);

uDom('#gotoPick').on('click', gotoPick);
uDom('h2').on('click', toggleFirewallPane);

// Patch 2018-02-10: Move openeing firewall pane to a explicit button
uDom('#nanoFirewallPaneToggle').on('click', toggleFirewallPane);

uDom('#refresh').on('click', reloadTab);
uDom('.hnSwitch').on('click', toggleHostnameSwitch);
uDom('#saveRules').on('click', saveFirewallRules);
Expand Down
10 changes: 9 additions & 1 deletion src/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<!-- Notes 2018-02-01: Documentation is here: https://fontawesome.com/v4.7.0/icons/ -->
<p id="basicTools">
<span id="gotoPick" class="fa tool" data-i18n-tip="popupTipPicker" data-tip-position="under">&#xf1fb;</span>
<!-- Patch 2018-02-10: Move openeing firewall pane to a explicit button -->
<span id="nanoFirewallPaneToggle" class="fa tool enabled" data-i18n-tip="popupTipOpenFirewallPane" data-tip-position="under">&#xf0db;</span>
<!-- Notes 2018-02-01: "logger-ui.html" must be on the first row and must not be renamed -->
<a href="logger-ui.html" class="fa tool enabled" aria-label="data-tip" data-i18n-tip="popupTipLog" data-tip-position="under" target="uBOLogger" tabindex="0">&#xf022;</a>
<a href="dashboard.html" class="fa tool enabled" aria-label="data-tip" data-i18n-tip="popupTipDashboard" data-tip-position="under" target="uBODashboard" tabindex="0">&#xf0ad;</a>
Expand All @@ -33,11 +35,17 @@ <h2 id="dfToggler" data-i18n="popupBlockedRequestPrompt">&nbsp;</h2>
<span data-i18n="popupBlockedOnThisPagePrompt">&nbsp;</span>
</p>
<p class="statValue" id="page-blocked">?</p>
<div id="refresh" class="fa">&#xf021;</div>
<p class="statName">
<span data-i18n="popupBlockedSinceInstallPrompt">&nbsp;</span>
</p>
<p class="statValue" id="total-blocked">?</p>

<!-- Patch 2018-02-10: Make refresh button persistent -->
<h2 data-i18n="popupCacheControlPrompt">&nbsp;</h2>
<p id="nanoCacheControlStrip">
<span id="refresh" class="fa tool enabled" data-i18n-tip="popupTipRefreshButton">&#xf021;</span>
</p>

<h2 data-i18n="popupHitDomainCountPrompt">&nbsp;</h2>
<p class="statValue" id="popupHitDomainCount">&nbsp;</p>
<div id="extraTools">
Expand Down

0 comments on commit b2839b5

Please sign in to comment.