4 Commits
1.1 ... 1.4

5 changed files with 69 additions and 7 deletions

View File

@ -1,4 +1,4 @@
VERSION =1.1
VERSION =1.4
BUILD_NUMBER_FILE = build-number.txt
BUILD_NUMBER = $$(cat $(BUILD_NUMBER_FILE))

View File

@ -1 +1 @@
0
4

View File

@ -250,3 +250,23 @@ body > section {
margin: 0;
padding: 0 } }
}
#main-buttons {
border-top: solid 2px $accent1;
ul {
list-style: none;
padding: 0;
margin: 0;
li {
display: inline-block;
margin: 0;
a {
border: $accent2 solid thin;
border-radius: 5px;
display: block;
cursor: pointer;
padding: 0.1rem 0.3rem; } } }
}

View File

@ -1,6 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>What I am Doing</title>
<link rel="stylesheet" href="css/personal-display.css" type="text/css">
<link href='//fonts.googleapis.com/css?family=Play|Advent+Pro' rel='stylesheet' type='text/css'>
@ -20,6 +21,7 @@
<script src="js/personal-display.js" type="text/javascript" defer></script>
<meta name="viewport" content="width=device-width, user-scalable=no">
<meta name=version content="1.4">
</head>
<body>
<section id=current-task>
@ -34,6 +36,8 @@
<ul>
<li><a href="#" class=pause-continue>Pause Monitoring</a></li>
<li><a href="#" class=refresh>Refresh Now</a></li>
<li><a href="#" class=show-config>Config</a></li>
<li><a href="#" class=toggle-fullscreen>Go Fullscreen</a></li>
</ul>
</section>
<section id=config-dialog>

View File

@ -2,6 +2,7 @@
var root = this;
var PD = root.PersonalDisplay = {};
PD.version = "1.4"
PD.hasHTML5LocalStorage = function() {
try {
@ -338,8 +339,10 @@
el: $("body"),
events: {
"click a.refresh" : "refresh"
"click a.pause-continue" : "toggleSync" },
"click a.refresh" : "refresh",
"click a.pause-continue" : "toggleSync",
"click a.show-config" : "showConfig",
"click a.toggle-fullscreen" : "toggleFullscreen" },
initialize: function() {
@ -371,9 +374,10 @@
// Schedule future refreshes.
PD.refreshIntervalId = setInterval(this.refresh, PD.refreshPeriod ? PD.refreshPeriod : 15000);
},
refresh: function() {
refresh: function(evt) {
// If the dialog is still open we skip this sync to give the user
// a chance to finish configuration.
if ($("#config-dialog").is(":visible")) { return; }
@ -496,9 +500,39 @@
collection.remove(model); }});
}
});
if (evt) evt.preventDefault();
},
toggleSync: function() {
showConfig: function() { PD.configDialog.show(); },
toggleFullscreen: function(evt) {
var $button = $(evt.target);
if ($button.text() == "Go Fullscreen") {
if (document.documentElement.requestFullscreen) {
document.documentElement.requestFullscreen(); }
else if (document.documentElement.webkitRequestFullscreen) {
document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT); }
else if (document.documentElement.mozRequestFullScreen) {
document.documentElement.mozRequestFullScreen(); }
else { alert ("Not supported by this browser."); }
$button.text("Leave Fullscreen"); }
else {
if (document.exitFullscreen) {
document.exitFullscreen(); }
else if (document.webkitExitFullscreen) {
document.webkitExitFullscreen(); }
else if (document.mozCancelFullscreen) {
document.documentElement.mozCancelFullscreen(); }
else { alert ("Not supported by this browser."); }
$button.text("Go Fullscreen"); } },
toggleSync: function(evt) {
if (PD.refreshIntervalId == null) {
PD.refreshIntervalId = setInterval(this.refresh,
PD.refreshPeriod ? PD.refreshPeriod : 15000);
@ -506,7 +540,11 @@
else {
clearInterval(PD.refreshIntervalId);
PD.refreshIntervalId = null;
$('.pause-continue').text('Resume Monitoring'); } }
$('.pause-continue').text('Resume Monitoring'); }
if (evt) evt.preventDefault();
}
});
PD.main = new PD.Main();