Merge branch 'dev' into more-clock-options

This commit is contained in:
PieterGit
2018-06-25 23:15:01 +02:00
committed by GitHub
84 changed files with 5672 additions and 2713 deletions
+131 -72
View File
@@ -1,83 +1,142 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nightscout BG NOW</title>
<link href="/images/round1.png" rel="icon" id="favicon" type="image/png" />
<link rel='stylesheet' type='text/css' href='/css/main.css' />
<style type="text/css">
img#arrow { height: 15vmin; }
.center {
text-align: center;
padding: 0;
margin: 0;
}
h1 {
padding: 0;
margin: 0;
font-size: 1500%;
}
html, body {
padding: 0;
margin: 0;
height: 100%;
}
html {
}
body {
font-size: 100%;
min-height: 100%;
}
.stale {
text-decoration: line-through;
}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>Nightscout</title>
<link href="/images/round1.png" rel="icon" id="favicon" type="image/png" />
<link rel="apple-touch-icon" sizes="57x57" href="/images/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/images/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/images/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/images/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/images/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/images/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/images/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-180x180.png">
<style type="text/css">
@import url("//fonts.googleapis.com/css?family=Open+Sans:700");
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;
font-weight: 700;
font-size: 30vmin;
padding: 0 20px;
margin: 0;
}
img#arrow {
height: 15vmin;
}
#clock {
font-weight: 700;
font-size: 25vmin;
}
.stale {
text-decoration: line-through;
}
</style>
</head>
<body>
<div class="center">
<h1 class="bgnow"></h1>
<h1 class="clock"></h1>
</div>
<script src="/api/v1/status.js"></script>
<script src="/js/bundle.js?v=<%= locals.cachebuster %>"></script>
<script type="text/javascript">
function query ( ) {
console.log('query');
$.ajax('/api/v1/entries/current.json', { success: render });
}
function render (xhr) {
console.log('xhr', xhr);
var rec = xhr[0];
var last = new Date(rec.date);
var now = new Date( );
if (window.serverSettings.settings.units == 'mmol') {
rec.sgv = Nightscout.units.mgdlToMMOL(rec.sgv);
}
$('.bgnow').html(rec.sgv + '<img id="arrow" src="">');
$('#arrow').attr('src', 'images/'+rec.direction+'.svg');
var threshold = 1000 * 60 * 13;
$('.bgnow').toggleClass('stale', (now - last > threshold));
var timeDivisor = (window.serverSettings.settings.timeFormat) ? window.serverSettings.settings.timeFormat : 12;
var today = new Date(),
h = today.getHours() % timeDivisor || timeDivisor,
m = today.getMinutes();
if (m < 10) m = "0" + m;
$('.clock').text(h + ":" + m);
}
<main>
<div class="inner">
<div id="trend">
<div id="bgnow"></div>
<div id="arrowDiv"><img id="arrow" src=""/></div>
</div>
<div id="clock"></div>
</div>
</main>
<script src="/api/v1/status.js"></script>
<script src="/js/bundle.js?v=<%= locals.cachebuster %>"></script>
function init ( ) {
console.log('init');
query( );
setInterval(query, 1 * 60 * 1000);
}
<script type="text/javascript">
function query ( ) {
console.log('query');
$.ajax('/api/v1/entries/current.json', { success: render });
}
init( );
</script>
function render (xhr) {
console.log('xhr', xhr);
var rec = xhr[0];
var last = new Date(rec.date);
var now = new Date( );
// Convert BG to mmol/L if necessary.
if (window.serverSettings.settings.units == 'mmol') {
rec.sgv = Nightscout.units.mgdlToMMOL(rec.sgv);
}
// Insert the BG value text.
$('#bgnow').html(rec.sgv);
// Insert the trend arrow.
$('#arrow').attr('src', 'images/'+rec.direction+'.svg');
// Time before data considered stale.
var staleMinutes = 13;
var threshold = 1000 * 60 * staleMinutes;
// Toggle stale if necessary.
$('#bgnow').toggleClass('stale', (now - last > threshold));
// Generate and insert the clock.
var timeDivisor = (window.serverSettings.settings.timeFormat) ? window.serverSettings.settings.timeFormat : 12;
var today = new Date(),
h = today.getHours() % timeDivisor || timeDivisor,
m = today.getMinutes();
if (m < 10) m = "0" + m;
$('#clock').text(h + ":" + m);
}
function init ( ) {
console.log('init');
query( );
setInterval(query, 1 * 60 * 1000);
}
init( );
</script>
</body>
</html>
+116 -62
View File
@@ -1,78 +1,132 @@
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Nightscout BG NOW</title>
<link href="/images/round1.png" rel="icon" id="favicon" type="image/png" />
<link rel='stylesheet' type='text/css' href='/css/main.css' />
<style type="text/css">
@import url("//fonts.googleapis.com/css?family=Open+Sans:700");
body {
text-align: center;
margin: 0 0;
padding: 0;
overflow: hidden;
font-family: 'Open Sans';
}
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;
}
.center {
width: 100%;
-webkit-transform: translateY(-3%);
}
h1 {
font-weight: 700;
font-size: 50vmin;
}
.stale {
text-decoration: line-through;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>Nightscout</title>
<link href="/images/round1.png" rel="icon" id="favicon" type="image/png" />
<link rel="apple-touch-icon" sizes="57x57" href="/images/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/images/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/images/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/images/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/images/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/images/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/images/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/images/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-180x180.png">
<style type="text/css">
@import url("//fonts.googleapis.com/css?family=Open+Sans:700");
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;
}
</style>
</head>
<body>
<main>
<div class="center">
<h1 class="bgnow"></h1>
<div class="inner">
<div id="bgnow"></div>
<div id="trend">
<div id="staleTime"></div>
</div>
</div>
</main>
<script src="/api/v1/status.js"></script>
<script src="/js/bundle.js?v=<%= locals.cachebuster %>"></script>
<script type="text/javascript">
function query ( ) {
console.log('query');
$.ajax('/api/v1/entries/current.json', { success: render });
}
<script type="text/javascript">
function query ( ) {
console.log('query');
$.ajax('/api/v1/entries/current.json', { success: render });
}
function render (xhr) {
console.log('xhr', xhr);
var rec = xhr[0];
var last = new Date(rec.date);
var now = new Date( );
if (window.serverSettings.settings.units == 'mmol') {
rec.sgv = Nightscout.units.mgdlToMMOL(rec.sgv);
}
$('.bgnow').text(rec.sgv);
var threshold = 1000 * 60 * 13;
$('.bgnow').toggleClass('stale', (now - last > threshold));
}
function render (xhr) {
console.log('xhr', xhr);
function init ( ) {
console.log('init');
query( );
setInterval(query, 1 * 60 * 1000);
}
var rec = xhr[0];
var last = new Date(rec.date);
var now = new Date( );
var elapsedMins = Math.round(((now - last) / 1000) / 60);
init( );
</script>
// Convert BG to mmol/L if necessary.
if (window.serverSettings.settings.units == 'mmol') {
rec.sgv = Nightscout.units.mgdlToMMOL(rec.sgv);
}
// Insert the BG value text.
$('#bgnow').text(rec.sgv);
// Insert the BG stale time text.
$('#staleTime').text(elapsedMins+' minutes ago');
// Time before data considered stale.
var staleMinutes = 13;
var threshold = 1000 * 60 * staleMinutes;
// Make the "x minutes ago" visible.
if (now - last > threshold) {
$('#staleTime').css('display', 'block');
} else {
$('#staleTime').css('display', 'none');
}
}
function init ( ) {
console.log('init');
query( );
setInterval(query, 1 * 60 * 1000);
}
init( );
</script>
</body>
</html>
+2 -1
View File
@@ -241,7 +241,7 @@
<dd><input type="checkbox" name="editmode-browser" id="editmode-browser" /><label for="editmode-browser" class="translate">Enable</label></dd>
</dl>
<dl id="show-rawbg-option" class="toggle">
<dt><span class="translate">Show Raw BG Data</span> <a class="tip" original-title="When enabled small white dots will be disaplyed for raw BG data"><i class="icon-help-circled"></i></a></dt>
<dt><span class="translate">Show Raw BG Data</span> <a class="tip" original-title="When enabled small white dots will be displayed for raw BG data"><i class="icon-help-circled"></i></a></dt>
<dd><input type="radio" name="show-rawbg" id="show-rawbg-never" value="never"/><label for="show-rawbg-never" class="translate">Never</label></dd>
<dd><input type="radio" name="show-rawbg" id="show-rawbg-always" value="always"/><label for="show-rawbg-always" class="translate">Always</label></dd>
<dd><input type="radio" name="show-rawbg" id="show-rawbg-noise" value="noise"/><label for="show-rawbg-noise" class="translate">When there is noise</label></dd>
@@ -280,6 +280,7 @@
</p>
<div class="links">
<a href="https://github.com/nightscout/cgm-remote-monitor/releases" target="_blank">Release Notes</a><br />
<a href="http://nightscout.github.io/pages/update-fork/">Check for Updates</a><br />
<a href="http://github.com/nightscout/cgm-remote-monitor" target="_blank">Open Source</a><br />
<a href="http://www.nightscout.info" target="_blank">Nightscout Info</a><br />
<a href="https://www.facebook.com/groups/cgminthecloud/" target="_blank">CGM in the Cloud</a><br />
+4 -3
View File
@@ -100,11 +100,12 @@
<tr>
<td colspan="2">
<span class="translate">Order</span>:
<input type="radio" name="rp_sorting" id="rp_oldestontop" checked>
<!-- many email GUIs place newest on top, less scrolling, adjusting my nightscout to do that too! -dboland -->
<input type="radio" name="rp_sorting" id="rp_oldestontop">
<label for="rp_oldestontop" class="translate">oldest on top</label>
&nbsp;
<input type="radio" name="rp_sorting" id="rp_newestontop">
<label for="rp_oldestontop" class="translate">newest on top</label>
<input type="radio" name="rp_sorting" id="rp_newestontop" checked>
<label for="rp_newestontop" class="translate">newest on top</label>
</td>
<td></td>
</tr>