Skip to content

Commit

Permalink
Merge pull request #5 from nightscout/express-cache
Browse files Browse the repository at this point in the history
Express cache
  • Loading branch information
brianhanifin committed Jun 30, 2014
2 parents 9c1a879 + 514718f commit 97ca423
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<li><a href="#" data-snooze-time="1800000">Silence for 30 minutes</a></li>
<li><a href="#" data-snooze-time="3600000">Silence for 60 minutes</a></li>
<li><a href="#" data-snooze-time="5400000">Silence for 90 minutes</a></li>
<li><a href="#" data-snooze-time="7200000">Silence for 120 minutes</a></li>
</ul>
</div>
</div>
Expand All @@ -43,6 +44,6 @@
<script src='/bower_components/d3/d3.min.js'></script>
<script src='/bower_components/jquery/dist/jquery.min.js'></script>
<script src='/js/dropdown.js'></script>
<script src='/js/client.js'></script>
<script src='/js/client.js?a'></script>
</body>
</html>
6 changes: 4 additions & 2 deletions static/js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
var focusData = data.slice();

var element = document.getElementById('bgButton').hidden == '';
var nowDate = new Date(brushExtent[1] - THIRTY_MINS_IN_MS);

// predict for retrospective data
if (retrospectivePredictor && brushExtent[1].getTime() - THIRTY_MINS_IN_MS < now && element != true) {
Expand Down Expand Up @@ -205,6 +206,7 @@
} else if (retrospectivePredictor) {
// if the brush comes back into the current time range then it should reset to the current time and sg
var dateTime = new Date(now);
nowDate = dateTime;
$('#currentTime')
.text(d3.time.format('%I:%M%p')(dateTime))
.css('text-decoration','none');
Expand Down Expand Up @@ -272,9 +274,9 @@
focus.select('.now-line')
.transition()
.duration(UPDATE_TRANS_MS)
.attr('x1', xScale(new Date(brushExtent[1].getTime() - THIRTY_MINS_IN_MS)))
.attr('x1', xScale(nowDate))
.attr('y1', yScale(36))
.attr('x2', xScale(new Date(brushExtent[1].getTime() - THIRTY_MINS_IN_MS)))
.attr('x2', xScale(nowDate))
.attr('y2', yScale(420));

// update x axis
Expand Down

0 comments on commit 97ca423

Please sign in to comment.