Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
bf20564858 | |||
0a083ba8cc | |||
9bd00cdab7 | |||
60e76118e3 | |||
98b5208adb | |||
0224a1cd0a | |||
563edb4f5d |
15
Makefile
15
Makefile
@ -1,10 +1,14 @@
|
|||||||
build :
|
VERSION =1.4
|
||||||
|
BUILD_NUMBER_FILE = build-number.txt
|
||||||
|
BUILD_NUMBER = $$(cat $(BUILD_NUMBER_FILE))
|
||||||
|
|
||||||
|
build : increment-build-number
|
||||||
mkdir -p build/css
|
mkdir -p build/css
|
||||||
cp src/www/*.* build
|
cp src/www/*.* build
|
||||||
cp -r src/www/js build
|
cp -r src/www/js build
|
||||||
cp -r resources/* build/.
|
cp -r resources/* build/.
|
||||||
sass src/www/css/personal-display.scss build/css/personal-display.css
|
sass src/www/css/personal-display.scss build/css/personal-display.css
|
||||||
tar czf personal-display.tar.gz build
|
tar czf personal-display-$(VERSION).$(BUILD_NUMBER).tar.gz build
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
rm -r build
|
rm -r build
|
||||||
@ -12,3 +16,10 @@ clean :
|
|||||||
local-deploy: build
|
local-deploy: build
|
||||||
cp -r build ~/temp/server
|
cp -r build ~/temp/server
|
||||||
ssh jdb-server 'rm -r ~/public_html/personal-display; mv temp/build ~/public_html/personal-display'
|
ssh jdb-server 'rm -r ~/public_html/personal-display; mv temp/build ~/public_html/personal-display'
|
||||||
|
|
||||||
|
increment-build-number:
|
||||||
|
if ! test -f $(BUILD_NUMBER_FILE); then echo 0 > $(BUILD_NUMBER_FILE); fi
|
||||||
|
echo $$(($$(cat $(BUILD_NUMBER_FILE)) + 1)) > $(BUILD_NUMBER_FILE)
|
||||||
|
|
||||||
|
test-build-number:
|
||||||
|
touch $(BUILD_NUMBER).text.txt
|
||||||
|
1
build-number.txt
Normal file
1
build-number.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
4
|
@ -250,3 +250,23 @@ body > section {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 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; } } }
|
||||||
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<!DOCTYPE HTML>
|
<!DOCTYPE HTML>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
<title>What I am Doing</title>
|
<title>What I am Doing</title>
|
||||||
<link rel="stylesheet" href="css/personal-display.css" type="text/css">
|
<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'>
|
<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>
|
<script src="js/personal-display.js" type="text/javascript" defer></script>
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, user-scalable=no">
|
<meta name="viewport" content="width=device-width, user-scalable=no">
|
||||||
|
<meta name=version content="1.4">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<section id=current-task>
|
<section id=current-task>
|
||||||
@ -30,6 +32,14 @@
|
|||||||
<section id=priorities>
|
<section id=priorities>
|
||||||
<h3>Next Actions (unsorted)</h3>
|
<h3>Next Actions (unsorted)</h3>
|
||||||
</section>
|
</section>
|
||||||
|
<section id=main-buttons>
|
||||||
|
<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>
|
<section id=config-dialog>
|
||||||
<form>
|
<form>
|
||||||
<h3>Configuration</h3>
|
<h3>Configuration</h3>
|
||||||
@ -63,7 +73,7 @@
|
|||||||
<div class=button-panel>
|
<div class=button-panel>
|
||||||
<div class=global-config>
|
<div class=global-config>
|
||||||
<label>Refresh (sec): </label>
|
<label>Refresh (sec): </label>
|
||||||
<input type=text class=refresh></div>
|
<input type=text class=refresh-period></div>
|
||||||
<div class=save-button><a href="#">Save and Close</a></div>
|
<div class=save-button><a href="#">Save and Close</a></div>
|
||||||
</div>
|
</div>
|
||||||
<div class=wait-overlay><img src="img/loading-spinner.gif"><br><span></span></div>
|
<div class=wait-overlay><img src="img/loading-spinner.gif"><br><span></span></div>
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
var root = this;
|
var root = this;
|
||||||
|
|
||||||
var PD = root.PersonalDisplay = {};
|
var PD = root.PersonalDisplay = {};
|
||||||
|
PD.version = "1.4"
|
||||||
|
|
||||||
PD.hasHTML5LocalStorage = function() {
|
PD.hasHTML5LocalStorage = function() {
|
||||||
try {
|
try {
|
||||||
@ -146,7 +147,7 @@
|
|||||||
$(".category-name").parent().remove();
|
$(".category-name").parent().remove();
|
||||||
_.forEach(PD.gtdCfg.categories, this.makeCategoryItem); }
|
_.forEach(PD.gtdCfg.categories, this.makeCategoryItem); }
|
||||||
|
|
||||||
this.$el.find('.refresh').val(
|
this.$el.find('.refresh-period').val(
|
||||||
PD.refreshPeriod ? PD.refreshPeriod / 1000 : 15);
|
PD.refreshPeriod ? PD.refreshPeriod / 1000 : 15);
|
||||||
|
|
||||||
this.$el.fadeIn(); },
|
this.$el.fadeIn(); },
|
||||||
@ -322,7 +323,7 @@
|
|||||||
function(span) { return $(span).text(); });
|
function(span) { return $(span).text(); });
|
||||||
|
|
||||||
// Save global data
|
// Save global data
|
||||||
PD.refreshPeriod = parseInt(this.$el.find(".refresh").val()) * 1000;
|
PD.refreshPeriod = parseInt(this.$el.find(".refresh-period").val()) * 1000;
|
||||||
|
|
||||||
if (PD.hasHTML5LocalStorage()) {
|
if (PD.hasHTML5LocalStorage()) {
|
||||||
localStorage.setItem("tsCfg", JSON.stringify(PD.tsCfg));
|
localStorage.setItem("tsCfg", JSON.stringify(PD.tsCfg));
|
||||||
@ -337,9 +338,15 @@
|
|||||||
PD.Main = Backbone.View.extend({
|
PD.Main = Backbone.View.extend({
|
||||||
el: $("body"),
|
el: $("body"),
|
||||||
|
|
||||||
|
events: {
|
||||||
|
"click a.refresh" : "refresh",
|
||||||
|
"click a.pause-continue" : "toggleSync",
|
||||||
|
"click a.show-config" : "showConfig",
|
||||||
|
"click a.toggle-fullscreen" : "toggleFullscreen" },
|
||||||
|
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
|
|
||||||
_.bindAll(this, "refresh");
|
_.bindAll(this, "refresh", "toggleSync");
|
||||||
|
|
||||||
// Create our config dialog view.
|
// Create our config dialog view.
|
||||||
PD.configDialog = new PD.ConfigDialog();
|
PD.configDialog = new PD.ConfigDialog();
|
||||||
@ -366,10 +373,11 @@
|
|||||||
this.refresh();
|
this.refresh();
|
||||||
|
|
||||||
// Schedule future refreshes.
|
// Schedule future refreshes.
|
||||||
setInterval(this.refresh, PD.refreshPeriod ? PD.refreshPeriod : 15000);
|
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
|
// If the dialog is still open we skip this sync to give the user
|
||||||
// a chance to finish configuration.
|
// a chance to finish configuration.
|
||||||
if ($("#config-dialog").is(":visible")) { return; }
|
if ($("#config-dialog").is(":visible")) { return; }
|
||||||
@ -492,6 +500,50 @@
|
|||||||
collection.remove(model); }});
|
collection.remove(model); }});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (evt) evt.preventDefault();
|
||||||
|
},
|
||||||
|
|
||||||
|
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);
|
||||||
|
$('.pause-continue').text('Pause Monitoring'); }
|
||||||
|
else {
|
||||||
|
clearInterval(PD.refreshIntervalId);
|
||||||
|
PD.refreshIntervalId = null;
|
||||||
|
$('.pause-continue').text('Resume Monitoring'); }
|
||||||
|
|
||||||
|
|
||||||
|
if (evt) evt.preventDefault();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user