Code formatting.

This commit is contained in:
Wouter R 2014-03-05 13:49:15 +01:00
parent 5c5d45088a
commit 2457ce656e
2 changed files with 414 additions and 407 deletions

View File

@ -146,9 +146,11 @@ function Printer() {
this.sendPrintPart(this.sendIndex, this.sendLength);
}
this.byteSize = function(s){
return~-encodeURI(s).split(/%..|./).length;
}
this.sendPrintPart = function(sendIndex,sendLength) {
console.log("Printer:sendPrintPart sendIndex: " + sendIndex + "/" + this.gcode.length + ", sendLength: " + sendLength);
@ -258,6 +260,7 @@ function Printer() {
console.log ("Printer >> f:communicateWithWifibox() >> communicateWithWifibox is false, so not executing this function");
}
}
this.startStatusCheckInterval = function() {
console.log("Printer:startStatusCheckInterval");
self.checkStatus();
@ -265,11 +268,13 @@ function Printer() {
clearTimeout(self.retryCheckStatusDelay);
self.checkStatusDelay = setTimeout(function() { self.checkStatus() }, self.checkStatusInterval);
}
this.stopStatusCheckInterval = function() {
console.log("Printer:stopStatusCheckInterval");
clearTimeout(self.checkStatusDelay);
clearTimeout(self.retryCheckStatusDelay);
}
this.checkStatus = function() {
//console.log("Printer:checkStatus");
this.stateOverruled = false;
@ -301,6 +306,7 @@ function Printer() {
console.log ("Printer >> f:checkStatus() >> communicateWithWifibox is false, so not executing this function");
}
}
this.handleStatusUpdate = function(response) {
//console.log("Printer:handleStatusUpdate response: ",response);
var data = response.data;
@ -332,6 +338,7 @@ function Printer() {
}
$(document).trigger(Printer.UPDATE);
}
this.overruleState = function(newState) {
this.stateOverruled = true;
console.log(" stateOverruled: ",this.stateOverruled);
@ -346,6 +353,7 @@ function Printer() {
this.removeLeaveWarning = function() {
window.onbeforeunload = null;
}
this.addLeaveWarning = function() {
window.onbeforeunload = function() {
console.log("WARNING:"+Printer.ON_BEFORE_UNLOAD_MESSAGE);

View File

@ -104,6 +104,7 @@ function initButtonBehavior() {
function onLogo() {
location.reload();
}
function onBtnAdd() {
buttonGroupAdd.fadeToggle(BUTTON_GROUP_SHOW_DURATION);
}
@ -337,8 +338,6 @@ function resetTwist() {
}
function update() {
setState(printer.state,printer.hasControl);
thermometer.update(printer.temperature, printer.targetTemperature);