Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

30.0.3 #214

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
7 changes: 4 additions & 3 deletions src/cockpit.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ io.sockets.on('connection', function (socket) {
socket.emit('settings', CONFIG.preferences.get());
var lastping = 0;
socket.on('ping', function (id) {
socket.emit('pong', id);
if (new Date().getTime() - lastping > 1000) {
if (Math.abs(new Date().getTime() - lastping) > 500) {
controller.send('ping(0)');
lastping = new Date().getTime();
}
socket.emit('pong', id);
}
controller.send('ping(0)');
});
socket.on('tilt_update', function (value) {
controller.sendTilt(value);
Expand Down
7 changes: 4 additions & 3 deletions src/plugins/capestatus/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ function capestatus(name, deps) {
if (preferences === undefined) {
preferences = {
batteries: [
new Battery('TrustFire', 8.0, 13.0)
new Battery('TrustFire', 8.0, 13.0),
new Battery('LiFePO4', 7.0, 10.0)
],
selectedBattery: 'TrustFire'
selectedBattery: 'LiFePO4'
};
config.preferences.set(PREFERENCES, preferences);
}
Expand All @@ -98,4 +99,4 @@ function capestatus(name, deps) {
}

}
module.exports = capestatus;
module.exports = capestatus;
4 changes: 2 additions & 2 deletions src/plugins/lights/public/js/lights.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ $( document ).ready(function() {
description: "lights for keymapping.",
defaults: { keyboard: 'alt+p' },
down: function() {
self.setLights(intensity+.1);
self.setLights(self.intensity+.1);
}
},
{
name: "lights.keyBoardMapping",
description: "lights for keymapping.",
defaults: { keyboard: 'alt+o' },
down: function() { self.setLights(intensity-.1); }
down: function() { self.setLights(self.intensity-.1); }
}
]
);
Expand Down
8 changes: 5 additions & 3 deletions src/plugins/photocapture/public/js/photocapture.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
$('#photos').load(jsFileLocation + '../photospanel.html', function () {
// Register the various event handlers
ko.applyBindings(self, $('#photos')[0]);

$('#photos .back-button').click(function () {
self.hidePhotos();
});

});
};
//This pattern will hook events in the cockpit and pull them all back
Expand Down Expand Up @@ -53,9 +58,6 @@
self.hidePhotos();
});
});
$('#photos .back-button').click(function () {
photoc.hidePhotos();
});
};
Photocapture.prototype.hidePhotos = function hidePhoto() {
$('#photos').hide('fold');
Expand Down