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. 25
      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",
"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" : {
"message": "uMatrix – Statistics",

1
src/asset-viewer.html

@ -2,6 +2,7 @@
<html>
<head>
<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>
<style>
#content {

15
src/css/popup.css

@ -623,6 +623,21 @@ body.colorblind .rw .matCell.t2 #blacklist:hover {
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 */
body.hConstrained {

1
src/dashboard.html

@ -2,6 +2,7 @@
<html>
<head>
<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">
<title data-i18n="dashboardPageName"></title>
<style>

2
src/js/messaging.js

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

25
src/js/popup.js

@ -166,8 +166,8 @@ var messager = vAPI.messaging.channel('popup.js');
/******************************************************************************/
function getUserSetting(setting) {
return matrixSnapshot.userSettings[setting];
}
return matrixSnapshot.userSettings[setting];
}
function setUserSetting(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.
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 keys = Object.keys(prettyNames);
@ -1330,6 +1336,13 @@ function dropDownMenuHide() {
/******************************************************************************/
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
initMenuEnvironment();
makeMenu();
@ -1443,7 +1456,7 @@ var matrixSnapshotPoller = (function() {
if ( typeof response === 'object' ) {
matrixSnapshot = response;
}
onMatrixSnapshotReady();
onMatrixSnapshotReady(response);
pollAsync();
};

1
src/logger-ui.html

@ -2,6 +2,7 @@
<html>
<head>
<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/logger-ui.css">
<link rel="shortcut icon" type="image/png" href="img/icon_16.png">

1
src/main-blocked.html

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

2
src/popup.html

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

Loading…
Cancel
Save