Browse Source

various visual fixes

pull/2/head
gorhill 7 years ago
parent
commit
1825b65d4c
  1. 4
      src/_locales/en/messages.json
  2. 1
      src/asset-viewer.html
  3. 15
      src/css/popup.css
  4. 1
      src/dashboard.html
  5. 2
      src/js/messaging.js
  6. 23
      src/js/popup.js
  7. 1
      src/logger-ui.html
  8. 1
      src/main-blocked.html
  9. 2
      src/popup.html

4
src/_locales/en/messages.json

@ -135,6 +135,10 @@
"message": "Go to dashboard", "message": "Go to dashboard",
"description": "A menu entry in the matrix popup" "description": "A menu entry in the matrix popup"
}, },
"matrixNoTabFound" : {
"message": "No web page found",
"description": "Displays in place of matrix when no data is found for the current page"
},
"statsPageTitle" : { "statsPageTitle" : {
"message": "uMatrix – Statistics", "message": "uMatrix – Statistics",

1
src/asset-viewer.html

@ -2,6 +2,7 @@
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>uMatrix — Asset viewer</title> <title>uMatrix — Asset viewer</title>
<style> <style>
#content { #content {

15
src/css/popup.css

@ -623,6 +623,21 @@ body.colorblind .rw .matCell.t2 #blacklist:hover {
opacity: 1; opacity: 1;
} }
/* No data was found for the tab */
body.noTabFound .paneHead,
body.noTabFound .paneContent {
display: none;
}
body.noTabFound #noTabFound {
align-items: center;
color: gray;
display: flex;
font-size: xx-large;
height: 100vh;
justify-content: center;
}
/* Mobile-friendly rules */ /* Mobile-friendly rules */
body.hConstrained { body.hConstrained {

1
src/dashboard.html

@ -2,6 +2,7 @@
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/png" href="img/icon_16.png"> <link rel="shortcut icon" type="image/png" href="img/icon_16.png">
<title data-i18n="dashboardPageName"></title> <title data-i18n="dashboardPageName"></title>
<style> <style>

2
src/js/messaging.js

@ -288,7 +288,7 @@ var matrixSnapshotFromTabId = function(details, callback) {
// Fall back to currently active tab // Fall back to currently active tab
var onTabReady = function(tab) { var onTabReady = function(tab) {
if ( typeof tab !== 'object' ) {
if ( tab instanceof Object === false ) {
callback('ENOTFOUND'); callback('ENOTFOUND');
return; return;
} }

23
src/js/popup.js

@ -167,7 +167,7 @@ var messager = vAPI.messaging.channel('popup.js');
function getUserSetting(setting) { function getUserSetting(setting) {
return matrixSnapshot.userSettings[setting]; return matrixSnapshot.userSettings[setting];
}
}
function setUserSetting(setting, value) { function setUserSetting(setting, value) {
matrixSnapshot.userSettings[setting] = value; matrixSnapshot.userSettings[setting] = value;
@ -1078,9 +1078,15 @@ var makeMenu = function() {
// Do all the stuff that needs to be done before building menu et al. // Do all the stuff that needs to be done before building menu et al.
function initMenuEnvironment() { function initMenuEnvironment() {
uDom('body').css('font-size', getUserSetting('displayTextSize'));
uDom('body').toggleClass('colorblind', getUserSetting('colorBlindFriendly') === true);
uDom('#version').text(matrixSnapshot.appVersion || '');
document.body.style.setProperty(
'font-size',
getUserSetting('displayTextSize')
);
document.body.classList.toggle(
'font-size',
getUserSetting('colorBlindFriendly')
);
uDom.nodeFromId('version').textContent = matrixSnapshot.appVersion || '';
var prettyNames = matrixHeaderPrettyNames; var prettyNames = matrixHeaderPrettyNames;
var keys = Object.keys(prettyNames); var keys = Object.keys(prettyNames);
@ -1330,6 +1336,13 @@ function dropDownMenuHide() {
/******************************************************************************/ /******************************************************************************/
var onMatrixSnapshotReady = function(response) { var onMatrixSnapshotReady = function(response) {
if ( response === 'ENOTFOUND' ) {
uDom.nodeFromId('noTabFound').textContent =
vAPI.i18n('matrixNoTabFound');
document.body.classList.add('noTabFound');
return;
}
// Now that tabId and pageURL are set, we can build our menu // Now that tabId and pageURL are set, we can build our menu
initMenuEnvironment(); initMenuEnvironment();
makeMenu(); makeMenu();
@ -1443,7 +1456,7 @@ var matrixSnapshotPoller = (function() {
if ( typeof response === 'object' ) { if ( typeof response === 'object' ) {
matrixSnapshot = response; matrixSnapshot = response;
} }
onMatrixSnapshotReady();
onMatrixSnapshotReady(response);
pollAsync(); pollAsync();
}; };

1
src/logger-ui.html

@ -2,6 +2,7 @@
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="css/common.css"> <link rel="stylesheet" type="text/css" href="css/common.css">
<link rel="stylesheet" type="text/css" href="css/logger-ui.css"> <link rel="stylesheet" type="text/css" href="css/logger-ui.css">
<link rel="shortcut icon" type="image/png" href="img/icon_16.png"> <link rel="shortcut icon" type="image/png" href="img/icon_16.png">

1
src/main-blocked.html

@ -1,6 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title> <title></title>
<link rel="stylesheet" href="css/common.css" type="text/css"> <link rel="stylesheet" href="css/common.css" type="text/css">
<style> <style>

2
src/popup.html

@ -78,6 +78,8 @@
<div id="noNetTrafficPrompt" style="display:none;text-align:center;font-size:large"></div> <div id="noNetTrafficPrompt" style="display:none;text-align:center;font-size:large"></div>
</div> </div>
<div id="noTabFound"></div>
<!-- Convenient to auto-fetch locale strings used in scripts --> <!-- Convenient to auto-fetch locale strings used in scripts -->
<div style="display: none;"> <div style="display: none;">
<span data-i18n="matrixBlacklistedHostnames"></span> <span data-i18n="matrixBlacklistedHostnames"></span>

Loading…
Cancel
Save