various visual fixes

pull/2/head
gorhill 7 years ago
parent 0a43c6fedd
commit 1825b65d4c

@ -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",

@ -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 {

@ -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 {

@ -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>

@ -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;
} }

@ -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')); document.body.style.setProperty(
uDom('body').toggleClass('colorblind', getUserSetting('colorBlindFriendly') === true); 'font-size',
uDom('#version').text(matrixSnapshot.appVersion || ''); 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();
}; };

@ -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,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>

@ -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