Browse Source

add tooltip for global scope + setting to disable tooltips (see https://github.com/gorhill/uMatrix/issues/936#issuecomment-361936827)

pull/2/head
Raymond Hill 7 years ago
parent
commit
c2a46c5da4
No known key found for this signature in database GPG Key ID: 25E1490B761470C2
  1. 24
      src/_locales/en/messages.json
  2. 16
      src/css/common.css
  3. 1
      src/js/background.js
  4. 1
      src/js/messaging.js
  5. 8
      src/js/popup.js
  6. 3
      src/js/settings.js
  7. 2
      src/popup.html
  8. 3
      src/settings.html

24
src/_locales/en/messages.json

@ -91,6 +91,14 @@
"message": "No net traffic seen for this tab so far.", "message": "No net traffic seen for this tab so far.",
"description": "" "description": ""
}, },
"matrixLocalScopeTip" : {
"message": "Select a local scope to see/create rules which apply only in that scope",
"description": "Tool tip for the local scope button"
},
"matrixGlobalScopeTip" : {
"message": "Select the global scope to see/create rules which apply everywhere",
"description": "Tool tip for the global scope button"
},
"matrixMtxButtonTip" : { "matrixMtxButtonTip" : {
"message": "Disable/enable matrix filtering for this scope", "message": "Disable/enable matrix filtering for this scope",
"description": "Tool tip for matrix button" "description": "Tool tip for matrix button"
@ -282,12 +290,8 @@
"message": "Text size:", "message": "Text size:",
"description": "" "description": ""
}, },
"settingsMatrixDisplayTextSizeNormal" : {
"message": "Normal",
"description": ""
},
"settingsMatrixDisplayTextSizeLarge" : {
"message": "Large",
"settingsIconBadgeEnabled":{
"message":"Show the number of distinct requests on the icon",
"description":"" "description":""
}, },
"settingsMatrixDisplayColorBlind" : { "settingsMatrixDisplayColorBlind" : {
@ -342,10 +346,6 @@
"message": "Opacity", "message": "Opacity",
"description": "English: Opacity" "description": "English: Opacity"
}, },
"settingsIconBadgeEnabled":{
"message":"Show the number of distinct requests on the icon",
"description":"English: Show the number of distinct requests on the icon"
},
"settingsCollapseBlocked" : { "settingsCollapseBlocked" : {
"message": "Collapse placeholder of blocked elements", "message": "Collapse placeholder of blocked elements",
"description": "English: Collapse placeholder of blocked elements" "description": "English: Collapse placeholder of blocked elements"
@ -362,6 +362,10 @@
"message": "Enable cloud storage support", "message": "Enable cloud storage support",
"description": "" "description": ""
}, },
"settingsMatrixNoTooltips" : {
"message": "Disable tooltips",
"description": ""
},
"privacyPageTitle" : { "privacyPageTitle" : {
"message": "uMatrix – Privacy", "message": "uMatrix – Privacy",

16
src/css/common.css

@ -43,11 +43,11 @@ body[dir="rtl"] {
position: relative; position: relative;
cursor: pointer; cursor: pointer;
} }
*[data-i18n-tip]:after {
*[data-i18n-tip]::after {
content: ""; content: "";
opacity: 0; opacity: 0;
} }
*[data-i18n-tip]:hover:after {
*[data-i18n-tip]:hover::after {
background-color: #fffffa; background-color: #fffffa;
border: 1px solid gray; border: 1px solid gray;
border-radius: 3px; border-radius: 3px;
@ -68,14 +68,18 @@ body[dir="rtl"] {
white-space: pre-line; white-space: pre-line;
z-index: 20; z-index: 20;
} }
body[dir="ltr"] .tip-anchor-left[data-i18n-tip]:hover:after,
body[dir="rtl"] .tip-anchor-right[data-i18n-tip]:hover:after {
body[dir="ltr"] .tip-anchor-left[data-i18n-tip]:hover::after,
body[dir="rtl"] .tip-anchor-right[data-i18n-tip]:hover::after {
left: -3vw; left: -3vw;
} }
body[dir="ltr"] .tip-anchor-right[data-i18n-tip]:hover:after,
body[dir="rtl"] .tip-anchor-left[data-i18n-tip]:hover:after {
body[dir="ltr"] .tip-anchor-right[data-i18n-tip]:hover::after,
body[dir="rtl"] .tip-anchor-left[data-i18n-tip]:hover::after {
right: -3vw; right: -3vw;
} }
body.noTooltips *[data-i18n-tip]::after {
display: none;
}
button.custom { button.custom {
padding: 0.6em 1em; padding: 0.6em 1em;
border: 1px solid transparent; border: 1px solid transparent;

1
src/js/background.js

@ -181,6 +181,7 @@ return {
externalRecipeFiles: [], externalRecipeFiles: [],
iconBadgeEnabled: false, iconBadgeEnabled: false,
maxLoggedRequests: 1000, maxLoggedRequests: 1000,
noTooltips: false,
popupCollapseAllDomains: false, popupCollapseAllDomains: false,
popupCollapseBlacklistedDomains: false, popupCollapseBlacklistedDomains: false,
popupScopeLevel: 'domain', popupScopeLevel: 'domain',

1
src/js/messaging.js

@ -196,6 +196,7 @@ var matrixSnapshot = function(pageStore, details) {
userSettings: { userSettings: {
colorBlindFriendly: µmuser.colorBlindFriendly, colorBlindFriendly: µmuser.colorBlindFriendly,
displayTextSize: µmuser.displayTextSize, displayTextSize: µmuser.displayTextSize,
noTooltips: µmuser.noTooltips,
popupScopeLevel: µmuser.popupScopeLevel popupScopeLevel: µmuser.popupScopeLevel
} }
}; };

8
src/js/popup.js

@ -1,7 +1,7 @@
/******************************************************************************* /*******************************************************************************
uMatrix - a Chromium browser extension to black/white list requests. uMatrix - a Chromium browser extension to black/white list requests.
Copyright (C) 2014-2017 Raymond Hill
Copyright (C) 2014-2018 Raymond Hill
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -1070,11 +1070,15 @@ function initMenuEnvironment() {
'font-size', 'font-size',
getUserSetting('displayTextSize') getUserSetting('displayTextSize')
); );
uDom.nodeFromId('version').textContent = matrixSnapshot.appVersion || '';
document.body.classList.toggle( document.body.classList.toggle(
'colorblind', 'colorblind',
getUserSetting('colorBlindFriendly') getUserSetting('colorBlindFriendly')
); );
uDom.nodeFromId('version').textContent = matrixSnapshot.appVersion || '';
document.body.classList.toggle(
'noTooltips',
getUserSetting('noTooltips')
);
var prettyNames = matrixHeaderPrettyNames; var prettyNames = matrixHeaderPrettyNames;
var keys = Object.keys(prettyNames); var keys = Object.keys(prettyNames);

3
src/js/settings.js

@ -1,7 +1,7 @@
/******************************************************************************* /*******************************************************************************
uMatrix - a Chromium browser extension to black/white list requests. uMatrix - a Chromium browser extension to black/white list requests.
Copyright (C) 2014-2017 Raymond Hill
Copyright (C) 2014-2018 Raymond Hill
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@ -101,6 +101,7 @@ function onInputChanged(ev) {
case 'deleteLocalStorage': case 'deleteLocalStorage':
case 'deleteUnusedSessionCookies': case 'deleteUnusedSessionCookies':
case 'iconBadgeEnabled': case 'iconBadgeEnabled':
case 'noTooltips':
case 'processHyperlinkAuditing': case 'processHyperlinkAuditing':
changeUserSettings(target.id, target.checked); changeUserSettings(target.id, target.checked);
break; break;

2
src/popup.html

@ -16,7 +16,7 @@
<div id="toolbarContainer"> <div id="toolbarContainer">
<div class="toolbar"> <div class="toolbar">
<span class="scope" id="specificScope"><span>&nbsp;</span></span><!-- <span class="scope" id="specificScope"><span>&nbsp;</span></span><!--
--><span class="scope" id="globalScope" data-scope="*"><span><span>&#x2217;</span></span></span>
--><span class="scope" id="globalScope" data-scope="*" data-i18n-tip="matrixGlobalScopeTip"><span><span>&#x2217;</span></span></span>
<button id="mtxSwitch_matrix-off" type="button" class="fa scopeRel tip-anchor-left" data-i18n-tip="matrixMtxButtonTip">&#xf011;<span class="badge"></span></button> <button id="mtxSwitch_matrix-off" type="button" class="fa scopeRel tip-anchor-left" data-i18n-tip="matrixMtxButtonTip">&#xf011;<span class="badge"></span></button>
<button id="buttonMtxSwitches" type="button" class="fa scopeRel" tabindex="-1" data-dropdown-menu="dropDownMenuSwitches">&#xf142;<span class="badge"></span></button> <button id="buttonMtxSwitches" type="button" class="fa scopeRel" tabindex="-1" data-dropdown-menu="dropDownMenuSwitches">&#xf142;<span class="badge"></span></button>
<button id="buttonPersist" type="button" class="fa scopeRel tip-anchor-left" data-i18n-tip="matrixPersistButtonTip">&#xf023;<span class="badge"></span></button> <button id="buttonPersist" type="button" class="fa scopeRel tip-anchor-left" data-i18n-tip="matrixPersistButtonTip">&#xf023;<span class="badge"></span></button>

3
src/settings.html

@ -45,6 +45,9 @@ ul > li.separator {
<label data-i18n="settingsNoscriptTagsSpoofed" for="noscriptTagsSpoofed"></label> <label data-i18n="settingsNoscriptTagsSpoofed" for="noscriptTagsSpoofed"></label>
<li><input id="cloudStorageEnabled" type="checkbox" data-setting-bool> <li><input id="cloudStorageEnabled" type="checkbox" data-setting-bool>
<label data-i18n="settingsCloudStorageEnabled" for="cloudStorageEnabled"></label> <label data-i18n="settingsCloudStorageEnabled" for="cloudStorageEnabled"></label>
<li>
<input id="noTooltips" type="checkbox" data-setting-bool>
<label data-i18n="settingsMatrixNoTooltips" for="noTooltips"></label>
</ul> </ul>
<h2 data-i18n="settingsMatrixDisplayHeader"></h2> <h2 data-i18n="settingsMatrixDisplayHeader"></h2>
<ul> <ul>

Loading…
Cancel
Save