Browse Source

Merge pull request #839 from xofe/minor-fixes

Minor fixes
pull/2/head
Raymond Hill 7 years ago
committed by GitHub
parent
commit
d3e789f5da
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      platform/webext/options_ui.html
  2. 4
      src/_locales/en/messages.json
  3. 8
      src/css/common.css
  4. 5
      src/css/logger-ui.css
  5. 1
      src/dashboard.html
  6. 2
      src/hosts-files.html
  7. 32
      src/js/logger-ui.js
  8. 3
      src/logger-ui.html
  9. 2
      src/popup.html
  10. 3
      tools/make-firefox.sh
  11. 4
      tools/make-webext.sh

12
platform/webext/options_ui.html

@ -1,12 +0,0 @@
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<a href="dashboard.html" data-i18n="matrixDashboardMenuEntry" target="uMatrix-dashboard"></a><br>
<a href="logger-ui.html" data-i18n="matrixLoggerMenuEntry" target="uMatrix-logger"></a>
</body>
<script src="js/vapi-common.js"></script>
<script src="js/i18n.js"></script>
</html>

4
src/_locales/en/messages.json

@ -11,6 +11,10 @@
"message": "uMatrix — Dashboard",
"description": ""
},
"loggerPageName": {
"message": "uMatrix — Logger",
"description": "Title for the logger window"
},
"settingsPageName": {
"message": "Settings",
"description": "a tab in dashboard"

8
src/css/common.css

@ -55,6 +55,10 @@ body[dir="rtl"] {
position: relative;
cursor: pointer;
}
*[data-i18n-tip]:after {
content: "";
opacity: 0;
}
*[data-i18n-tip]:hover:after {
background-color: #fffffa;
border: 1px solid gray;
@ -65,10 +69,14 @@ body[dir="rtl"] {
font: 12px sans-serif;
line-height: 140%;
min-width: 25vw;
opacity: 1;
padding: 4px 6px;
pointer-events: none;
position: absolute;
text-align: start;
top: 110%;
-webkit-transition: opacity 0.15s 0.5s;
transition: opacity 0.15s 0.5s;
white-space: pre-line;
z-index: 20;
}

5
src/css/logger-ui.css

@ -12,6 +12,7 @@ body {
#toolbar {
background-color: white;
border: 0;
border-bottom: 1px solid #ccc;
box-sizing: border-box;
-moz-box-sizing: border-box;
left: 0;
@ -125,7 +126,6 @@ body.f table tr.f {
body #content td {
border: 1px solid #ccc;
border-top: none;
min-width: 0.5em;
padding: 3px;
vertical-align: top;
@ -133,9 +133,6 @@ body #content td {
word-break: break-all;
word-wrap: break-word;
}
#content table tr td {
border-top: 1px solid #ccc;
}
#content table tr td:first-of-type {
border-left: none;
}

1
src/dashboard.html

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

2
src/hosts-files.html

@ -34,7 +34,7 @@
<input type="checkbox"><!--
--><a class="content" type="text/plain" target="_blank" href=""></a>&#8203;<!--
--><a class="fa support" href="" target="_blank">&#xf015;</a>&#8203;<!--
--><a class="fa remove" href="">&#xf00d;</a>&#8203;<!--
--><a class="fa remove" href="">&#xf014;</a>&#8203;<!--
--><a class="fa mustread" href="" target="_blank">&#xf05a;</a>&#8203;<!--
 --><span class="fa status unsecure" title="http">&#xf13e;</span>&#8203;<!--
--><span class="counts dim"></span>&#8203;<!--

32
src/js/logger-ui.js

@ -50,25 +50,13 @@ var prettyRequestTypes = {
'xmlhttprequest': 'xhr'
};
var timeOptions = {
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: false
};
var dateOptions = {
month: 'short',
day: '2-digit'
};
/******************************************************************************/
// Adjust top padding of content table, to match that of toolbar height.
document.getElementById('content').style.setProperty(
'margin-top',
document.getElementById('toolbar').offsetHeight + 'px'
document.getElementById('toolbar').clientHeight + 'px'
);
/******************************************************************************/
@ -220,6 +208,12 @@ var createHiddenTextNode = function(text) {
/******************************************************************************/
var padTo2 = function(v) {
return v < 10 ? '0' + v : v;
};
/******************************************************************************/
var createGap = function(tabId, url) {
var tr = createRow('1');
tr.classList.add('doc');
@ -276,9 +270,11 @@ var renderLogEntry = function(entry) {
}
// Fields common to all rows.
var time = new Date(entry.tstamp);
tr.cells[0].textContent = time.toLocaleTimeString('fullwide', timeOptions);
tr.cells[0].title = time.toLocaleDateString('fullwide', dateOptions);
var time = logDate;
time.setTime(entry.tstamp - logDateTimezoneOffset);
tr.cells[0].textContent = padTo2(time.getUTCHours()) + ':' +
padTo2(time.getUTCMinutes()) + ':' +
padTo2(time.getSeconds());
if ( entry.tab ) {
tr.classList.add('tab');
@ -296,6 +292,10 @@ var renderLogEntry = function(entry) {
tbody.insertBefore(tr, tbody.firstChild);
};
// Reuse date objects.
var logDate = new Date(),
logDateTimezoneOffset = logDate.getTimezoneOffset() * 60000;
/******************************************************************************/
var renderLogEntries = function(response) {

3
src/logger-ui.html

@ -4,7 +4,8 @@
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/common.css">
<link rel="stylesheet" type="text/css" href="css/logger-ui.css">
<title>uMatrix log</title>
<link rel="shortcut icon" type="image/png" href="img/icon_16.png">
<title data-i18n="loggerPageName"></title>
</head>
<body class="compactView f">

2
src/popup.html

@ -19,7 +19,7 @@
</div>
<div class="paneHead">
<a id="gotoDashboard" class="extensionURL" href="#" data-extension-url="dashboard.html">uMatrix <span id="version"> </span><span class="fa">&#xf013;</span></a>
<a id="gotoDashboard" class="extensionURL" href="#" data-extension-url="dashboard.html" data-i18n-tip="matrixDashboardMenuEntry">uMatrix <span id="version"> </span><span class="fa">&#xf013;</span></a>
<div id="toolbarContainer">
<div class="toolbar">
<span class="scope" id="specificScope"><span>&nbsp;</span></span><!--

3
tools/make-firefox.sh

@ -19,7 +19,8 @@ cp -R src/* $DES/
mv $DES/img/icon_128.png $DES/icon.png
cp platform/firefox/css/* $DES/css/
cp platform/firefox/*.js $DES/js/
cp platform/firefox/polyfill.js $DES/js/
cp platform/firefox/vapi-*.js $DES/js/
cp platform/firefox/bootstrap.js $DES/
cp platform/firefox/frame*.js $DES/
cp -R platform/chromium/img $DES/

4
tools/make-webext.sh

@ -16,15 +16,13 @@ cp platform/chromium/*.js $DES/js/
cp -R platform/chromium/img/* $DES/img/
cp LICENSE.txt $DES/
cp platform/webext/options_ui.html $DES/
rm $DES/js/options_ui.js
cp platform/webext/polyfill.js $DES/js/
cp platform/webext/vapi-cachestorage.js $DES/js/
cp platform/webext/manifest.json $DES/
# webext-specific
rm $DES/options_ui.html
rm $DES/options_ui.js
rm $DES/js/options_ui.js
echo "*** uMatrix.webext: Generating meta..."
python tools/make-webext-meta.py $DES/

Loading…
Cancel
Save