0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-22 17:27:57 +01:00

Merge branch 'feature/printerdriver' into feature/savingsketches

This commit is contained in:
Wouter R 2013-10-22 20:49:20 +02:00
commit feae8ba3e6
71 changed files with 5861 additions and 265 deletions

29
.gitignore vendored
View File

@ -1,2 +1,29 @@
node_modules
.project .project
.idea/*
__index.html
_index.html
div_bgs.html
img/thermo_bg_2.png
img/thermo_fg_2.png
img/logo/logo_full_8bit.png
img/logo/logo_small BACKUP.png
img/logo/logo_small_8bit.png
img/logo/logo_smaller.png
img/logo/logo_smaller_8bit.png
img/logo/logo_smaller_wide_8bit.png
img/logo/logo_smallest.png
css/_backup20131010/*
css/_backup20131011/*
d3d_btns.css
index.html.orig
js/Thermometer.js.orig
js/buttonbehaviors.js.orig
js/gcodeGenerating_v01.js.orig
js/init_layout backup20130918.js
js/main.js.orig
js/previewRendering_v02.js.orig
less/verticalshapes.css
less/verticalshapes_backup.css
__settings.html
css/_settings.css
node_modules/*

View File

@ -16,21 +16,22 @@ module.exports = function(grunt) {
}, },
dist: { dist: {
src: [ src: [
'www/js/SettingsWindow.js', 'js_src/SettingsWindow.js',
'www/js/d3dServerInterfacing.js', 'js_src/UpdatePanel.js',
'www/js/verticalShapes.js', 'js_src/d3dServerInterfacing.js',
'www/js/buttonbehaviors.js', 'js_src/verticalShapes.js',
'www/js/canvasDrawing.js', 'js_src/buttonbehaviors.js',
'www/js/previewRendering.js', 'js_src/canvasDrawing.js',
'www/js/gcodeGenerating.js', 'js_src/previewRendering.js',
'www/js/init_layout.js', 'js_src/gcodeGenerating.js',
'www/js/Printer.js', 'js_src/init_layout.js',
'www/js/Progressbar.js', 'js_src/Printer.js',
'www/js/Thermometer.js', 'js_src/Progressbar.js',
'www/js/utils.js', 'js_src/Thermometer.js',
'www/js/sidebar.js', 'js_src/utils.js',
'www/js/message.js', 'js_src/sidebar.js',
'www/js/main.js' 'js_src/Message.js',
'js_src/main.js'
], ],
dest: 'www/js/<%= pkg.name %>.js' dest: 'www/js/<%= pkg.name %>.js'
} }
@ -38,15 +39,21 @@ module.exports = function(grunt) {
uglify: { uglify: {
options: { options: {
// banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n', // banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
mangle: false, mangle: true,
beautify: false, beautify: false,
compress: {}, compress: {},
report: 'min', report: 'min',
preserveComments: 'false' preserveComments: 'false'
}, },
build: { build: {
src: ['www/js/*.js', '!www/js/<%= pkg.name %>.min.js'], files: {
dest: 'www/js/<%= pkg.name %>.min.js' // 'www/js/<%= pkg.name %>.min.js' : ['www/js/*.js', '!www/js/<%= pkg.name %>.min.js', '!www/js/<%= pkg.name %>.js']
'www/js/<%= pkg.name %>.min.js' : ['www/js/<%= pkg.name %>.js']
}
// src: 'www/js/*.js',
// dest: 'www/js/min/blabla.js'
// src: ['www/js/*.js', '!www/js/<%= pkg.name %>.min.js'],
// dest: 'www/js/<%= pkg.name %>.min.js'
} }
}, },
jshint: { jshint: {
@ -85,11 +92,11 @@ module.exports = function(grunt) {
} }
}, },
watch: { watch: {
// javascript: { javascript: {
// files: ["www/js/*", '!www/js/*.min.js'], files: ["js_src/*", '!www/js/<%= pkg.name %>.min.js', '!www/js/<%= pkg.name %>.js'],
// // tasks: ["less", "css_prefix"] tasks: ["concat", "uglify"]
// tasks: ["uglify"] // tasks: ["jshint", "concat", "uglify"]
// }, },
styles: { styles: {
files: ["less/*"], files: ["less/*"],
tasks: ["less", "autoprefixer", "cssmin"] tasks: ["less", "autoprefixer", "cssmin"]
@ -133,8 +140,8 @@ module.exports = function(grunt) {
'less', 'less',
'autoprefixer', 'autoprefixer',
'cssmin', 'cssmin',
// 'concat', 'concat',
// 'uglify', 'uglify',
// 'jshint', // 'jshint',
'watch' 'watch'
]); ]);

64
Makefile Normal file
View File

@ -0,0 +1,64 @@
################################################
# OpenWrt Makefile for Doodle3D Print3D driver #
################################################
include $(TOPDIR)/rules.mk
PKG_NAME := doodle3d-client
PKG_VERSION := 0.9.0
PKG_RELEASE := 1
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/doodle3d-client
SECTION:=mods
CATEGORY:=Doodle3D
TITLE:=Doodle3D web client
DEPENDS:=
endef
define Package/doodle3d-client/description
This package provides the Doodle3D web client, which interacts with the wifibox package using a REST API.
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) less $(PKG_BUILD_DIR)/
$(CP) www $(PKG_BUILD_DIR)/
$(CP) Gruntfile.js $(PKG_BUILD_DIR)/
$(CP) README.md $(PKG_BUILD_DIR)/
$(CP) ___settings.html $(PKG_BUILD_DIR)/
$(CP) lesstocss.sh $(PKG_BUILD_DIR)/
$(CP) package.json $(PKG_BUILD_DIR)/
endef
define Build/Compile
npm install
grunt less autoprefixer cssmin concat uglify
endef
define Package/doodle3d-client/install
$(INSTALL_DIR) $(1)/www
$(INSTALL_DIR) $(1)/www/css
$(INSTALL_DIR) $(1)/www/img
#$(INSTALL_DIR) $(1)/www/js
$(INSTALL_DIR) $(1)/www/js/libs
$(CP) $(PKG_BUILD_DIR)/www/favicon* $(1)/www/
$(CP) $(PKG_BUILD_DIR)/www/index.html $(1)/www/
$(CP) $(PKG_BUILD_DIR)/www/settings.html $(1)/www/
$(CP) $(PKG_BUILD_DIR)/www/css/debug.min.css $(1)/www/css/
$(CP) $(PKG_BUILD_DIR)/www/css/settings.min.css $(1)/www/css/
$(CP) $(PKG_BUILD_DIR)/www/css/styles.min.css $(1)/www/css/
$(CP) $(PKG_BUILD_DIR)/www/img/* $(1)/www/img/
$(CP) $(PKG_BUILD_DIR)/www/js/doodle3d-client.min.js $(1)/www/js/
$(CP) $(PKG_BUILD_DIR)/www/js/libs/* $(1)/www/js/libs/
$(CP) $(PKG_BUILD_DIR)/www/library $(1)/www/
endef
$(eval $(call BuildPackage,doodle3d-client))

View File

@ -1 +1,13 @@
Doodle3D client app Doodle3D client app
===================
# How to build
## Prerequisites
- get `npm`, the Node.js package manager, for instance using macports on OSX.
- (prerequisite) install Grunt: `npm install -g grunt-cli`.
- run npm install in the project root to install project dependencies
Finally run grunt to build minified css and js files. By default, it will keep
running to automatically rebuild when source files are changed.

0
___settings.html Executable file → Normal file
View File

BIN
img_old/icon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
img_old/logo/logo_full.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
img_old/logo/logo_small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

View File

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -69,7 +69,6 @@ function SettingsWindow() {
SettingsWindow.AP = "ap"; SettingsWindow.AP = "ap";
SettingsWindow.CREATING_AP = "creating ap"; SettingsWindow.CREATING_AP = "creating ap";
SettingsWindow.API_CONNECTING_FAILED = -1 SettingsWindow.API_CONNECTING_FAILED = -1
SettingsWindow.API_NOT_CONNECTED = 0 SettingsWindow.API_NOT_CONNECTED = 0
SettingsWindow.API_CONNECTING = 1 SettingsWindow.API_CONNECTING = 1
@ -77,6 +76,15 @@ function SettingsWindow() {
SettingsWindow.API_CREATING = 3 SettingsWindow.API_CREATING = 3
SettingsWindow.API_CREATED = 4 SettingsWindow.API_CREATED = 4
// network mode
SettingsWindow.NETWORK_MODE_NEITHER = "neither";
SettingsWindow.NETWORK_MODE_CLIENT = "clientMode";
SettingsWindow.NETWORK_MODE_ACCESS_POINT = "accessPointMode";
this.networkMode = SettingsWindow.NETWORK_MODE_NEITHER;
this.updatePanel = new UpdatePanel();
var self = this; var self = this;
this.init = function(wifiboxURL,wifiboxCGIBinURL) { this.init = function(wifiboxURL,wifiboxCGIBinURL) {
@ -108,6 +116,10 @@ function SettingsWindow() {
btnConnect.on('touchstart mousedown',self.connectToNetwork); btnConnect.on('touchstart mousedown',self.connectToNetwork);
btnCreate.on('touchstart mousedown',self.createAP); btnCreate.on('touchstart mousedown',self.createAP);
networkSelector.change(self.networkSelectorChanged); networkSelector.change(self.networkSelectorChanged);
// update panel
var $updatePanelElement = self.form.find("#updatePanel");
self.updatePanel.init(wifiboxURL,$updatePanelElement);
}); });
} }
this.submitwindow = function(e) { this.submitwindow = function(e) {
@ -360,6 +372,8 @@ function SettingsWindow() {
//console.log(" not connected & not a access point"); //console.log(" not connected & not a access point");
self.apFieldSet.show(); self.apFieldSet.show();
self.clientFieldSet.show(); self.clientFieldSet.show();
self.networkMode = SettingsWindow.NETWORK_MODE_NEITHER;
break; break;
case SettingsWindow.API_CONNECTING_FAILED: case SettingsWindow.API_CONNECTING_FAILED:
case SettingsWindow.API_CONNECTING: case SettingsWindow.API_CONNECTING:
@ -380,7 +394,7 @@ function SettingsWindow() {
} else { } else {
self.currentLocalIP = "" self.currentLocalIP = ""
} }
self.networkMode = SettingsWindow.NETWORK_MODE_CLIENT;
break; break;
case SettingsWindow.API_CREATING: case SettingsWindow.API_CREATING:
case SettingsWindow.API_CREATED: case SettingsWindow.API_CREATED:
@ -398,8 +412,10 @@ function SettingsWindow() {
if(data.ssid && data.status == SettingsWindow.API_CREATED) { if(data.ssid && data.status == SettingsWindow.API_CREATED) {
self.currentAP = data.ssid; self.currentAP = data.ssid;
} }
self.networkMode = SettingsWindow.NETWORK_MODE_ACCESS_POINT;
break; break;
} }
self.updatePanel.setNetworkMode(self.networkMode);
// update status message // update status message
switch(data.status) { switch(data.status) {
@ -456,6 +472,8 @@ function SettingsWindow() {
this.selectNetwork = function(ssid) { this.selectNetwork = function(ssid) {
console.log("select network: ",ssid); console.log("select network: ",ssid);
if(ssid == "") return;
console.log(" checked");
this.selectedNetwork = ssid; this.selectedNetwork = ssid;
if(this.networks == undefined || ssid == SettingsWindow.NOT_CONNECTED) { if(this.networks == undefined || ssid == SettingsWindow.NOT_CONNECTED) {
this.hideWiFiPassword(); this.hideWiFiPassword();

230
js_src/UpdatePanel.js Normal file
View File

@ -0,0 +1,230 @@
function UpdatePanel() {
this.wifiboxURL;
this.element;
this.statusCheckInterval = 1000;
this.statusCheckDelayer; // setTimout instance
this.installedDelay = 60*1000; // Since we can't retrieve status during installation we show the installed text after a fixed delay
this.installedDelayer; // setTimout instance
this.retryDelay = 1000;
this.retryDelayer; // setTimout instance
//this.timeoutTime = 3000;
this.canUpdate = false;
this.currentVersion = "";
this.newestVersion;
this.progress;
this.imageSize;
// states from api, see Doodle3D firmware src/script/d3d-updater.lua
UpdatePanel.NONE = 1; // default state
UpdatePanel.DOWNLOADING = 2;
UpdatePanel.DOWNLOAD_FAILED = 3;
UpdatePanel.IMAGE_READY = 4; // download successfull and checked
UpdatePanel.INSTALLING = 5;
UpdatePanel.INSTALLED = 6;
UpdatePanel.INSTALL_FAILED = 7;
this.state; // update state from api
this.stateText = ""; // update state text from api
this.networkMode; // network modes from SettingsWindow
var self = this;
this.init = function(wifiboxURL,updatePanelElement) {
this.wifiboxURL = wifiboxURL;
this.element = updatePanelElement;
this.btnUpdate = this.element.find("#update");
this.statusDisplay = this.element.find("#updateState");
this.infoDisplay = this.element.find("#updateInfo");
this.btnUpdate.click(this.update);
this.checkStatus(false);
}
this.update = function() {
console.log("UpdatePanel:update");
self.downloadUpdate();
}
this.downloadUpdate = function() {
console.log("UpdatePanel:downloadUpdate");
$.ajax({
url: self.wifiboxURL + "/update/download",
type: "POST",
dataType: 'json',
success: function(response){
console.log("UpdatePanel:downloadUpdate response: ",response);
}
}).fail(function() {
console.log("UpdatePanel:downloadUpdate: failed");
});
self.setState(UpdatePanel.DOWNLOADING);
self.startCheckingStatus();
}
this.installUpdate = function() {
console.log("UpdatePanel:installUpdate");
self.stopCheckingStatus();
$.ajax({
url: self.wifiboxURL + "/update/install",
type: "POST",
dataType: 'json',
success: function(response){
console.log("UpdatePanel:installUpdate response: ",response);
}
}).fail(function() {
console.log("UpdatePanel:installUpdate: no respons (there shouldn't be)");
});
self.setState(UpdatePanel.INSTALLING);
clearTimeout(self.installedDelayer);
self.installedDelayer = setTimeout(function() { self.setState(UpdatePanel.INSTALLED) },self.installedDelay);
}
this.startCheckingStatus = function() {
clearTimeout(self.statusCheckDelayer);
clearTimeout(self.retryDelayer);
self.statusCheckDelayer = setTimeout(function() { self.checkStatus(true) },self.statusCheckInterval);
}
this.stopCheckingStatus = function() {
clearTimeout(self.statusCheckDelayer);
clearTimeout(self.retryDelayer);
}
this.checkStatus = function(keepChecking) {
if (!communicateWithWifibox) return;
$.ajax({
url: self.wifiboxURL + "/update/status",
type: "GET",
dataType: 'json',
//timeout: self.timeoutTime,
success: function(response){
console.log("UpdatePanel:checkStatus response: ",response);
// Keep checking ?
if(keepChecking) {
switch(self.state){
case UpdatePanel.DOWNLOADING:
case UpdatePanel.INSTALLING:
clearTimeout(self.statusCheckDelayer);
self.statusCheckDelayer = setTimeout(function() { self.checkStatus(keepChecking) },self.statusCheckInterval);
break;
}
}
if(response.status != "error") {
var data = response.data;
self.handleStatusData(data);
}
}
}).fail(function() {
//console.log("UpdatePanel:checkStatus: failed");
if(keepChecking) {
clearTimeout(self.retryDelayer);
self.retryDelayer = setTimeout(function() { self.checkStatus(keepChecking) },self.retryDelay); // retry after delay
}
});
}
this.handleStatusData = function(data) {
//console.log("UpdatePanel:handleStatusData");
self.canUpdate = data.can_update;
if(self.currentVersion != data.current_version || self.newestVersion != data.newest_version) {
self.currentVersion = data.current_version;
self.newestVersion = data.newest_version;
self.updateInfoDisplay();
}
self.stateText = data.state_text;
self.progress = data.progress; // not always available
self.imageSize = data.image_size; // not always available
self.setState(data.state_code);
switch(this.state){
case UpdatePanel.IMAGE_READY:
self.installUpdate();
break;
}
}
this.setState = function(newState) {
if(this.state == newState) return;
console.log("UpdatePanel:setState: ",this.state," > ",newState,"(",this.stateText,") (networkMode: ",self.networkMode,") (newestVersion: ",self.newestVersion,")");
this.state = newState;
// download button
// if there isn't newestVersion data something went wrong,
// probably accessing the internet
if(self.newestVersion != undefined) {
switch(this.state){
case UpdatePanel.NONE:
case UpdatePanel.DOWNLOAD_FAILED:
case UpdatePanel.INSTALL_FAILED:
if(self.canUpdate) {
self.btnUpdate.removeAttr("disabled");
} else {
self.btnUpdate.attr("disabled", true);
}
break;
default:
self.btnUpdate.attr("disabled", true);
break;
}
} else {
self.btnUpdate.attr("disabled", true);
}
this.updateStatusDisplay();
}
this.updateStatusDisplay = function() {
var text = "";
if(self.newestVersion != undefined) {
switch(this.state){
case UpdatePanel.NONE:
if(self.canUpdate) {
text = "Update(s) available.";
} else {
text = "You're up to date.";
}
break;
case UpdatePanel.DOWNLOADING:
text = "Downloading update...";
break;
case UpdatePanel.DOWNLOAD_FAILED:
text = "Downloading update failed.";
break;
case UpdatePanel.IMAGE_READY:
text = "Update downloaded.";
break;
case UpdatePanel.INSTALLING:
text = "Installing update... (will take a minute)";
break;
case UpdatePanel.INSTALLED:
text = "Update complete, please <a href='javascript:location.reload(true);'>refresh Page</a>.";
break;
case UpdatePanel.INSTALL_FAILED:
text = "Installing update failed.";
break;
}
} else {
if(self.networkMode == SettingsWindow.NETWORK_MODE_ACCESS_POINT) {
text = "Can't access internet in access point mode.";
} else {
text = "Can't access internet.";
}
}
this.statusDisplay.html(text);
}
this.updateInfoDisplay = function() {
var text = "Current version: "+self.currentVersion+". ";
if(self.canUpdate) {
text += "Latest version: "+self.newestVersion+".";
}
self.infoDisplay.text(text);
}
this.setNetworkMode = function(networkMode) {
self.networkMode = networkMode;
}
}

View File

@ -49,6 +49,7 @@ function generate_gcode() {
var layerHeight = settings["printer.layerHeight"]; var layerHeight = settings["printer.layerHeight"];
var maxObjectHeight = settings["printer.maxObjectHeight"]; var maxObjectHeight = settings["printer.maxObjectHeight"];
var temperature = settings["printer.temperature"]; var temperature = settings["printer.temperature"];
var bedTemperature = settings["printer.bed.temperature"];
var useSubLayers = settings["printer.useSubLayers"]; var useSubLayers = settings["printer.useSubLayers"];
var enableTraveling = settings["printer.enableTraveling"]; var enableTraveling = settings["printer.enableTraveling"];
var retractionEnabled = settings["printer.retraction.enabled"]; var retractionEnabled = settings["printer.retraction.enabled"];
@ -56,15 +57,14 @@ function generate_gcode() {
var retractionminDistance = settings["printer.retraction.minDistance"]; var retractionminDistance = settings["printer.retraction.minDistance"];
var retractionamount = settings["printer.retraction.amount"]; var retractionamount = settings["printer.retraction.amount"];
var preheatTemperature = settings["printer.heatup.temperature"]; var preheatTemperature = settings["printer.heatup.temperature"];
var preheatBedTemperature = settings["printer.heatup.bed.temperature"];
var startGcode = settings["printer.startgcode"]; var startGcode = settings["printer.startgcode"];
startGcode = startGcode.replace("{printingTemp}",temperature); startGcode = subsituteVariables(startGcode,temperature,bedTemperature,preheatTemperature,preheatBedTemperature);
startGcode = startGcode.replace("{preheatTemp}",preheatTemperature);
startGcode = startGcode.split("\n"); startGcode = startGcode.split("\n");
var endGcode = settings["printer.endgcode"]; var endGcode = settings["printer.endgcode"];
endGcode = endGcode.replace("{printingTemp}",temperature); endGcode = subsituteVariables(endGcode,temperature,bedTemperature,preheatTemperature,preheatBedTemperature);
endGcode = endGcode.replace("{preheatTemp}",preheatTemperature);
endGcode = endGcode.split("\n"); endGcode = endGcode.split("\n");
/* /*
@ -260,6 +260,16 @@ function generate_gcode() {
return gcode; return gcode;
} }
function subsituteVariables(gcode,temperature,bedTemperature,preheatTemperature,preheatBedTemperature) {
gcode = gcode.replace(/{printingTemp}/gi ,temperature);
gcode = gcode.replace(/{printingBedTemp}/gi ,bedTemperature);
gcode = gcode.replace(/{preheatTemp}/gi ,preheatTemperature);
gcode = gcode.replace(/{preheatBedTemp}/gi ,preheatBedTemperature);
return gcode;
}
function scaleFunction(percent) { function scaleFunction(percent) {
var r = 1.0; var r = 1.0;

62
js_src/init_layout.js Normal file
View File

@ -0,0 +1,62 @@
// TODO refactor this stuff, there's much to wipe
var drawAreaContainerMinHeight = 300;
var drawAreaContainerMaxHeight = 450;
function doOnResize() {
// console.log("doOnResize() >> " + new Date().getTime());
canvas.width = $canvas.width();
canvas.height = $canvas.height(); // canvas.clientHeight;
preview.width = $preview.width();
preview.height = $drawAreaContainer.height();
canvasWidth = canvas.width;
canvasHeight = canvas.height;
console.log(" preview.width: " + preview.width + ", $preview.width(): " + $preview.width());
calcPreviewCanvasProperties();
drawCanvasTopLeftCoords[0] = drawCanvas.offset().left;
drawCanvasTopLeftCoords[1] = drawCanvas.offset().top;
redrawDoodle();
redrawPreview();
}
function initLayouting() {
console.log("f:initLayouting()");
$drawAreaContainer = $(".drawareacontainer");
canvas.width = $canvas.width();
canvas.height = $canvas.height(); // canvas.clientHeight;
preview.width = $preview.width();
preview.height = $drawAreaContainer.height();
canvasWidth = canvas.width;
canvasHeight = canvas.height;
$drawAreaContainer.show();
// window.innerHeight
console.log("window.innerHeight: " + window.innerHeight);
console.log("window.innerWidth: " + window.innerWidth);
console.log("$drawAreaContainer.innerHeight(): " + $drawAreaContainer.innerHeight());
console.log("$drawAreaContainer.offset().top: " + $drawAreaContainer.offset().top);
// timeout because it SEEMS to be beneficial for initting the layout
// 2013-09-18 seems beneficial since when?
setTimeout(_startOrientationAndChangeEventListening, 1000);
}
function _startOrientationAndChangeEventListening() {
// Initial execution if needed
$(window).on('resize', doOnResize);
// is it necessary to call these? Aren't they called by the above eventhandlers?
doOnResize();
}

View File

@ -0,0 +1,836 @@
/*!
* imagesLoaded PACKAGED v3.0.4
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
/*!
* EventEmitter v4.2.4 - git.io/ee
* Oliver Caldwell
* MIT license
* @preserve
*/
(function () {
'use strict';
/**
* Class for managing events.
* Can be extended to provide event functionality in other classes.
*
* @class EventEmitter Manages event registering and emitting.
*/
function EventEmitter() {}
// Shortcuts to improve speed and size
// Easy access to the prototype
var proto = EventEmitter.prototype;
/**
* Finds the index of the listener for the event in it's storage array.
*
* @param {Function[]} listeners Array of listeners to search through.
* @param {Function} listener Method to look for.
* @return {Number} Index of the specified listener, -1 if not found
* @api private
*/
function indexOfListener(listeners, listener) {
var i = listeners.length;
while (i--) {
if (listeners[i].listener === listener) {
return i;
}
}
return -1;
}
/**
* Alias a method while keeping the context correct, to allow for overwriting of target method.
*
* @param {String} name The name of the target method.
* @return {Function} The aliased method
* @api private
*/
function alias(name) {
return function aliasClosure() {
return this[name].apply(this, arguments);
};
}
/**
* Returns the listener array for the specified event.
* Will initialise the event object and listener arrays if required.
* Will return an object if you use a regex search. The object contains keys for each matched event. So /ba[rz]/ might return an object containing bar and baz. But only if you have either defined them with defineEvent or added some listeners to them.
* Each property in the object response is an array of listener functions.
*
* @param {String|RegExp} evt Name of the event to return the listeners from.
* @return {Function[]|Object} All listener functions for the event.
*/
proto.getListeners = function getListeners(evt) {
var events = this._getEvents();
var response;
var key;
// Return a concatenated array of all matching events if
// the selector is a regular expression.
if (typeof evt === 'object') {
response = {};
for (key in events) {
if (events.hasOwnProperty(key) && evt.test(key)) {
response[key] = events[key];
}
}
}
else {
response = events[evt] || (events[evt] = []);
}
return response;
};
/**
* Takes a list of listener objects and flattens it into a list of listener functions.
*
* @param {Object[]} listeners Raw listener objects.
* @return {Function[]} Just the listener functions.
*/
proto.flattenListeners = function flattenListeners(listeners) {
var flatListeners = [];
var i;
for (i = 0; i < listeners.length; i += 1) {
flatListeners.push(listeners[i].listener);
}
return flatListeners;
};
/**
* Fetches the requested listeners via getListeners but will always return the results inside an object. This is mainly for internal use but others may find it useful.
*
* @param {String|RegExp} evt Name of the event to return the listeners from.
* @return {Object} All listener functions for an event in an object.
*/
proto.getListenersAsObject = function getListenersAsObject(evt) {
var listeners = this.getListeners(evt);
var response;
if (listeners instanceof Array) {
response = {};
response[evt] = listeners;
}
return response || listeners;
};
/**
* Adds a listener function to the specified event.
* The listener will not be added if it is a duplicate.
* If the listener returns true then it will be removed after it is called.
* If you pass a regular expression as the event name then the listener will be added to all events that match it.
*
* @param {String|RegExp} evt Name of the event to attach the listener to.
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addListener = function addListener(evt, listener) {
var listeners = this.getListenersAsObject(evt);
var listenerIsWrapped = typeof listener === 'object';
var key;
for (key in listeners) {
if (listeners.hasOwnProperty(key) && indexOfListener(listeners[key], listener) === -1) {
listeners[key].push(listenerIsWrapped ? listener : {
listener: listener,
once: false
});
}
}
return this;
};
/**
* Alias of addListener
*/
proto.on = alias('addListener');
/**
* Semi-alias of addListener. It will add a listener that will be
* automatically removed after it's first execution.
*
* @param {String|RegExp} evt Name of the event to attach the listener to.
* @param {Function} listener Method to be called when the event is emitted. If the function returns true then it will be removed after calling.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addOnceListener = function addOnceListener(evt, listener) {
return this.addListener(evt, {
listener: listener,
once: true
});
};
/**
* Alias of addOnceListener.
*/
proto.once = alias('addOnceListener');
/**
* Defines an event name. This is required if you want to use a regex to add a listener to multiple events at once. If you don't do this then how do you expect it to know what event to add to? Should it just add to every possible match for a regex? No. That is scary and bad.
* You need to tell it what event names should be matched by a regex.
*
* @param {String} evt Name of the event to create.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.defineEvent = function defineEvent(evt) {
this.getListeners(evt);
return this;
};
/**
* Uses defineEvent to define multiple events.
*
* @param {String[]} evts An array of event names to define.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.defineEvents = function defineEvents(evts) {
for (var i = 0; i < evts.length; i += 1) {
this.defineEvent(evts[i]);
}
return this;
};
/**
* Removes a listener function from the specified event.
* When passed a regular expression as the event name, it will remove the listener from all events that match it.
*
* @param {String|RegExp} evt Name of the event to remove the listener from.
* @param {Function} listener Method to remove from the event.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeListener = function removeListener(evt, listener) {
var listeners = this.getListenersAsObject(evt);
var index;
var key;
for (key in listeners) {
if (listeners.hasOwnProperty(key)) {
index = indexOfListener(listeners[key], listener);
if (index !== -1) {
listeners[key].splice(index, 1);
}
}
}
return this;
};
/**
* Alias of removeListener
*/
proto.off = alias('removeListener');
/**
* Adds listeners in bulk using the manipulateListeners method.
* If you pass an object as the second argument you can add to multiple events at once. The object should contain key value pairs of events and listeners or listener arrays. You can also pass it an event name and an array of listeners to be added.
* You can also pass it a regular expression to add the array of listeners to all events that match it.
* Yeah, this function does quite a bit. That's probably a bad thing.
*
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add to multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to add.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.addListeners = function addListeners(evt, listeners) {
// Pass through to manipulateListeners
return this.manipulateListeners(false, evt, listeners);
};
/**
* Removes listeners in bulk using the manipulateListeners method.
* If you pass an object as the second argument you can remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
* You can also pass it an event name and an array of listeners to be removed.
* You can also pass it a regular expression to remove the listeners from all events that match it.
*
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to remove from multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to remove.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeListeners = function removeListeners(evt, listeners) {
// Pass through to manipulateListeners
return this.manipulateListeners(true, evt, listeners);
};
/**
* Edits listeners in bulk. The addListeners and removeListeners methods both use this to do their job. You should really use those instead, this is a little lower level.
* The first argument will determine if the listeners are removed (true) or added (false).
* If you pass an object as the second argument you can add/remove from multiple events at once. The object should contain key value pairs of events and listeners or listener arrays.
* You can also pass it an event name and an array of listeners to be added/removed.
* You can also pass it a regular expression to manipulate the listeners of all events that match it.
*
* @param {Boolean} remove True if you want to remove listeners, false if you want to add.
* @param {String|Object|RegExp} evt An event name if you will pass an array of listeners next. An object if you wish to add/remove from multiple events at once.
* @param {Function[]} [listeners] An optional array of listener functions to add/remove.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.manipulateListeners = function manipulateListeners(remove, evt, listeners) {
var i;
var value;
var single = remove ? this.removeListener : this.addListener;
var multiple = remove ? this.removeListeners : this.addListeners;
// If evt is an object then pass each of it's properties to this method
if (typeof evt === 'object' && !(evt instanceof RegExp)) {
for (i in evt) {
if (evt.hasOwnProperty(i) && (value = evt[i])) {
// Pass the single listener straight through to the singular method
if (typeof value === 'function') {
single.call(this, i, value);
}
else {
// Otherwise pass back to the multiple function
multiple.call(this, i, value);
}
}
}
}
else {
// So evt must be a string
// And listeners must be an array of listeners
// Loop over it and pass each one to the multiple method
i = listeners.length;
while (i--) {
single.call(this, evt, listeners[i]);
}
}
return this;
};
/**
* Removes all listeners from a specified event.
* If you do not specify an event then all listeners will be removed.
* That means every event will be emptied.
* You can also pass a regex to remove all events that match it.
*
* @param {String|RegExp} [evt] Optional name of the event to remove all listeners for. Will remove from every event if not passed.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.removeEvent = function removeEvent(evt) {
var type = typeof evt;
var events = this._getEvents();
var key;
// Remove different things depending on the state of evt
if (type === 'string') {
// Remove all listeners for the specified event
delete events[evt];
}
else if (type === 'object') {
// Remove all events matching the regex.
for (key in events) {
if (events.hasOwnProperty(key) && evt.test(key)) {
delete events[key];
}
}
}
else {
// Remove all listeners in all events
delete this._events;
}
return this;
};
/**
* Alias of removeEvent.
*
* Added to mirror the node API.
*/
proto.removeAllListeners = alias('removeEvent');
/**
* Emits an event of your choice.
* When emitted, every listener attached to that event will be executed.
* If you pass the optional argument array then those arguments will be passed to every listener upon execution.
* Because it uses `apply`, your array of arguments will be passed as if you wrote them out separately.
* So they will not arrive within the array on the other side, they will be separate.
* You can also pass a regular expression to emit to all events that match it.
*
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
* @param {Array} [args] Optional array of arguments to be passed to each listener.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.emitEvent = function emitEvent(evt, args) {
var listeners = this.getListenersAsObject(evt);
var listener;
var i;
var key;
var response;
for (key in listeners) {
if (listeners.hasOwnProperty(key)) {
i = listeners[key].length;
while (i--) {
// If the listener returns true then it shall be removed from the event
// The function is executed either with a basic call or an apply if there is an args array
listener = listeners[key][i];
if (listener.once === true) {
this.removeListener(evt, listener.listener);
}
response = listener.listener.apply(this, args || []);
if (response === this._getOnceReturnValue()) {
this.removeListener(evt, listener.listener);
}
}
}
}
return this;
};
/**
* Alias of emitEvent
*/
proto.trigger = alias('emitEvent');
/**
* Subtly different from emitEvent in that it will pass its arguments on to the listeners, as opposed to taking a single array of arguments to pass on.
* As with emitEvent, you can pass a regex in place of the event name to emit to all events that match it.
*
* @param {String|RegExp} evt Name of the event to emit and execute listeners for.
* @param {...*} Optional additional arguments to be passed to each listener.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.emit = function emit(evt) {
var args = Array.prototype.slice.call(arguments, 1);
return this.emitEvent(evt, args);
};
/**
* Sets the current value to check against when executing listeners. If a
* listeners return value matches the one set here then it will be removed
* after execution. This value defaults to true.
*
* @param {*} value The new value to check for when executing listeners.
* @return {Object} Current instance of EventEmitter for chaining.
*/
proto.setOnceReturnValue = function setOnceReturnValue(value) {
this._onceReturnValue = value;
return this;
};
/**
* Fetches the current value to check against when executing listeners. If
* the listeners return value matches this one then it should be removed
* automatically. It will return true by default.
*
* @return {*|Boolean} The current value to check for or the default, true.
* @api private
*/
proto._getOnceReturnValue = function _getOnceReturnValue() {
if (this.hasOwnProperty('_onceReturnValue')) {
return this._onceReturnValue;
}
else {
return true;
}
};
/**
* Fetches the events object and creates one if required.
*
* @return {Object} The events storage object.
* @api private
*/
proto._getEvents = function _getEvents() {
return this._events || (this._events = {});
};
// Expose the class either via AMD, CommonJS or the global object
if (typeof define === 'function' && define.amd) {
define(function () {
return EventEmitter;
});
}
else if (typeof module === 'object' && module.exports){
module.exports = EventEmitter;
}
else {
this.EventEmitter = EventEmitter;
}
}.call(this));
/*!
* eventie v1.0.3
* event binding helper
* eventie.bind( elem, 'click', myFn )
* eventie.unbind( elem, 'click', myFn )
*/
/*jshint browser: true, undef: true, unused: true */
/*global define: false */
( function( window ) {
'use strict';
var docElem = document.documentElement;
var bind = function() {};
if ( docElem.addEventListener ) {
bind = function( obj, type, fn ) {
obj.addEventListener( type, fn, false );
};
} else if ( docElem.attachEvent ) {
bind = function( obj, type, fn ) {
obj[ type + fn ] = fn.handleEvent ?
function() {
var event = window.event;
// add event.target
event.target = event.target || event.srcElement;
fn.handleEvent.call( fn, event );
} :
function() {
var event = window.event;
// add event.target
event.target = event.target || event.srcElement;
fn.call( obj, event );
};
obj.attachEvent( "on" + type, obj[ type + fn ] );
};
}
var unbind = function() {};
if ( docElem.removeEventListener ) {
unbind = function( obj, type, fn ) {
obj.removeEventListener( type, fn, false );
};
} else if ( docElem.detachEvent ) {
unbind = function( obj, type, fn ) {
obj.detachEvent( "on" + type, obj[ type + fn ] );
try {
delete obj[ type + fn ];
} catch ( err ) {
// can't delete window object properties
obj[ type + fn ] = undefined;
}
};
}
var eventie = {
bind: bind,
unbind: unbind
};
// transport
if ( typeof define === 'function' && define.amd ) {
// AMD
define( eventie );
} else {
// browser global
window.eventie = eventie;
}
})( this );
/*!
* imagesLoaded v3.0.4
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
( function( window ) {
'use strict';
var $ = window.jQuery;
var console = window.console;
var hasConsole = typeof console !== 'undefined';
// -------------------------- helpers -------------------------- //
// extend objects
function extend( a, b ) {
for ( var prop in b ) {
a[ prop ] = b[ prop ];
}
return a;
}
var objToString = Object.prototype.toString;
function isArray( obj ) {
return objToString.call( obj ) === '[object Array]';
}
// turn element or nodeList into an array
function makeArray( obj ) {
var ary = [];
if ( isArray( obj ) ) {
// use object if already an array
ary = obj;
} else if ( typeof obj.length === 'number' ) {
// convert nodeList to array
for ( var i=0, len = obj.length; i < len; i++ ) {
ary.push( obj[i] );
}
} else {
// array of single index
ary.push( obj );
}
return ary;
}
// -------------------------- -------------------------- //
function defineImagesLoaded( EventEmitter, eventie ) {
/**
* @param {Array, Element, NodeList, String} elem
* @param {Object or Function} options - if function, use as callback
* @param {Function} onAlways - callback function
*/
function ImagesLoaded( elem, options, onAlways ) {
// coerce ImagesLoaded() without new, to be new ImagesLoaded()
if ( !( this instanceof ImagesLoaded ) ) {
return new ImagesLoaded( elem, options );
}
// use elem as selector string
if ( typeof elem === 'string' ) {
elem = document.querySelectorAll( elem );
}
this.elements = makeArray( elem );
this.options = extend( {}, this.options );
if ( typeof options === 'function' ) {
onAlways = options;
} else {
extend( this.options, options );
}
if ( onAlways ) {
this.on( 'always', onAlways );
}
this.getImages();
if ( $ ) {
// add jQuery Deferred object
this.jqDeferred = new $.Deferred();
}
// HACK check async to allow time to bind listeners
var _this = this;
setTimeout( function() {
_this.check();
});
}
ImagesLoaded.prototype = new EventEmitter();
ImagesLoaded.prototype.options = {};
ImagesLoaded.prototype.getImages = function() {
this.images = [];
// filter & find items if we have an item selector
for ( var i=0, len = this.elements.length; i < len; i++ ) {
var elem = this.elements[i];
// filter siblings
if ( elem.nodeName === 'IMG' ) {
this.addImage( elem );
}
// find children
var childElems = elem.querySelectorAll('img');
// concat childElems to filterFound array
for ( var j=0, jLen = childElems.length; j < jLen; j++ ) {
var img = childElems[j];
this.addImage( img );
}
}
};
/**
* @param {Image} img
*/
ImagesLoaded.prototype.addImage = function( img ) {
var loadingImage = new LoadingImage( img );
this.images.push( loadingImage );
};
ImagesLoaded.prototype.check = function() {
var _this = this;
var checkedCount = 0;
var length = this.images.length;
this.hasAnyBroken = false;
// complete if no images
if ( !length ) {
this.complete();
return;
}
function onConfirm( image, message ) {
if ( _this.options.debug && hasConsole ) {
console.log( 'confirm', image, message );
}
_this.progress( image );
checkedCount++;
if ( checkedCount === length ) {
_this.complete();
}
return true; // bind once
}
for ( var i=0; i < length; i++ ) {
var loadingImage = this.images[i];
loadingImage.on( 'confirm', onConfirm );
loadingImage.check();
}
};
ImagesLoaded.prototype.progress = function( image ) {
this.hasAnyBroken = this.hasAnyBroken || !image.isLoaded;
// HACK - Chrome triggers event before object properties have changed. #83
var _this = this;
setTimeout( function() {
_this.emit( 'progress', _this, image );
if ( _this.jqDeferred ) {
_this.jqDeferred.notify( _this, image );
}
});
};
ImagesLoaded.prototype.complete = function() {
var eventName = this.hasAnyBroken ? 'fail' : 'done';
this.isComplete = true;
var _this = this;
// HACK - another setTimeout so that confirm happens after progress
setTimeout( function() {
_this.emit( eventName, _this );
_this.emit( 'always', _this );
if ( _this.jqDeferred ) {
var jqMethod = _this.hasAnyBroken ? 'reject' : 'resolve';
_this.jqDeferred[ jqMethod ]( _this );
}
});
};
// -------------------------- jquery -------------------------- //
if ( $ ) {
$.fn.imagesLoaded = function( options, callback ) {
var instance = new ImagesLoaded( this, options, callback );
return instance.jqDeferred.promise( $(this) );
};
}
// -------------------------- -------------------------- //
var cache = {};
function LoadingImage( img ) {
this.img = img;
}
LoadingImage.prototype = new EventEmitter();
LoadingImage.prototype.check = function() {
// first check cached any previous images that have same src
var cached = cache[ this.img.src ];
if ( cached ) {
this.useCached( cached );
return;
}
// add this to cache
cache[ this.img.src ] = this;
// If complete is true and browser supports natural sizes,
// try to check for image status manually.
if ( this.img.complete && this.img.naturalWidth !== undefined ) {
// report based on naturalWidth
this.confirm( this.img.naturalWidth !== 0, 'naturalWidth' );
return;
}
// If none of the checks above matched, simulate loading on detached element.
var proxyImage = this.proxyImage = new Image();
eventie.bind( proxyImage, 'load', this );
eventie.bind( proxyImage, 'error', this );
proxyImage.src = this.img.src;
};
LoadingImage.prototype.useCached = function( cached ) {
if ( cached.isConfirmed ) {
this.confirm( cached.isLoaded, 'cached was confirmed' );
} else {
var _this = this;
cached.on( 'confirm', function( image ) {
_this.confirm( image.isLoaded, 'cache emitted confirmed' );
return true; // bind once
});
}
};
LoadingImage.prototype.confirm = function( isLoaded, message ) {
this.isConfirmed = true;
this.isLoaded = isLoaded;
this.emit( 'confirm', this, message );
};
// trigger specified handler for event type
LoadingImage.prototype.handleEvent = function( event ) {
var method = 'on' + event.type;
if ( this[ method ] ) {
this[ method ]( event );
}
};
LoadingImage.prototype.onload = function() {
this.confirm( true, 'onload' );
this.unbindProxyEvents();
};
LoadingImage.prototype.onerror = function() {
this.confirm( false, 'onerror' );
this.unbindProxyEvents();
};
LoadingImage.prototype.unbindProxyEvents = function() {
eventie.unbind( this.proxyImage, 'load', this );
eventie.unbind( this.proxyImage, 'error', this );
};
// ----- ----- //
return ImagesLoaded;
}
// -------------------------- transport -------------------------- //
if ( typeof define === 'function' && define.amd ) {
// AMD
define( [
'eventEmitter/EventEmitter',
'eventie/eventie'
],
defineImagesLoaded );
} else {
// browser global
window.imagesLoaded = defineImagesLoaded(
window.EventEmitter,
window.eventie
);
}
})( window );

539
js_src/libs/jquery-tourbus.js vendored Normal file
View File

@ -0,0 +1,539 @@
(function() {
var __slice = [].slice;
(function($) {
var Bus, Leg, methods, tourbus, uniqueId, _addRule, _assemble, _busses, _dataProp, _include, _tours;
tourbus = $.tourbus = function() {
var args, method;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
method = args[0];
if (methods.hasOwnProperty(method)) {
args = args.slice(1);
} else if (method instanceof $) {
method = 'build';
} else if (typeof method === 'string') {
method = 'build';
args[0] = $(args[0]);
} else {
$.error("Unknown method of $.tourbus --", args);
}
return methods[method].apply(this, args);
};
$.fn.tourbus = function() {
var args;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
return this.each(function() {
args.unshift($(this));
tourbus.apply(null, ['build'].concat(__slice.call(args)));
return this;
});
};
methods = {
build: function(el, options) {
var built;
if (options == null) {
options = {};
}
options = $.extend(true, {}, tourbus.defaults, options);
built = [];
if (!(el instanceof $)) {
el = $(el);
}
el.each(function() {
return built.push(_assemble(this, options));
});
if (built.length === 0) {
$.error("" + el.selector + " was not found!");
}
if (built.length === 1) {
return built[0];
}
return built;
},
destroyAll: function() {
var bus, index, _results;
_results = [];
for (index in _busses) {
bus = _busses[index];
_results.push(bus.destroy());
}
return _results;
},
expose: function(global) {
return global.tourbus = {
Bus: Bus,
Leg: Leg
};
}
};
tourbus.defaults = {
debug: false,
autoDepart: false,
target: 'body',
startAt: 0,
onDepart: function() {
return null;
},
onStop: function() {
return null;
},
onLegStart: function() {
return null;
},
onLegEnd: function() {
return null;
},
leg: {
scrollTo: null,
scrollSpeed: 150,
scrollContext: 100,
orientation: 'bottom',
align: 'left',
width: 'auto',
margin: 10,
top: null,
left: null,
arrow: "35%"
}
};
/* Internal
*/
Bus = (function() {
function Bus(el, options) {
this.id = uniqueId();
this.$target = $(options.target);
this.$el = $(el);
this.$el.data({
tourbus: this
});
this.options = options;
this.currentLegIndex = null;
this.legs = null;
this.legEls = this.$el.children('li');
this.totalLegs = this.legEls.length;
this._setupEvents();
if (this.options.autoDepart) {
this.$el.trigger('depart.tourbus');
}
this._log('built tourbus with el', el.toString(), 'and options', this.options);
}
Bus.prototype.depart = function() {
this.running = true;
this.options.onDepart(this);
this._log('departing', this);
this.legs = this._buildLegs();
this.currentLegIndex = this.options.startAt;
return this.showLeg();
};
Bus.prototype.stop = function() {
if (!this.running) {
return;
}
if (this.legs) {
$.each(this.legs, $.proxy(this.hideLeg, this));
}
this.currentLegIndex = this.options.startAt;
this.options.onStop(this);
return this.running = false;
};
Bus.prototype.on = function(event, selector, fn) {
return this.$target.on(event, selector, fn);
};
Bus.prototype.currentLeg = function() {
if (this.currentLegIndex === null) {
return null;
}
return this.legs[this.currentLegIndex];
};
Bus.prototype.showLeg = function(index) {
var leg, preventDefault;
if (index == null) {
index = this.currentLegIndex;
}
leg = this.legs[index];
this._log('showLeg:', leg);
preventDefault = this.options.onLegStart(leg, this);
if (preventDefault !== false) {
return leg.show();
}
};
Bus.prototype.hideLeg = function(index) {
var leg, preventDefault;
if (index == null) {
index = this.currentLegIndex;
}
leg = this.legs[index];
this._log('hideLeg:', leg);
preventDefault = this.options.onLegEnd(leg, this);
if (preventDefault !== false) {
return leg.hide();
}
};
Bus.prototype.repositionLegs = function() {
if (this.legs) {
return $.each(this.legs, function() {
return this.reposition();
});
}
};
Bus.prototype.next = function() {
this.hideLeg();
this.currentLegIndex++;
if (this.currentLegIndex > this.totalLegs - 1) {
return this.stop();
}
return this.showLeg();
};
Bus.prototype.prev = function(cb) {
this.hideLeg();
this.currentLegIndex--;
if (this.currentLegIndex < 0) {
return this.stop();
}
return this.showLeg();
};
Bus.prototype.destroy = function() {
if (this.legs) {
$.each(this.legs, function() {
return this.destroy();
});
}
this.legs = null;
delete _busses[this.id];
return this._teardownEvents();
};
Bus.prototype._buildLegs = function() {
var _this = this;
if (this.legs) {
$.each(this.legs, function(_, leg) {
return leg.destroy();
});
}
return $.map(this.legEls, function(legEl, i) {
var $legEl, data, leg;
$legEl = $(legEl);
data = $legEl.data();
leg = new Leg({
content: $legEl.html(),
target: data.el || 'body',
bus: _this,
index: i,
rawData: data
});
leg.render();
_this.$target.append(leg.$el);
leg._position();
leg.hide();
return leg;
});
};
Bus.prototype._log = function() {
if (!this.options.debug) {
return;
}
return console.log.apply(console, ["TOURBUS " + this.id + ":"].concat(__slice.call(arguments)));
};
Bus.prototype._setupEvents = function() {
this.$el.on('depart.tourbus', $.proxy(this.depart, this));
this.$el.on('stop.tourbus', $.proxy(this.stop, this));
this.$el.on('next.tourbus', $.proxy(this.next, this));
return this.$el.on('prev.tourbus', $.proxy(this.prev, this));
};
Bus.prototype._teardownEvents = function() {
return this.$el.off('.tourbus');
};
return Bus;
})();
Leg = (function() {
function Leg(options) {
this.bus = options.bus;
this.rawData = options.rawData;
this.content = options.content;
this.index = options.index;
this.options = options;
this.$target = $(options.target);
if (this.$target.length === 0) {
throw "" + this.$target.selector + " is not an element!";
}
this._setupOptions();
this._configureElement();
this._configureTarget();
this._configureScroll();
this._setupEvents();
this.bus._log("leg " + this.index + " made with options", this.options);
}
Leg.prototype.render = function() {
var arrowClass, html;
arrowClass = this.options.orientation === 'centered' ? '' : 'tourbus-arrow';
this.$el.addClass(" " + arrowClass + " tourbus-arrow-" + this.options.orientation + " ");
html = "<div class='tourbus-leg-inner'>\n " + this.content + "\n</div>";
this.$el.css({
width: this.options.width
}).html(html);
return this;
};
Leg.prototype.destroy = function() {
this.$el.remove();
return this._teardownEvents();
};
Leg.prototype.reposition = function() {
this._configureTarget();
return this._position();
};
Leg.prototype._position = function() {
var css, keys, rule, selector;
if (this.options.orientation !== 'centered') {
rule = {};
keys = {
top: 'left',
bottom: 'left',
left: 'top',
right: 'top'
};
if (typeof this.options.arrow === 'number') {
this.options.arrow += 'px';
}
rule[keys[this.options.orientation]] = this.options.arrow;
selector = "#" + this.id + ".tourbus-arrow";
this.bus._log("adding rule for " + this.id, rule);
_addRule("" + selector + ":before, " + selector + ":after", rule);
}
css = this._offsets();
this.bus._log('setting offsets on leg', css);
return this.$el.css(css);
};
Leg.prototype.show = function() {
this.$el.css({
visibility: 'visible',
opacity: 1.0,
zIndex: 9999
});
return this.scrollIntoView();
};
Leg.prototype.hide = function() {
if (this.bus.options.debug) {
return this.$el.css({
visibility: 'visible',
opacity: 0.4,
zIndex: 0
});
} else {
return this.$el.css({
visibility: 'hidden'
});
}
};
Leg.prototype.scrollIntoView = function() {
var scrollTarget;
if (!this.willScroll) {
return;
}
scrollTarget = _dataProp(this.options.scrollTo, this.$el);
this.bus._log('scrolling to', scrollTarget, this.scrollSettings);
return $.scrollTo(scrollTarget, this.scrollSettings);
};
Leg.prototype._setupOptions = function() {
var globalOptions;
globalOptions = this.bus.options.leg;
this.options.top = _dataProp(this.rawData.top, globalOptions.top);
this.options.left = _dataProp(this.rawData.left, globalOptions.left);
this.options.scrollTo = _dataProp(this.rawData.scrollTo, globalOptions.scrollTo);
this.options.scrollSpeed = _dataProp(this.rawData.scrollSpeed, globalOptions.scrollSpeed);
this.options.scrollContext = _dataProp(this.rawData.scrollContext, globalOptions.scrollContext);
this.options.margin = _dataProp(this.rawData.margin, globalOptions.margin);
this.options.arrow = this.rawData.arrow || globalOptions.arrow;
this.options.align = this.rawData.align || globalOptions.align;
this.options.width = this.rawData.width || globalOptions.width;
return this.options.orientation = this.rawData.orientation || globalOptions.orientation;
};
Leg.prototype._configureElement = function() {
this.id = "tourbus-leg-id-" + this.bus.id + "-" + this.options.index;
this.$el = $("<div class='tourbus-leg'></div>");
this.el = this.$el[0];
this.$el.attr({
id: this.id
});
return this.$el.css({
zIndex: 9999
});
};
Leg.prototype._setupEvents = function() {
this.$el.on('click', '.tourbus-next', $.proxy(this.bus.next, this.bus));
this.$el.on('click', '.tourbus-prev', $.proxy(this.bus.prev, this.bus));
return this.$el.on('click', '.tourbus-stop', $.proxy(this.bus.stop, this.bus));
};
Leg.prototype._teardownEvents = function() {
return this.$el.off('click');
};
Leg.prototype._configureTarget = function() {
this.targetOffset = this.$target.offset();
if (_dataProp(this.options.top, false)) {
this.targetOffset.top = this.options.top;
}
if (_dataProp(this.options.left, false)) {
this.targetOffset.left = this.options.left;
}
this.targetWidth = this.$target.outerWidth();
return this.targetHeight = this.$target.outerHeight();
};
Leg.prototype._configureScroll = function() {
this.willScroll = $.fn.scrollTo && this.options.scrollTo !== false;
return this.scrollSettings = {
offset: -this.options.scrollContext,
easing: 'linear',
axis: 'y',
duration: this.options.scrollSpeed
};
};
Leg.prototype._offsets = function() {
var dimension, elHalf, elHeight, elWidth, offsets, targetHalf, targetHeightOverride, validOrientations;
elHeight = this.$el.height();
elWidth = this.$el.width();
offsets = {};
switch (this.options.orientation) {
case 'centered':
targetHeightOverride = $(window).height();
offsets.top = this.options.top;
if (!_dataProp(offsets.top, false)) {
offsets.top = (targetHeightOverride / 2) - (elHeight / 2);
}
offsets.left = (this.targetWidth / 2) - (elWidth / 2);
break;
case 'left':
offsets.top = this.targetOffset.top;
offsets.left = this.targetOffset.left - elWidth - this.options.margin;
break;
case 'right':
offsets.top = this.targetOffset.top;
offsets.left = this.targetOffset.left + this.targetWidth + this.options.margin;
break;
case 'top':
offsets.top = this.targetOffset.top - elHeight - this.options.margin;
offsets.left = this.targetOffset.left;
break;
case 'bottom':
offsets.top = this.targetOffset.top + this.targetHeight + this.options.margin;
offsets.left = this.targetOffset.left;
}
validOrientations = {
top: ['left', 'right'],
bottom: ['left', 'right'],
left: ['top', 'bottom'],
right: ['top', 'bottom']
};
if (_include(this.options.orientation, validOrientations[this.options.align])) {
switch (this.options.align) {
case 'right':
offsets.left += this.targetWidth - elWidth;
break;
case 'bottom':
offsets.top += this.targetHeight - elHeight;
}
} else if (this.options.align === 'center') {
if (_include(this.options.orientation, validOrientations.left)) {
targetHalf = this.targetWidth / 2;
elHalf = elWidth / 2;
dimension = 'left';
} else {
targetHalf = this.targetHeight / 2;
elHalf = elHeight / 2;
dimension = 'top';
}
if (targetHalf > elHalf) {
offsets[dimension] += targetHalf - elHalf;
} else {
offsets[dimension] -= elHalf - targetHalf;
}
}
return offsets;
};
return Leg;
})();
_tours = 0;
uniqueId = function() {
return _tours++;
};
_busses = {};
_assemble = function() {
var bus;
bus = (function(func, args, ctor) {
ctor.prototype = func.prototype;
var child = new ctor, result = func.apply(child, args);
return Object(result) === result ? result : child;
})(Bus, arguments, function(){});
_busses[bus.id] = bus;
return bus;
};
_dataProp = function(possiblyFalsy, alternative) {
if (possiblyFalsy === null || typeof possiblyFalsy === 'undefined') {
return alternative;
}
return possiblyFalsy;
};
_include = function(value, array) {
return $.inArray(value, array || []) !== -1;
};
return _addRule = (function(styleTag) {
var sheet;
styleTag.type = 'text/css';
document.getElementsByTagName('head')[0].appendChild(styleTag);
sheet = document.styleSheets[document.styleSheets.length - 1];
return function(selector, css) {
var key, propText;
propText = $.map((function() {
var _results;
_results = [];
for (key in css) {
_results.push(key);
}
return _results;
})(), function(p) {
return "" + p + ":" + css[p];
}).join(';');
try {
if (sheet.insertRule) {
sheet.insertRule("" + selector + " { " + propText + " }", (sheet.cssRules || sheet.rules).length);
} else {
sheet.addRule(selector, propText);
}
} catch (_error) {}
};
})(document.createElement('style'));
})(jQuery);
}).call(this);

View File

@ -17,6 +17,9 @@ var wifiboxCGIBinURL; // CGI-bin, for some network stuff, where it needs to rest
var $drawAreaContainer, $doodleCanvas, doodleCanvas, doodleCanvasContext, $previewContainer; var $drawAreaContainer, $doodleCanvas, doodleCanvas, doodleCanvasContext, $previewContainer;
var showhideInterval;
var showOrHide = false;
$(function() { $(function() {
console.log("ready"); console.log("ready");
@ -73,7 +76,7 @@ $(function() {
$("#debug_display").css("display", "block"); $("#debug_display").css("display", "block");
// show and hide the progressguage and thermometer // show and hide the progressguage and thermometer
showhideInterval = setInterval(showOrHideThermo, 2500); //showhideInterval = setInterval(showOrHideThermo, 2500);
// $("#debugContainer").css("display", "block"); // $("#debugContainer").css("display", "block");
@ -103,9 +106,6 @@ $(function() {
} }
}); });
var showhideInterval;
var showOrHide = false;
function showOrHideThermo() { function showOrHideThermo() {
console.log("f:showOrHideThermo()"); console.log("f:showOrHideThermo()");
if (showOrHide) { if (showOrHide) {

View File

@ -6,8 +6,6 @@
body { body {
background-color: #fcfcfc; background-color: #fcfcfc;
user-select: none; /* disable cut copy paste */ user-select: none; /* disable cut copy paste */
// -moz-user-select: none; /* disable cut copy paste */
// -webkit-user-select: none; /* disable cut copy paste */
overflow:hidden; /* This chops off any overhanging divs */ overflow:hidden; /* This chops off any overhanging divs */
} }
img { img {

View File

@ -81,7 +81,7 @@
transition: right .40s cubic-bezier(0.68, -0.55, 0.265, 1.55); transition: right .40s cubic-bezier(0.68, -0.55, 0.265, 1.55);
right: -60%; right: -60%;
margin-top: 5%; margin: 5% 0%;
} }
#progressbarCanvas { #progressbarCanvas {

144
less/jquery-tourbus.less Normal file
View File

@ -0,0 +1,144 @@
/* Tourbus leg definitions element */
.tourbus-legs {
display: none;
}
/* Container for tourbus leg */
.tourbus-leg {
position: absolute;
visibility: hidden;
top: 0;
border: 1px solid #E5E5E5;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
border-radius: 4px;
background: white;
}
/* Interior of leg, clearfixed */
.tourbus-leg-inner {
padding: 20px;
position: relative;
zoom: 1;
}
.tourbus-leg-inner:before,
.tourbus-leg-inner:after {
content: "\0020";
display: block;
height: 0;
overflow: hidden;
}
.tourbus-leg-inner:after {
clear: both;
}
.prevnextBtn {
border: 1px solid #8e8e8e;
color: #252525;
border-radius: 4px;
padding: 4px 8px;
background-color: #eaeaea;
-moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
box-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
margin-right: 8px;
}
/*
remove top padding/margin on headings
because the interior of the leg has padding
*/
.tourbus-leg h1,
.tourbus-leg h2,
.tourbus-leg h3,
.tourbus-leg h4,
.tourbus-leg h5,
.tourbus-leg h6 {
margin-top: 0;
padding-top: 0;
}
/* Tourbus leg arrow */
.tourbus-arrow:before,
.tourbus-arrow:after {
border: solid rgba(0, 0, 0, 0);
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: transparent;
}
/* set the :after to be the _interior_ size of the arrow */
/* set the :before to be the _interior + desired border width_ */
.tourbus-arrow:after {
border-width: 14px;
}
.tourbus-arrow:before {
border-width: 16px;
}
/* Arrow background and border colors */
/*
change margin-top/left values here to
match the border width for :after above
border colors here are for the _interior_ of the arrow
*/
.tourbus-arrow-right:after {
border-right-color: #ffffff;
margin-top: -14px;
top: 50%;
}
.tourbus-arrow-left:after {
border-left-color: #ffffff;
margin-top: -14px;
top: 50%;
}
.tourbus-arrow-bottom:after {
border-bottom-color: #ffffff;
margin-left: -14px;
left: 50%;
}
.tourbus-arrow-top:after {
border-top-color: #ffffff;
margin-left: -14px;
left: 50%;
}
/*
change margin-top/left values here to
match the border width for :before above
border colors here are for the _border_ of the arrow
*/
.tourbus-arrow-right:before {
border-right-color: #e5e5e5;
margin-top: -16px;
top: 50%;
}
.tourbus-arrow-left:before {
border-left-color: #e5e5e5;
margin-top: -16px;
top: 50%;
}
.tourbus-arrow-bottom:before {
border-bottom-color: #e5e5e5;
margin-left: -16px;
left: 50%;
}
.tourbus-arrow-top:before {
border-top-color: #e5e5e5;
margin-left: -16px;
left: 50%;
}
/* you shouldn't need to change these */
.tourbus-arrow-right:after,
.tourbus-arrow-right:before {
right: 100%;
}
.tourbus-arrow-left:after,
.tourbus-arrow-left:before {
left: 100%;
}
.tourbus-arrow-bottom:after,
.tourbus-arrow-bottom:before {
bottom: 100%;
}
.tourbus-arrow-top:after,
.tourbus-arrow-top:before {
top: 100%;
}

View File

@ -14,6 +14,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
display:none; display:none;
user-select: text;
#settings { #settings {
background-color: #fff; background-color: #fff;

View File

@ -23,3 +23,5 @@
@media only screen and (orientation:portrait) { @media only screen and (orientation:portrait) {
@import "portrait.less"; @import "portrait.less";
} }
@import "jquery-tourbus.less";

View File

@ -1,5 +1,5 @@
{ {
"name": "doodle3dclient", "name": "doodle3d-client",
"version": "0.9.0", "version": "0.9.0",
"description": "Doodle3D client app", "description": "Doodle3D client app",
"repository": { "repository": {

View File

@ -102,3 +102,8 @@ form .errorMsg {
color: #f00; color: #f00;
margin: 0 0 0 1em; margin: 0 0 0 1em;
} }
form dl dt {
float: left;
font-style: italic;
width: 10em;
}

View File

@ -1 +1 @@
form{margin:10px;max-width:600px}form input{margin:1px}body,th,td{font-family:Helvetica,Arial,"Nimbus Sans L",sans-serif;font-size:13px}.settingsContainer{position:relative;width:100%;height:100%}form fieldset{max-width:600px;border:1px solid #bbb;border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;margin-bottom:20px;padding:8px}form fieldset fieldset{max-width:580px;margin:15px 0 5px;clear:left;float:left}form fieldset legend{margin-left:10px;font-weight:700}form label{min-width:150px;display:block;float:left;margin:1px 0 0;clear:left}form div{float:left}form input[type=text],form input[type=number],form input[type=password]{border:1px solid #90c0ff;margin-right:5px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}form input[type=text].small,form input[type=number].small,form input[type=password].small{width:50px}form input[type=text].large,form input[type=number].large,form input[type=password].large{width:250px}form input[type=radio]{margin:4px 4px 0 0}form textarea{border:1px solid #90c0ff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}form .startgcode_left{float:left;margin-right:20px}form textarea.gcode{width:252px;height:150px}form small{margin:3px 0 0;display:block;clear:left}form .button{display:inline-block}form #passwordLabel,form #password{display:none}form input.error,form textarea.error,form select.error{border:red solid 2px}form .errorMsg{color:red;margin:0 0 0 1em} form{margin:10px;max-width:600px}form input{margin:1px}body,th,td{font-family:Helvetica,Arial,"Nimbus Sans L",sans-serif;font-size:13px}.settingsContainer{position:relative;width:100%;height:100%}form fieldset{max-width:600px;border:1px solid #bbb;border-radius:5px;-webkit-border-radius:5px;-moz-border-radius:5px;margin-bottom:20px;padding:8px}form fieldset fieldset{max-width:580px;margin:15px 0 5px;clear:left;float:left}form fieldset legend{margin-left:10px;font-weight:700}form label{min-width:150px;display:block;float:left;margin:1px 0 0;clear:left}form div{float:left}form input[type=text],form input[type=number],form input[type=password]{border:1px solid #90c0ff;margin-right:5px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}form input[type=text].small,form input[type=number].small,form input[type=password].small{width:50px}form input[type=text].large,form input[type=number].large,form input[type=password].large{width:250px}form input[type=radio]{margin:4px 4px 0 0}form textarea{border:1px solid #90c0ff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}form .startgcode_left{float:left;margin-right:20px}form textarea.gcode{width:252px;height:150px}form small{margin:3px 0 0;display:block;clear:left}form .button{display:inline-block}form #passwordLabel,form #password{display:none}form input.error,form textarea.error,form select.error{border:red solid 2px}form .errorMsg{color:red;margin:0 0 0 1em}form dl dt{float:left;font-style:italic;width:10em}

View File

@ -464,7 +464,7 @@ img {
-webkit-transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); -webkit-transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
right: -60%; right: -60%;
margin-top: 5%; margin: 5% 0%;
} }
#progressbarCanvas { #progressbarCanvas {
@ -573,6 +573,10 @@ img {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: none; display: none;
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select: text;
user-select: text;
} }
#contentOverlay #settings { #contentOverlay #settings {
@ -876,3 +880,179 @@ img {
/* for ie9 */ /* for ie9 */
} }
} }
/* Tourbus leg definitions element */
.tourbus-legs {
display: none;
}
/* Container for tourbus leg */
.tourbus-leg {
position: absolute;
visibility: hidden;
top: 0;
border: 1px solid #E5E5E5;
-webkit-box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
border-radius: 4px;
background: white;
}
/* Interior of leg, clearfixed */
.tourbus-leg-inner {
padding: 20px;
position: relative;
zoom: 1;
}
.tourbus-leg-inner:before,
.tourbus-leg-inner:after {
content: "\0020";
display: block;
height: 0;
overflow: hidden;
}
.tourbus-leg-inner:after {
clear: both;
}
.prevnextBtn {
border: 1px solid #8e8e8e;
color: #252525;
border-radius: 4px;
padding: 4px 8px;
background-color: #eaeaea;
-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
box-shadow: 0 0 3px rgba(0, 0, 0, 0.7);
margin-right: 8px;
}
/*
remove top padding/margin on headings
because the interior of the leg has padding
*/
.tourbus-leg h1,
.tourbus-leg h2,
.tourbus-leg h3,
.tourbus-leg h4,
.tourbus-leg h5,
.tourbus-leg h6 {
margin-top: 0;
padding-top: 0;
}
/* Tourbus leg arrow */
.tourbus-arrow:before,
.tourbus-arrow:after {
border: solid rgba(0, 0, 0, 0);
content: " ";
height: 0;
width: 0;
position: absolute;
pointer-events: none;
border-color: transparent;
}
/* set the :after to be the _interior_ size of the arrow */
/* set the :before to be the _interior + desired border width_ */
.tourbus-arrow:after {
border-width: 14px;
}
.tourbus-arrow:before {
border-width: 16px;
}
/* Arrow background and border colors */
/*
change margin-top/left values here to
match the border width for :after above
border colors here are for the _interior_ of the arrow
*/
.tourbus-arrow-right:after {
border-right-color: #ffffff;
margin-top: -14px;
top: 50%;
}
.tourbus-arrow-left:after {
border-left-color: #ffffff;
margin-top: -14px;
top: 50%;
}
.tourbus-arrow-bottom:after {
border-bottom-color: #ffffff;
margin-left: -14px;
left: 50%;
}
.tourbus-arrow-top:after {
border-top-color: #ffffff;
margin-left: -14px;
left: 50%;
}
/*
change margin-top/left values here to
match the border width for :before above
border colors here are for the _border_ of the arrow
*/
.tourbus-arrow-right:before {
border-right-color: #e5e5e5;
margin-top: -16px;
top: 50%;
}
.tourbus-arrow-left:before {
border-left-color: #e5e5e5;
margin-top: -16px;
top: 50%;
}
.tourbus-arrow-bottom:before {
border-bottom-color: #e5e5e5;
margin-left: -16px;
left: 50%;
}
.tourbus-arrow-top:before {
border-top-color: #e5e5e5;
margin-left: -16px;
left: 50%;
}
/* you shouldn't need to change these */
.tourbus-arrow-right:after,
.tourbus-arrow-right:before {
right: 100%;
}
.tourbus-arrow-left:after,
.tourbus-arrow-left:before {
left: 100%;
}
.tourbus-arrow-bottom:after,
.tourbus-arrow-bottom:before {
bottom: 100%;
}
.tourbus-arrow-top:after,
.tourbus-arrow-top:before {
top: 100%;
}

File diff suppressed because one or more lines are too long

0
www/favicon.ico Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

94
www/helpcontent.html Normal file
View File

@ -0,0 +1,94 @@
<div class="my-tour-overlay"></div>
<ol class='tourbus-legs' id='tour1'>
<!-- FIRST WELCOME -->
<li data-orientation='centered' data-highlight='true'>
<h2>Welcome to Doodle3D</h2>
<p>This is your first time starting the app. How about we show you around a bit?</p>
<a href='javascript:void(0);' class='prevnextBtn tourbus-next'>Yes</a>
<a href='javascript:void(0);' class='prevnextBtn endIntroTour'>No</a>
</li>
<!-- LEFT PANEL -->
<li data-el='.leftpanel' data-orientation='right' data-width='300' data-highlight='true'>
<h2>Leftpanel</h2>
<p>Random text which makes it all seem like there's something to say...</p>
<!--<a href='javascript:void(0);' class='prevnextBtn tourbus-prev'>Previous...</a>-->
<a href='javascript:void(0);' class='prevnextBtn tourbus-next'>Next...</a>
</li>
<li data-el='.new' data-orientation='right' data-width='300'>
<h2>New</h2>
<p>Random text which makes it all seem like there's something to say...</p>
<!--<a href='javascript:void(0);' class='prevnextBtn tourbus-prev'>Previous...</a>-->
<a href='javascript:void(0);' class='prevnextBtn tourbus-next'>Next...</a>
</li>
<li data-el='.prevnext' data-orientation='right' data-width='300'>
<h2>PrevNext</h2>
<p>Random text which makes it all seem like there's something to say...</p>
<!--<a href='javascript:void(0);' class='prevnextBtn tourbus-prev'>Previous...</a>-->
<a href='javascript:void(0);' class='prevnextBtn tourbus-next'>Next...</a>
</li>
<li data-el='.save' data-orientation='right' data-width='300'>
<h2>Save</h2>
<p>Random text which makes it all seem like there's something to say...</p>
<!--<a href='javascript:void(0);' class='prevnextBtn tourbus-prev'>Previous...</a>-->
<a href='javascript:void(0);' class='prevnextBtn tourbus-next'>Next...</a>
</li>
<li data-el='.oops' data-orientation='right' data-width='300'>
<h2>Oops</h2>
<p>Random text which makes it all seem like there's something to say...</p>
<!--<a href='javascript:void(0);' class='prevnextBtn tourbus-prev'>Previous...</a>-->
<a href='javascript:void(0);' class='prevnextBtn tourbus-next'>Next...</a>
</li>
<!-- RIGHT PANEL -->
<li data-el='.rightpanel' data-orientation='left' data-width='300' data-highlight='true'>
<h2>Leftpanel</h2>
<p>Random text which makes it all seem like there's something to say...</p>
<!--<a href='javascript:void(0);' class='prevnextBtn tourbus-prev'>Previous...</a>-->
<a href='javascript:void(0);' class='prevnextBtn tourbus-next'>Next...</a>
</li>
<li data-el='.print' data-orientation='left' data-width='300'>
<h2>print</h2>
<p>Random text which makes it all seem like there's something to say...</p>
<!--<a href='javascript:void(0);' class='prevnextBtn tourbus-prev'>Previous...</a>-->
<a href='javascript:void(0);' class='prevnextBtn tourbus-next'>Next...</a>
</li>
<li data-el='.stop' data-orientation='left' data-width='300'>
<h2>stop</h2>
<p>Random text which makes it all seem like there's something to say...</p>
<!--<a href='javascript:void(0);' class='prevnextBtn tourbus-prev'>Previous...</a>-->
<a href='javascript:void(0);' class='prevnextBtn tourbus-next'>Next...</a>
</li>
<li data-el='.progress' data-orientation='left' data-width='300'>
<h2>progress</h2>
<p>Random text which makes it all seem like there's something to say...</p>
<!--<a href='javascript:void(0);' class='prevnextBtn tourbus-prev'>Previous...</a>-->
<a href='javascript:void(0);' class='prevnextBtn tourbus-next'>Next...</a>
</li>
<li data-el='.thermo' data-orientation='left' data-width='300'>
<h2>thermo</h2>
<p>Random text which makes it all seem like there's something to say...</p>
<!--<a href='javascript:void(0);' class='prevnextBtn tourbus-prev'>Previous...</a>-->
<a href='javascript:void(0);' class='prevnextBtn tourbus-next'>Next...</a>
</li>
<li data-el='.info' data-orientation='left' data-width='300'>
<h2>info</h2>
<p>Random text which makes it all seem like there's something to say...</p>
<!--<a href='javascript:void(0);' class='prevnextBtn tourbus-prev'>Previous...</a>-->
<a href='javascript:void(0);' class='prevnextBtn tourbus-stop'>Got it...</a>
</li>
</ol>
<ol class='tourbus-legs' id='tour2'>
<li data-el='.info' data-orientation='left' data-width='200'>
<h2>INFO</h2>
<p>check out the info here anytime..</p>
<a href='javascript:void(0);' class='prevnextBtn tourbus-stop'>Got it</a>
</li>
</ol>

0
www/img/buttons/btnDown.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

0
www/img/buttons/btnNew.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

0
www/img/buttons/btnOk.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

0
www/img/buttons/btnOops.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

0
www/img/buttons/btnPrint.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

0
www/img/buttons/btnSave.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

0
www/img/buttons/btnStop.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

0
www/img/buttons/btnTurnLeft.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

0
www/img/buttons/btnUp.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

0
www/img/buttons/btnZoomIn.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

0
www/img/buttons/btnZoomOut.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
www/img/icon.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

BIN
www/img/logo/logo_full.png Executable file → Normal file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

47
www/index.html Executable file → Normal file
View File

@ -11,8 +11,10 @@
<meta id="Viewport" name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"> <meta id="Viewport" name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<link href="css/styles.css" rel="stylesheet" media="screen"> <!--link href="css/styles.css" rel="stylesheet" media="screen"-->
<link href="css/debug.css" rel="stylesheet" media="screen"> <!--link href="css/debug.css" rel="stylesheet" media="screen"-->
<link href="css/styles.min.css" rel="stylesheet" media="screen">
<link href="css/debug.min.css" rel="stylesheet" media="screen">
</head> </head>
<body> <body>
@ -43,12 +45,12 @@
<img class="btnPrint btn clearfix" src="img/buttons/btnPrint.png" /> <img class="btnPrint btn clearfix" src="img/buttons/btnPrint.png" />
<img class="btnStop btn clearfix disabled" src="img/buttons/btnStop.png" /> <img class="btnStop btn clearfix disabled" src="img/buttons/btnStop.png" />
<div class="progressbarCanvasContainerParent clearfix"> <div class="progressbarCanvasContainerParent">
<div id="progressbarCanvasContainer"> <div id="progressbarCanvasContainer">
<canvas id="progressbarCanvas" width="93" height="82"></canvas> <canvas id="progressbarCanvas" width="93" height="82"></canvas>
</div> </div>
</div> </div>
<div class="thermometerContainerParent clearfix"> <div class="thermometerContainerParent">
<div id="thermometerContainer"> <div id="thermometerContainer">
<canvas id="thermometerCanvas" width="90" height="120"></canvas> <canvas id="thermometerCanvas" width="90" height="120"></canvas>
</div> </div>
@ -130,21 +132,28 @@
<img class="vertImage" src="img/bg_vertical.png"/> <img class="vertImage" src="img/bg_vertical.png"/>
</div> </div>
<script src="js/libs/jquery-1.8.3.min.js"></script> <script src="js/libs/jquery-1.8.3.min.js"></script>
<script src="js/SettingsWindow.js"></script> <!--<script src="js/doodle3d-client.js"></script>-->
<script src="js/d3dServerInterfacing.js"></script> <script src="js/doodle3d-client.min.js"></script>
<script src="js/verticalShapes.js"></script>
<script src="js/buttonbehaviors.js"></script> <!-- DEBUG -->
<script src="js/canvasDrawing.js"></script> <!--
<script src="js/previewRendering.js"></script> <script src="../js_src/SettingsWindow.js"></script>
<script src="js/gcodeGenerating.js"></script> <script src="../js_src/UpdatePanel.js"></script>
<script src="js/init_layout.js"></script> <script src="../js_src/d3dServerInterfacing.js"></script>
<script src="js/Printer.js"></script> <script src="../js_src/verticalShapes.js"></script>
<script src="js/Progressbar.js"></script> <script src="../js_src/buttonbehaviors.js"></script>
<script src="js/Thermometer.js"></script> <script src="../js_src/canvasDrawing.js"></script>
<script src="js/utils.js"></script> <script src="../js_src/previewRendering.js"></script>
<script src="js/sidebar.js"></script> <script src="../js_src/gcodeGenerating.js"></script>
<script src="js/message.js"></script> <script src="../js_src/init_layout.js"></script>
<script src="js/main.js"></script> <script src="../js_src/Printer.js"></script>
<script src="../js_src/Progressbar.js"></script>
<script src="../js_src/Thermometer.js"></script>
<script src="../js_src/utils.js"></script>
<script src="../js_src/sidebar.js"></script>
<script src="../js_src/Message.js"></script>
<script src="../js_src/main.js"></script>
-->
</body> </body>
</html> </html>

3402
www/js/doodle3d-client.js Normal file

File diff suppressed because it is too large Load Diff

2
www/js/doodle3d-client.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,140 +0,0 @@
// TODO refactor this stuff, there's much to wipe
var drawAreaContainerMinHeight = 300;
var drawAreaContainerMaxHeight = 450;
function doOnResize() {
// console.log("doOnResize() >> " + new Date().getTime());
// $(".container").css("height", window.innerHeight);
/* 2013-10-09 commented out -> no more need with new layouting
$drawAreaContainer.css("marginLeft", -$drawAreaContainer.width()/2);
$drawAreaContainer.css("marginTop", -$drawAreaContainer.height() *.45);
// $drawAreaContainer.css("marginTop", -parseInt($drawAreaContainer.css("height")) * 0.45);
//*/
// canvas.width = $drawAreaContainer.width() - preview.width; // canvas.clientWidth;
// canvas.width = $("#mycanvasContainer").width();
canvas.width = $canvas.width();
canvas.height = $canvas.height(); // canvas.clientHeight;
// canvas.height = $drawAreaContainer.height(); // canvas.clientHeight;
preview.width = $preview.width();
preview.height = $drawAreaContainer.height();
canvasWidth = canvas.width;
canvasHeight = canvas.height;
console.log(" preview.width: " + preview.width + ", $preview.width(): " + $preview.width());
calcPreviewCanvasProperties();
// layerOffsetY = preview.height - 1.75 * layerCY;
// yStep = preview.height / 150;
// preview.width = parseInt($preview.css("width"), 10);
// preview.height = parseInt($preview.css("height"), 10);
// canvasWidth = canvas.width;
// canvasHeight = canvas.height;
drawCanvasTopLeftCoords[0] = drawCanvas.offset().left;
drawCanvasTopLeftCoords[1] = drawCanvas.offset().top;
// drawCanvasTopLeftCoords[0] = drawCanvas[0].offsetParent.offsetLeft;
// drawCanvasTopLeftCoords[1] = drawCanvas[0].offsetParent.offsetTop;
// preview.height = $("#previewContainer").height();
// console.log("f:doOnResize() >> preview.height: " + preview.height);
redrawDoodle();
redrawPreview();
return;
// doClientAndOrientationStuff() // <-- is this necessary in this method?
// console.log("f:doOnResize() >> $('#canvascontainer').innerHeight: " + window.innerHeight);
if (window.innerHeight < 768) {
// $('#drawAreaContainer').innerHeight(window.innerHeight - $("#drawAreaContainer").offset().top - 70);
var newVal = window.innerHeight - $("#drawAreaContainer").offset().top - 100; // what's the 70 ??
newVal = Math.max(newVal, drawAreaContainerMinHeight);
newVal = Math.min(newVal, drawAreaContainerMaxHeight);
$('#drawAreaContainer').innerHeight(newVal);
// canvas drawing area
$canvas.css("height", newVal);
canvas.height = newVal;
canvasWidth = canvas.width;
canvasHeight = canvas.height;
// preview area
$preview.css("height", newVal);
preview.height = newVal;
layerOffsetY = preview.height - 1.75 * layerCY;
yStep = preview.height / 150;
redrawDoodle();
redrawPreview();
}
}
function initLayouting() {
console.log("f:initLayouting()");
// first set the css width/height and actual width/height of the drawing area
<!--div drawAreaContainer 650,450-->
<!--canvas mycanvas 500, 450-->
<!--canvas preview 150, 450-->
// $doodleCanvas = $("#mycanvas");
// doodleCanvas = $("#mycanvas")[0];
// doodleCanvasContext = doodleCanvas.getContext('2d');
$drawAreaContainer = $(".drawareacontainer");
/* 2013-10-09 commented out -> no more need with new layouting
$drawAreaContainer.css("margin", 0);
$drawAreaContainer.css("marginLeft", -$drawAreaContainer.width()/2);
$drawAreaContainer.css("marginTop", -$drawAreaContainer.height() *.45);
//*/
// console.log(" preview.width: " + preview.width + ", $preview.width(): " + $preview.width());
// canvas.width = $drawAreaContainer.width() - preview.width; // canvas.clientWidth;
// canvas.width = $("#mycanvasContainer").width();
canvas.width = $canvas.width();
canvas.height = $canvas.height(); // canvas.clientHeight;
// canvas.height = $drawAreaContainer.height(); // canvas.clientHeight;
preview.width = $preview.width();
preview.height = $drawAreaContainer.height();
canvasWidth = canvas.width;
canvasHeight = canvas.height;
$drawAreaContainer.show();
// window.innerHeight
console.log("window.innerHeight: " + window.innerHeight);
console.log("window.innerWidth: " + window.innerWidth);
console.log("$drawAreaContainer.innerHeight(): " + $drawAreaContainer.innerHeight());
console.log("$drawAreaContainer.offset().top: " + $drawAreaContainer.offset().top);
/* 2013-07-26 not doing this resizing stuff now, it's not working well yet
if (window.innerHeight < 768) {
$('#drawAreaContainer').innerHeight(window.innerHeight - $("#drawAreaContainer").offset().top - 70);
}
//*/
// timeout because it SEEMS to be beneficial for initting the layout
// 2013-09-18 seems beneficial since when?
setTimeout(_startOrientationAndChangeEventListening, 1000);
}
function _startOrientationAndChangeEventListening() {
// Initial execution if needed
$(window).on('resize', doOnResize);
// is it necessary to call these? Aren't they called by the above eventhandlers?
// doClientAndOrientationStuff();
doOnResize();
}

7
www/js/libs/imagesloaded.pkgd.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
www/js/libs/jquery-tourbus.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,72 @@
/*jshint eqnull:true */
/*!
* jQuery Cookie Plugin v1.2
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2011, Klaus Hartl
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://www.opensource.org/licenses/mit-license.php
* http://www.opensource.org/licenses/GPL-2.0
*/
(function ($, document, undefined) {
var pluses = /\+/g;
function raw(s) {
return s;
}
function decoded(s) {
return decodeURIComponent(s.replace(pluses, ' '));
}
$.cookie = function (key, value, options) {
// key and at least value given, set cookie...
if (value !== undefined && !/Object/.test(Object.prototype.toString.call(value))) {
options = $.extend({}, $.cookie.defaults, options);
if (value === null) {
options.expires = -1;
}
if (typeof options.expires === 'number') {
var days = options.expires, t = options.expires = new Date();
t.setDate(t.getDate() + days);
}
value = String(value);
return (document.cookie = [
encodeURIComponent(key), '=', options.raw ? value : encodeURIComponent(value),
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
options.path ? '; path=' + options.path : '',
options.domain ? '; domain=' + options.domain : '',
options.secure ? '; secure' : ''
].join(''));
}
// key and possibly options given, get cookie...
options = value || $.cookie.defaults || {};
var decode = options.raw ? raw : decoded;
var cookies = document.cookie.split('; ');
for (var i = 0, parts; (parts = cookies[i] && cookies[i].split('=')); i++) {
if (decode(parts.shift()) === key) {
return decode(parts.join('='));
}
}
return null;
};
$.cookie.defaults = {};
$.removeCookie = function (key, options) {
if ($.cookie(key, options) !== null) {
$.cookie(key, null, options);
return true;
}
return false;
};
})(jQuery, document);

34
www/settings.html Executable file → Normal file
View File

@ -6,7 +6,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta id="Viewport" name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"> <meta id="Viewport" name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<link href="css/settings.css" rel="stylesheet" media="screen"> <link href="css/settings.min.css" rel="stylesheet" media="screen">
<!--link href="css/settings.css" rel="stylesheet" media="screen"-->
</head> </head>
<body> <body>
<div class="settingsContainer"> <div class="settingsContainer">
@ -61,6 +62,7 @@
<label for="wallThickness">Wall thickness:</label><input id="wallThickness" type="number" step="0.1" class="small" name="printer.wallThickness">mm<br> <label for="wallThickness">Wall thickness:</label><input id="wallThickness" type="number" step="0.1" class="small" name="printer.wallThickness">mm<br>
<label for="filamentThickness">Filament thickness:</label><input id="filamentThickness" step="0.01" type="number" class="small" name="printer.filamentThickness">mm<br> <label for="filamentThickness">Filament thickness:</label><input id="filamentThickness" step="0.01" type="number" class="small" name="printer.filamentThickness">mm<br>
<label for="temperature">Temperature:</label><input id="temperature" type="number" class="small" name="printer.temperature">degrees C<br> <label for="temperature">Temperature:</label><input id="temperature" type="number" class="small" name="printer.temperature">degrees C<br>
<label for="bedTemperature">Bed temperature:</label><input id="bedTemperature" type="number" class="small" name="printer.bed.temperature">degrees C<br>
<br> <br>
<label for="speed">Speed:</label><input id="speed" type="number" name="printer.speed" class="small">mm/s<br> <label for="speed">Speed:</label><input id="speed" type="number" name="printer.speed" class="small">mm/s<br>
<label for="travelSpeed">Travel speed:</label><input id="travelSpeed" type="number" name="printer.travelSpeed" class="small">mm/s<br> <label for="travelSpeed">Travel speed:</label><input id="travelSpeed" type="number" name="printer.travelSpeed" class="small">mm/s<br>
@ -75,7 +77,8 @@
<label for="retractionSpeed">Retraction speed:</label><input id="retractionSpeed" type="number" class="small" name="printer.retraction.speed">mm/s<br> <label for="retractionSpeed">Retraction speed:</label><input id="retractionSpeed" type="number" class="small" name="printer.retraction.speed">mm/s<br>
<br> <br>
<label for="heatupEnabled">Auto preheat:</label><input id="heatupEnabled" type="checkbox" name="printer.heatup.enabled" value="heatupEnabled"><br> <label for="heatupEnabled">Auto preheat:</label><input id="heatupEnabled" type="checkbox" name="printer.heatup.enabled" value="heatupEnabled"><br>
<label for="heatupTemperature">Auto preaheat temperature:</label><input id="heatupTemperature" type="number" class="small" name="printer.heatup.temperature"><br> <label for="heatupTemperature">Preheat temperature:</label><input id="heatupTemperature" type="number" class="small" name="printer.heatup.temperature"><br>
<label for="heatupBedTemperature">Preheat bed temperature:</label><input id="heatupBedTemperature" type="number" class="small" name="printer.heatup.bed.temperature"><br>
</fieldset> </fieldset>
<fieldset id="doodlesettings"> <fieldset id="doodlesettings">
@ -115,8 +118,7 @@
The text <em>%%MAC_ADDR_TAIL%%</em> will be replaced by the last 6 digits of your Doodle3D Wi-Fi box's MAC address.</small> The text <em>%%MAC_ADDR_TAIL%%</em> will be replaced by the last 6 digits of your Doodle3D Wi-Fi box's MAC address.</small>
<br> <br>
<label for="network">Network:</label> <label for="network">Network:</label>
<select id="network" name="network.client.network"> <select id="network" name="network.client.network"></select>
</select>
<input type="button" name="refresh" value="Refresh" class="button" id="refreshNetworks"/><br> <input type="button" name="refresh" value="Refresh" class="button" id="refreshNetworks"/><br>
<label for="password" id="passwordLabel">Password:</label><input type="password" name="network.client.password" id="password"><br> <label for="password" id="passwordLabel">Password:</label><input type="password" name="network.client.password" id="password"><br>
<input type="button" name="connect" value="Connect" class="button" id="connectToNetwork"/> <input type="button" name="connect" value="Connect" class="button" id="connectToNetwork"/>
@ -126,20 +128,32 @@
</fieldset> </fieldset>
</fieldset> </fieldset>
<fieldset id="updatePanel">
<legend>Update</legend>
<input type="button" name="update" value="Update" class="button" id="update"/>
<span id="updateState"></span><br/>
<small id="updateInfo"></small>
</fieldset>
<fieldset> <fieldset>
<legend>GCODE settings</legend> <legend>GCODE settings</legend>
<div class="startgcode_left"> <div class="startgcode_left">
<label for="startgcode">Start:</label><br/> <label for="startgcode">Start:</label><br/>
<textarea id="startgcode" class="gcode" name="printer.startgcode"> <textarea id="startgcode" class="gcode" name="printer.startgcode"></textarea>
</textarea>
</div> </div>
<div> <div>
<label for="endgcode">End:</label><br/> <label for="endgcode">End:</label><br/>
<textarea id="endgcode" class="gcode" name="printer.endgcode"> <textarea id="endgcode" class="gcode" name="printer.endgcode"></textarea>
</textarea>
</div> </div>
<small>The text <em>{printingTemp}</em> will be replaced by the printing temperature and <em>{preheatTemp}</em> will be replaced by the preaheat temperature.</small> <small>
The following texts are replaced:
<dl>
<dt>{printingTemp}</dt><dd>Printing temperature</dd>
<dt>{printingBedTemp}</dt><dd>Printing bed temperature</dd>
<dt>{preheatTemp}</dt><dd>Preheat temperature</dd>
<dt>{preheatBedTemp}</dt><dd>Preheat bed temperature</dd>
</dl>
</small>
</fieldset> </fieldset>
</form><br/> </form><br/>
</div> </div>