Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
90a46cd
Merge pull request #17 from nightscout/dev
unsoluble Jan 8, 2019
c8917db
Merge pull request #19 from nightscout/dev
unsoluble Jan 22, 2019
89b5e36
Merge pull request #21 from nightscout/dev
unsoluble Jan 27, 2019
b12e35a
Merge pull request #22 from nightscout/dev
unsoluble Feb 3, 2019
c0fa7b4
Merge pull request #23 from nightscout/dev
unsoluble Feb 5, 2019
537b4a7
Merge pull request #26 from nightscout/dev
unsoluble Feb 7, 2019
09b0785
Merge pull request #31 from nightscout/dev
unsoluble Mar 5, 2019
eafc1de
Merge pull request #32 from nightscout/dev
unsoluble Apr 16, 2019
0bc4d04
Merge pull request #33 from nightscout/dev
unsoluble Apr 24, 2019
7ea7e1a
Merge pull request #34 from nightscout/dev
unsoluble May 3, 2019
da322bb
Merge pull request #35 from nightscout/dev
unsoluble May 19, 2019
38bf283
Merge pull request #37 from nightscout/dev
unsoluble Jun 21, 2019
f96473f
Merge pull request #40 from nightscout/dev
unsoluble Jul 19, 2019
3803b41
Merge pull request #44 from nightscout/dev
unsoluble Jul 29, 2019
b921f32
Merge pull request #45 from nightscout/dev
unsoluble Jul 30, 2019
d2320da
Merge pull request #47 from nightscout/dev
unsoluble Aug 8, 2019
2379706
Merge pull request #48 from nightscout/dev
unsoluble Aug 23, 2019
4dc0102
Merge pull request #50 from nightscout/dev
unsoluble Aug 28, 2019
1a2913d
Merge pull request #52 from nightscout/dev
unsoluble Sep 18, 2019
3f6503f
Merge pull request #53 from nightscout/dev
unsoluble Sep 18, 2019
8e19b81
Create robots.txt
unsoluble Sep 18, 2019
4cff64e
Update robots.txt
unsoluble Sep 18, 2019
cb30356
Delete robots.txt
unsoluble Sep 18, 2019
b052fda
Merge pull request #55 from nightscout/dev
unsoluble Sep 19, 2019
53e7eff
refactor clock css
unsoluble Sep 22, 2019
6d7f782
swap css import order
unsoluble Sep 22, 2019
c6237dc
Update README.md
unsoluble Sep 22, 2019
e4b7630
Update index.html
unsoluble Sep 22, 2019
b7916fa
Update bgclock.css
unsoluble Sep 22, 2019
162db7c
Update shared.html
unsoluble Sep 22, 2019
2943ee7
Update clock-shared.css
unsoluble Sep 22, 2019
0ebce50
Update settings.js
unsoluble Sep 22, 2019
354a47f
Update clock-shared.css
unsoluble Sep 22, 2019
0c90dbb
Update clock-shared.css
unsoluble Sep 22, 2019
b3c3506
Update robots.txt
unsoluble Sep 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,6 @@ To learn more about the Nightscout API, visit https://YOUR-SITE.com/api-docs/ or
* `Clock` - Shows current BG, trend arrow, and time of day. Grey text on a black background.
* `Color` - Shows current BG and trend arrow. White text on a background that changes color to indicate current BG threshold (green = in range; blue = below range; yellow = above range; red = urgent below/above).
* `Simple` - Shows current BG. Grey text on a black background.
* Optional configuration: set `SHOW_CLOCK_CLOSEBUTTON` to `false` to never show the small X button in clock views. For bookmarking a clock view without the close box but have it appear when navigating to a clock from the Nightscout menu, don't change the settng, but remove the `showClockClosebutton=true` parameter from the clock view URL.

### Plugins

Expand Down
22 changes: 0 additions & 22 deletions lib/client/clock-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ client.render = function render (xhr) {
if (m < 10) m = "0" + m;
$('#clock').text(h + ":" + m);

var queryDict = {};
location.search.substr(1).split("&").forEach(function(item) { queryDict[item.split("=")[0]] = item.split("=")[1] });

if (!window.serverSettings.settings.showClockClosebutton || !queryDict['showClockClosebutton']) {
$('#close').css('display', 'none');
}

// defined in the template this is loaded into
// eslint-disable-next-line no-undef
if (clockFace === 'clock-color') {
Expand All @@ -122,11 +115,6 @@ client.render = function render (xhr) {
var green = 'rgba(134,207,70,1)';
var blue = 'rgba(78,143,207,1)';

var darkRed = 'rgba(183,9,21,1)';
var darkYellow = 'rgba(214,168,0,1)';
var darkGreen = 'rgba(110,192,70,1)';
var darkBlue = 'rgba(78,143,187,1)';

var elapsedMins = Math.round(((now - last) / 1000) / 60);

// Insert the BG stale time text.
Expand All @@ -135,28 +123,18 @@ client.render = function render (xhr) {
// Threshold background coloring.
if (bgNum < bgLow) {
$('body').css('background-color', red);
$('#close').css('border-color', darkRed);
$('#close').css('color', darkRed);
}
if ((bgLow <= bgNum) && (bgNum < bgTargetBottom)) {
$('body').css('background-color', blue);
$('#close').css('border-color', darkBlue);
$('#close').css('color', darkBlue);
}
if ((bgTargetBottom <= bgNum) && (bgNum < bgTargetTop)) {
$('body').css('background-color', green);
$('#close').css('border-color', darkGreen);
$('#close').css('color', darkGreen);
}
if ((bgTargetTop <= bgNum) && (bgNum < bgHigh)) {
$('body').css('background-color', yellow);
$('#close').css('border-color', darkYellow);
$('#close').css('color', darkYellow);
}
if (bgNum >= bgHigh) {
$('body').css('background-color', red);
$('#close').css('border-color', darkRed);
$('#close').css('color', darkRed);
}

// Restyle body bg, and make the "x minutes ago" visible too.
Expand Down
2 changes: 0 additions & 2 deletions lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ function init () {
, secureHstsHeaderIncludeSubdomains: false
, secureHstsHeaderPreload: false
, secureCsp: false
, showClockClosebutton: true
, deNormalizeDates: false
};

Expand All @@ -69,7 +68,6 @@ function init () {
, insecureUseHttp: mapTruthy
, secureHstsHeader: mapTruthy
, secureCsp: mapTruthy
, showClockClosebutton: mapTruthy
, deNormalizeDates: mapTruthy
};

Expand Down
53 changes: 1 addition & 52 deletions views/clockviews/bgclock.css
Original file line number Diff line number Diff line change
@@ -1,42 +1,7 @@
body {
text-align: center;
margin: 0 0;
padding: 0;
overflow: hidden;
font-family: 'Open Sans';
color: grey;
background-color: black;
}

main {
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
height: 100vh;
}

.inner {
width: 100%;
-webkit-transform: translateY(-2%);
}

#trend {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
justify-content: center;
-webkit-flex-direction: row;
flex-direction: row;
}

#bgnow, #arrowDiv {
display: flex;
flex-grow: 0;
Expand All @@ -55,25 +20,9 @@ img#arrow {
#clock {
font-weight: 700;
font-size: 25vmin;
display: inline;
}

.stale {
text-decoration: line-through;
}

.close {
color: white;
font: 4em 'Open Sans';
position: absolute;
right: 20px;
text-decoration: none;
}

.close:after {
content: '\00D7';
}

.hidden {
opacity: 0;
transition: opacity 0.5s linear;
}
62 changes: 0 additions & 62 deletions views/clockviews/clock-color.css
Original file line number Diff line number Diff line change
@@ -1,44 +1,9 @@
body {
text-align: center;
margin: 0 0;
padding: 0;
overflow: hidden;
font-family: 'Open Sans';
color: white;
background-color: white;
}

main {
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
height: 100vh;
}

.inner {
width: 100%;
-webkit-transform: translateY(-5%);
}

#bgnow {
font-weight: 700;
font-size: 40vmin;
}

#trend {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-align: center;
-webkit-align-items: center;
-webkit-transform: translateX(1%);
align-items: center;
justify-content: center;
-webkit-flex-direction: column;
flex-direction: column;
}
Expand All @@ -50,31 +15,4 @@ main {

img#arrow {
height: 30vmin;
}

#staleTime {
flex-grow: 1;
font-size: 6vmin;
display: none;
}

#clock {
display: none;
}

.close {
color: white;
font: 4em 'Open Sans';
position: absolute;
right: 20px;
text-decoration: none;
}

.close:after {
content: '\00D7';
}

.hidden {
opacity: 0;
transition: opacity 0.5s linear;
}
72 changes: 72 additions & 0 deletions views/clockviews/clock-shared.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
body {
text-align: center;
margin: 0 0;
padding: 0;
overflow: hidden;
font-family: 'Open Sans';
color: grey;
background-color: black;
}

main {
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
height: 100vh;
}

.inner {
width: 100%;
-webkit-transform: translateY(-5%);
}

#bgnow {
font-weight: 700;
font-size: 40vmin;
}

#trend {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
justify-content: center;
-webkit-flex-direction: row;
flex-direction: row;
}

#staleTime {
flex-grow: 1;
font-size: 6vmin;
display: none;
}

#clock {
display: none;
}

.close {
color: white;
font: 4em 'Open Sans';
position: absolute;
top: 0;
right: 20px;
text-decoration: none;
z-index: 10;
}

.close:after {
content: '\00D7';
}

.hidden {
opacity: 0;
transition: opacity 0.5s linear;
}
66 changes: 0 additions & 66 deletions views/clockviews/clock.css
Original file line number Diff line number Diff line change
@@ -1,71 +1,5 @@
body {
text-align: center;
margin: 0 0;
padding: 0;
overflow: hidden;
font-family: 'Open Sans';
color: grey;
background-color: black;
}

main {
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
height: 100vh;
}

.inner {
width: 100%;
-webkit-transform: translateY(-5%);
}

#bgnow {
font-weight: 700;
font-size: 40vmin;
}

#trend {
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-ms-flex-align: center;
-webkit-align-items: center;
-webkit-transform: translateX(1%);
align-items: center;
justify-content: center;
-webkit-flex-direction: column;
flex-direction: column;
}

#staleTime {
flex-grow: 1;
font-size: 6vmin;
display: none;
}

#clock {
display: none;
}

.close {
color: white;
font: 4em 'Open Sans';
position: absolute;
right: 20px;
text-decoration: none;
}

.close:after {
content: '\00D7';
}

.hidden {
opacity: 0;
transition: opacity 0.5s linear;
}
4 changes: 2 additions & 2 deletions views/clockviews/shared.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@

<style type="text/css">
@import url("//fonts.googleapis.com/css?family=Open+Sans:700");
<%- include('clock-shared.css', {}); %>
<%- include(face + '.css', {}); %>

</style>
</head>

<body>
<a href="/" id="closeButton" class="close"></a>
<main>
<a href="/" id="closeButton" class="close"></a>
<div class="inner">
<div id="trend">
<div id="bgnow"></div>
Expand Down
Loading