Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

Commit

Permalink
Merge pull request #839 from xofe/minor-fixes
Browse files Browse the repository at this point in the history
Minor fixes
  • Loading branch information
gorhill committed Nov 24, 2017
2 parents 53c786e + 068ffe6 commit d3e789f
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 39 deletions.
12 changes: 0 additions & 12 deletions platform/webext/options_ui.html

This file was deleted.

4 changes: 4 additions & 0 deletions src/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions src/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
5 changes: 1 addition & 4 deletions src/css/logger-ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -125,17 +126,13 @@ body.f table tr.f {

body #content td {
border: 1px solid #ccc;
border-top: none;
min-width: 0.5em;
padding: 3px;
vertical-align: top;
white-space: normal;
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;
}
Expand Down
1 change: 1 addition & 0 deletions src/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/hosts-files.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;<!--
Expand Down
32 changes: 16 additions & 16 deletions src/js/logger-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);

/******************************************************************************/
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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');
Expand All @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion src/logger-ui.html
Original file line number Diff line number Diff line change
Expand Up @@ -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">

Expand Down
2 changes: 1 addition & 1 deletion src/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -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><!--
Expand Down
3 changes: 2 additions & 1 deletion tools/make-firefox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
4 changes: 1 addition & 3 deletions tools/make-webext.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down

0 comments on commit d3e789f

Please sign in to comment.