mirror of
https://github.com/Doodle3D/doodle3d-connect.git
synced 2024-12-25 01:53:48 +01:00
First jqm version
This commit is contained in:
parent
de030ac756
commit
a2caf7554d
180
js/Box.js
180
js/Box.js
@ -5,75 +5,137 @@
|
||||
* This software is licensed under the terms of the GNU GPL v2 or later.
|
||||
* See file LICENSE.txt or visit http://www.gnu.org/licenses/gpl.html for full license details.
|
||||
*/
|
||||
function Box() {
|
||||
|
||||
this.localip;
|
||||
this.wifiboxid;
|
||||
this.connecting = false;
|
||||
this.destroyedHandler;
|
||||
var BoxPage = (function (w) {
|
||||
var _page;
|
||||
var _title;
|
||||
var _intro;
|
||||
var _networkStatus;
|
||||
var _networkAPI = new NetworkAPI();
|
||||
var _boxData = {};
|
||||
var _retryRetrieveStatusDelay;
|
||||
var _retryRetrieveStatusDelayTime = 3000;
|
||||
var PAGE_ID = "#box";
|
||||
|
||||
var _element;
|
||||
var _networkPanel;
|
||||
var _delayedDestroy;
|
||||
var _self = this;
|
||||
|
||||
this.init = function(boxData,parentElement) {
|
||||
$.mobile.document.on( "pageinit", PAGE_ID, function( event, data ) {
|
||||
//console.log("Box page pageinit");
|
||||
_page = $(this);
|
||||
_title = _page.find(".ui-title");
|
||||
_intro = _page.find(".intro");
|
||||
|
||||
_self.localip = boxData.localip;
|
||||
_self.wifiboxid = boxData.wifiboxid;
|
||||
var url = "http://"+_self.localip;
|
||||
});
|
||||
$.mobile.document.on( "pagebeforeshow", PAGE_ID, function( event, data ) {
|
||||
console.log("Box page pagebeforeshow");
|
||||
_boxData = d3d.util.getPageParams(PAGE_ID);
|
||||
var boxURL = "http://"+_boxData.localip;
|
||||
console.log(" _boxData: ",_boxData);
|
||||
|
||||
// create box dom element
|
||||
var link = (boxData.link)? boxData.link : url;
|
||||
var linkElement = $("<a href='"+link+"' class='link'>"+_self.wifiboxid+"</a>");
|
||||
_element = $("<li id='"+_self.localip+"' class='box'></li>");
|
||||
_element.append(linkElement);
|
||||
_element.hide().appendTo(parentElement).fadeIn(500);
|
||||
_title.text(_boxData.wifiboxid);
|
||||
_intro.text("");
|
||||
|
||||
// create network panel dom element
|
||||
var networkPanelElement = $("#networkForm").clone();
|
||||
networkPanelElement.addClass(networkPanelElement.attr("id"));
|
||||
networkPanelElement.removeAttr("id");
|
||||
_element.append(networkPanelElement);
|
||||
var drawLink = (_boxData.link)? _boxData.link : boxURL;
|
||||
_page.find("#drawItem a").attr("href",drawLink);
|
||||
|
||||
// create network panel
|
||||
_networkPanel = new NetworkPanel();
|
||||
_networkPanel.id = _self.localip;
|
||||
_networkPanel.init(url,networkPanelElement, networkStatusChangeHandler);
|
||||
_networkAPI.init(boxURL);
|
||||
retrieveNetworkStatus();
|
||||
});
|
||||
|
||||
}
|
||||
function networkStatusChangeHandler(networkStatus) {
|
||||
console.log("Box:networkStatusChangeHandler: ",networkStatus);
|
||||
_self.connecting = (networkStatus == NetworkAPI.STATUS.CONNECTING);
|
||||
function retrieveNetworkStatus() {
|
||||
console.log("retrieveNetworkStatus");
|
||||
_networkAPI.status(function(data) {
|
||||
console.log("_networkAPI.status complete");
|
||||
console.log(" data: ",data);
|
||||
if(data.status !== "" && typeof data.status === 'string') {
|
||||
data.status = parseInt(data.status,10);
|
||||
}
|
||||
//console.log(_self.id,"NetworkPanel:retrievedStatus status: ",data.status,data.statusMessage);
|
||||
//console.log(" networkPanel ",_element[0]," parent: ",_element.parent()[0]);
|
||||
// ToDo: update _currentNetwork when available
|
||||
|
||||
// because openwrt can be slow to update it's ssid, a box might
|
||||
// report it failed connecting but is then slightly later connects
|
||||
// so we correct CONNECTING_FAILED to CONNECTED unless the box is connected by wire
|
||||
if(_self.localip != "192.168.5.1" && networkStatus == NetworkAPI.STATUS.CONNECTING_FAILED) {
|
||||
networkStatus = NetworkAPI.STATUS.CONNECTED;
|
||||
}
|
||||
setNetworkStatus(data.status,data);
|
||||
|
||||
_element.toggleClass("complex",(networkStatus !== NetworkAPI.STATUS.CONNECTED));
|
||||
|
||||
if(_self.connecting) {
|
||||
clearTimeout(_delayedDestroy);
|
||||
_delayedDestroy = setTimeout(function() {
|
||||
console.log("delayed remove");
|
||||
//removeBox(box,true);
|
||||
_self.destroy()
|
||||
}, 10000);
|
||||
}
|
||||
}
|
||||
this.destroy = function() {
|
||||
console.log("Box:destroy");
|
||||
clearTimeout(_delayedDestroy);
|
||||
|
||||
_networkPanel.destroy();
|
||||
|
||||
_element.fadeOut(500,function() {
|
||||
_element.remove();
|
||||
/*// Keep checking for updates?
|
||||
switch(data.status) {
|
||||
case NetworkAPI.STATUS.CONNECTING:
|
||||
case NetworkAPI.STATUS.CREATING:
|
||||
clearTimeout(_retryRetrieveStatusDelay);
|
||||
_retryRetrieveStatusDelay = setTimeout(_self.retrieveStatus,_retryRetrieveStatusDelayTime); // retry after delay
|
||||
break;
|
||||
}*/
|
||||
//if(completeHandler) completeHandler(data.status);
|
||||
}, function() {
|
||||
//console.log("NetworkPanel:retrieveStatus failed");
|
||||
clearTimeout(_retryRetrieveStatusDelay);
|
||||
_retryRetrieveStatusDelay = setTimeout(_self.retrieveStatus, _retryRetrieveStatusDelayTime); // retry after delay
|
||||
});
|
||||
|
||||
if(_self.destroyedHandler) _self.destroyedHandler(_self);
|
||||
}
|
||||
}
|
||||
function setNetworkStatus(status,data) {
|
||||
console.log("setNetworkStatus: ",status,data);
|
||||
if(status === NetworkAPI.STATUS.CONNECTED) { // online
|
||||
_page.find("#drawItem a").text("Draw");
|
||||
// ToDo: Link to update page (auto retrieve if available)
|
||||
// ToDo: Link to your app here?
|
||||
// ToDo: Status
|
||||
// ToDo: Control
|
||||
_page.find("#joinNetworkItem").toggleClass("ui-screen-hidden",true);
|
||||
|
||||
} else { // offline
|
||||
_intro.text("Please connect your WiFi-Box to the internet. You can also use it offline but then you aren't able to update.");
|
||||
|
||||
var joinNetworkItem = _page.find("#joinNetworkItem");
|
||||
joinNetworkItem.toggleClass("ui-screen-hidden",false);
|
||||
|
||||
var joinLink = joinNetworkItem.find("a").attr("href");
|
||||
joinLink = d3d.util.replaceURLParameters(joinLink,_boxData);
|
||||
joinNetworkItem.find("a").attr("href",joinLink);
|
||||
|
||||
_page.find("#drawItem a").text("Draw (offline)");
|
||||
|
||||
// ToDo: Status
|
||||
// ToDo: Control
|
||||
}
|
||||
|
||||
// update info
|
||||
/*switch(status) {
|
||||
case NetworkAPI.STATUS.CONNECTED:
|
||||
//console.log(" data.ssid: ",data.ssid);
|
||||
if(data.ssid == "") {
|
||||
_currentNetwork = undefined;
|
||||
//data.status = NetworkAPI.STATUS.NOT_CONNECTED;
|
||||
setStatus(NetworkAPI.STATUS.NOT_CONNECTED);
|
||||
} else {
|
||||
_currentNetwork = data.ssid;
|
||||
}
|
||||
break;
|
||||
case NetworkAPI.STATUS.CONNECTING:
|
||||
if(_selectedNetwork != undefined) {
|
||||
targetNetwork = _selectedNetwork;
|
||||
} else if(_currentNetwork != undefined) {
|
||||
targetNetwork = _currentNetwork;
|
||||
}
|
||||
case NetworkAPI.STATUS.CREATING:
|
||||
case NetworkAPI.STATUS.CREATED:
|
||||
_currentNetwork = undefined;
|
||||
break;
|
||||
}*/
|
||||
_networkStatus = data.status;
|
||||
}
|
||||
|
||||
// to get to the box data we need the url
|
||||
// only pagecontainer events contain url's
|
||||
/*$.mobile.document.on( "pagecontainerbeforetransition", function( event, data ) {
|
||||
//console.log("Box page pagebeforetransition");
|
||||
var url = d3d.util.processURL(data.absUrl);
|
||||
console.log(" url: ",url);
|
||||
if(url.hash == PAGE_ID) {
|
||||
_boxData = {
|
||||
localip: url.parameters.localip,
|
||||
wifiboxid: url.parameters.wifiboxid,
|
||||
link: url.parameters.link,
|
||||
url: "http://"+url.parameters.localip
|
||||
}
|
||||
}
|
||||
});*/
|
||||
})(window);
|
71
js/JoinNetwork.js
Normal file
71
js/JoinNetwork.js
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* This file is part of the Doodle3D project (http://doodle3d.com).
|
||||
*
|
||||
* Copyright (c) 2013, Doodle3D
|
||||
* This software is licensed under the terms of the GNU GPL v2 or later.
|
||||
* See file LICENSE.txt or visit http://www.gnu.org/licenses/gpl.html for full license details.
|
||||
*/
|
||||
|
||||
(function (w) {
|
||||
var _page;
|
||||
var _list;
|
||||
var _networks;
|
||||
// var _networkStatus;
|
||||
// var _networkAPI = new NetworkAPI();
|
||||
// var _boxData = {};
|
||||
// var _retryRetrieveStatusDelay;
|
||||
// var _retryRetrieveStatusDelayTime = 3000;
|
||||
var PAGE_ID = "#join_network";
|
||||
|
||||
var _self = this;
|
||||
|
||||
$.mobile.document.on( "pageinit", PAGE_ID, function( event, data ) {
|
||||
console.log("Join network page pageinit");
|
||||
_page = $(this);
|
||||
_list = _page.find("ul[data-role=listview]");
|
||||
console.log(" list: ",_list);
|
||||
});
|
||||
$.mobile.document.on( "pagebeforeshow", PAGE_ID, function( event, data ) {
|
||||
console.log("Join network page pagebeforeshow");
|
||||
_boxData = d3d.util.getPageParams(PAGE_ID);
|
||||
var boxURL = "http://"+_boxData.localip;
|
||||
console.log(" _boxData: ",_boxData);
|
||||
|
||||
_networkAPI.init(boxURL);
|
||||
refreshNetworks();
|
||||
});
|
||||
function refreshNetworks(completeHandler) {
|
||||
console.log("JoinNetwork:refreshNetworks");
|
||||
_api.scan(function(data) { // completed
|
||||
console.log("JoinNetwork:refreshNetworks:scanned");
|
||||
|
||||
fillNetworks(data.networks)
|
||||
_networks = {};
|
||||
$.each(data.networks, function(index,network) {
|
||||
_networks[network.ssid] = network;
|
||||
});
|
||||
|
||||
if(completeHandler) completeHandler();
|
||||
});
|
||||
}
|
||||
function fillNetworks(networks) {
|
||||
_list.empty();
|
||||
$.each(networks, function(index,network) {
|
||||
|
||||
var joinLink = joinNetworkItem.find("a").attr("href");
|
||||
joinLink = d3d.util.replaceURLParameters(joinLink,_boxData);
|
||||
joinNetworkItem.find("a").attr("href",joinLink);
|
||||
|
||||
|
||||
var link = "#network_connecting";
|
||||
link = d3d.util.replaceURLParameters(link,_boxData);
|
||||
//var item = $("<li></li>");
|
||||
|
||||
_list.append(
|
||||
//$("<option></option>").val(network.ssid).html(network.ssid)
|
||||
);
|
||||
});
|
||||
_list.listview('refresh'); // jQuery mobile enhance content
|
||||
}
|
||||
|
||||
})(window);
|
@ -7,9 +7,31 @@
|
||||
*/
|
||||
function ConnectAPI() {
|
||||
|
||||
// callbacks
|
||||
this.refreshing; // I'm refreshing my list
|
||||
this.listUpdated; // the list of boxes is updated / changed
|
||||
this.boxAppeared; // a new box appeared
|
||||
this.boxDisapeared; // a box disappeared
|
||||
//this.boxUpdated; // a box is updated / changed
|
||||
|
||||
var _apiURL = "http://connect.doodle3d.com/api";
|
||||
var _networkAPI = new NetworkAPI();
|
||||
var _timeoutTime = 3000;
|
||||
|
||||
var _refreshDelay;
|
||||
var _refreshInterval = 3000;
|
||||
var _running;
|
||||
var _listChanged = false;
|
||||
|
||||
var _wiredBox = {localip:"192.168.5.1",wifiboxid:"Wired WiFi-Box"};
|
||||
var _apBox = {localip:"192.168.10.1",wifiboxid:"WiFi-Box",link:"http://draw.doodle3d.com"};
|
||||
|
||||
var _boxTimeoutTime = 500;
|
||||
var _numBoxesChecking = 0; // count how many boxes we are checking
|
||||
var _numBoxesFound = 0; // count how many boxes responded
|
||||
var _boxes = {}; // current list of boxes
|
||||
var _numBoxes = 0; // current number of boxes
|
||||
|
||||
var _self = this;
|
||||
|
||||
this.list = function(completeHandler,failedHandler) {
|
||||
@ -33,4 +55,110 @@ function ConnectAPI() {
|
||||
if(failedHandler) failedHandler();
|
||||
});
|
||||
};
|
||||
|
||||
this.start = function(interval,listUpdated) {
|
||||
if(interval) {
|
||||
_refreshInterval = interval;
|
||||
}
|
||||
if(listUpdated) {
|
||||
_self.listUpdated = listUpdated;
|
||||
}
|
||||
_running = true;
|
||||
_self.refresh();
|
||||
}
|
||||
this.stop = function() {
|
||||
_running = false;
|
||||
clearTimeout(_refreshDelay);
|
||||
}
|
||||
this.refresh = function(listUpdated) {
|
||||
if(listUpdated) {
|
||||
_self.listUpdated = listUpdated;
|
||||
}
|
||||
if(_self.refreshing) {
|
||||
_self.refreshing();
|
||||
}
|
||||
|
||||
_self.list(function(foundBoxes) {
|
||||
//console.log(" foundBoxes: ",foundBoxes);
|
||||
foundBoxes.push(_wiredBox); // always check for a wired box
|
||||
updateList(foundBoxes);
|
||||
if(_running) {
|
||||
clearTimeout(_refreshDelay);
|
||||
_refreshDelay = setTimeout(_self.refresh, _refreshInterval);
|
||||
}
|
||||
//removeBox(_apBox.localip,true); // TODO: why again?
|
||||
}, function() {
|
||||
// if web is not accessible try to find a box as an accesspoint
|
||||
// if not found, we look for a wired box
|
||||
_networkAPI.alive(_apBox.localip,_boxTimeoutTime,function() {
|
||||
updateList([_apBox]);
|
||||
}, function() {
|
||||
updateList([_wiredBox]);
|
||||
});
|
||||
if(_running) {
|
||||
clearTimeout(_refreshDelay);
|
||||
_refreshDelay = setTimeout(_self.refresh, _refreshInterval);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function updateList(foundBoxes) {
|
||||
//console.log("updateList");
|
||||
_numBoxesChecking = 0;
|
||||
_numBoxesFound = 0;
|
||||
_listChanged = false;
|
||||
|
||||
// remove stored, but not found boxes
|
||||
jQuery.each(_boxes, function (index,box) {
|
||||
var found = false;
|
||||
jQuery.each(foundBoxes, function (index,foundBox) {
|
||||
if(foundBox.localip == box.localip &&
|
||||
foundBox.wifiboxid == box.wifiboxid) found = true;
|
||||
});
|
||||
if(!found) removeBox(box.localip);
|
||||
})
|
||||
|
||||
// check if all found boxes are alive
|
||||
jQuery.each(foundBoxes, function (index,foundBox) {
|
||||
checkBox(foundBox);
|
||||
});
|
||||
|
||||
if(foundBoxes.length == 0 && _self.listUpdated) {
|
||||
_self.listUpdated(_boxes);
|
||||
}
|
||||
}
|
||||
function checkBox(boxData) {
|
||||
//console.log(" checkBox: ",boxData.localip);
|
||||
_numBoxesChecking++;
|
||||
|
||||
_networkAPI.alive(boxData.localip,_boxTimeoutTime,function() {
|
||||
addBox(boxData);
|
||||
_numBoxesFound++;
|
||||
}, function() {
|
||||
removeBox(boxData.localip);
|
||||
},function(){
|
||||
_numBoxesChecking--;
|
||||
if(_numBoxesChecking <= 0 && _listChanged && _self.listUpdated) {
|
||||
_self.listUpdated(_boxes);
|
||||
}
|
||||
});
|
||||
}
|
||||
function getBox(localip) {
|
||||
return _boxes[localip];
|
||||
}
|
||||
function addBox(box) {
|
||||
if(getBox(box.localip) !== undefined) return;
|
||||
_boxes[box.localip] = box;
|
||||
_numBoxes++;
|
||||
if(_self.boxAppeared) _self.boxAppeared(box);
|
||||
_listChanged = true;
|
||||
}
|
||||
function removeBox(localip) {
|
||||
var box = getBox(localip);
|
||||
if(box === undefined) return;
|
||||
delete _boxes[localip];
|
||||
_numBoxes--;
|
||||
if(_self.boxDisapeared) _self.boxDisapeared(box);
|
||||
_listChanged = true;
|
||||
}
|
||||
}
|
@ -123,7 +123,7 @@ function NetworkAPI() {
|
||||
});
|
||||
};
|
||||
|
||||
this.alive = function(wifiboxURL,timeoutTime,completeHandler,failedHandler) {
|
||||
this.alive = function(wifiboxURL,timeoutTime,successHandler,failedHandler, completeHandler) {
|
||||
if(wifiboxURL.indexOf("http://") != 0) {
|
||||
wifiboxURL = "http://" + wifiboxURL;
|
||||
}
|
||||
@ -138,13 +138,16 @@ function NetworkAPI() {
|
||||
//console.log("NetworkAPI:alive response: ",response);
|
||||
if(response.status == "error" || response.status == "fail") {
|
||||
if(failedHandler) failedHandler(response);
|
||||
if(completeHandler) completeHandler(false, response);
|
||||
} else {
|
||||
completeHandler(response.data);
|
||||
successHandler(response.data);
|
||||
if(completeHandler) completeHandler(true, response.data);
|
||||
}
|
||||
}
|
||||
}).fail(function() {
|
||||
//console.log("NetworkAPI:alive failed");
|
||||
if(failedHandler) failedHandler();
|
||||
if(completeHandler) completeHandler(false);
|
||||
});
|
||||
};
|
||||
}
|
68
js/boxes.js
Normal file
68
js/boxes.js
Normal file
@ -0,0 +1,68 @@
|
||||
/*
|
||||
* This file is part of the Doodle3D project (http://doodle3d.com).
|
||||
*
|
||||
* Copyright (c) 2013, Doodle3D
|
||||
* This software is licensed under the terms of the GNU GPL v2 or later.
|
||||
* See file LICENSE.txt or visit http://www.gnu.org/licenses/gpl.html for full license details.
|
||||
*/
|
||||
|
||||
var BoxesPage = (function (w) {
|
||||
var connectAPI = new ConnectAPI(); // TODO add _
|
||||
|
||||
var _page;
|
||||
var _list;
|
||||
var _findItem;
|
||||
var PAGE_ID = "#boxes";
|
||||
|
||||
$.mobile.document.on( "pageinit", PAGE_ID, function( event, data ) {
|
||||
//console.log("Boxes page pageinit");
|
||||
_page = $(this);
|
||||
_list = _page.find("#boxeslist");
|
||||
_findItem = _list.find("#findItem");
|
||||
|
||||
connectAPI.refreshing = onRefreshing;
|
||||
connectAPI.listUpdated = onListUpdated;
|
||||
connectAPI.boxAppeared = onBoxAppeared;
|
||||
connectAPI.boxDisapeared = onBoxDisapeared;
|
||||
});
|
||||
$.mobile.document.on( "pagebeforeshow", PAGE_ID, function( event, data ) {
|
||||
//console.log("Boxes page pagebeforeshow");
|
||||
connectAPI.start();
|
||||
});
|
||||
$.mobile.document.on( "pagehide", PAGE_ID, function( event, data ) {
|
||||
//console.log("Boxes page pagehide");
|
||||
connectAPI.stop();
|
||||
});
|
||||
|
||||
function onRefreshing() {
|
||||
//console.log("onRefreshing");
|
||||
d3d.util.showLoader(true);
|
||||
}
|
||||
function onListUpdated(boxesData) {
|
||||
console.log("onListUpdated: ",boxesData);
|
||||
_list.append(_findItem); // make sure find is the last item
|
||||
_list.listview('refresh'); // jQuery mobile enhance content
|
||||
}
|
||||
function onBoxAppeared(boxData) {
|
||||
console.log("onBoxAppeared: ",boxData.localip);
|
||||
|
||||
var link = "#box?localip="+boxData.localip+"&wifiboxid="+boxData.wifiboxid;
|
||||
if(boxData.link) { link += "&link="+boxData.link; }
|
||||
var id = boxData.localip.replace(/\./g,"-");
|
||||
var linkElement = $("<a href='"+link+"' class='link'>"+boxData.wifiboxid+"</a>");
|
||||
var box = $("<li id='"+id+"' class='box'></li>");
|
||||
box.append(linkElement);
|
||||
box.hide().appendTo(_list).fadeIn(500);
|
||||
}
|
||||
function onBoxDisapeared(boxData) {
|
||||
console.log("onBoxDisapeared: ",boxData.localip);
|
||||
|
||||
var id = boxData.localip.replace(/\./g,"-");
|
||||
var box = _list.find("#"+id);
|
||||
console.log(" box: ",box);
|
||||
box.fadeOut(500,function() {
|
||||
box.remove();
|
||||
//_list.listview('refresh');
|
||||
});
|
||||
}
|
||||
})(window);
|
237
js/main.js
237
js/main.js
@ -5,165 +5,84 @@
|
||||
* This software is licensed under the terms of the GNU GPL v2 or later.
|
||||
* See file LICENSE.txt or visit http://www.gnu.org/licenses/gpl.html for full license details.
|
||||
*/
|
||||
var retrieveListInterval = 3000;
|
||||
var retrieveListDelay; // retry setTimout instance
|
||||
var boxTimeoutTime = 500;
|
||||
|
||||
var numBoxesChecking = 0; // count how many boxes we are checking
|
||||
var numBoxesFound = 0; // count how many boxes responded
|
||||
|
||||
var connectedBox = {localip:"192.168.5.1",wifiboxid:"Wired WiFi-Box"};
|
||||
var apBox = {localip:"192.168.10.1",wifiboxid:"WiFi-Box",link:"http://draw.doodle3d.com"};
|
||||
var connectAPI = "http://connect.doodle3d.com/api"
|
||||
|
||||
var $list;
|
||||
var $intro;
|
||||
var $hint;
|
||||
var $preloader;
|
||||
var spinner;
|
||||
|
||||
var boxes = {};
|
||||
var numBoxes = 0;
|
||||
|
||||
var networkAPI = new NetworkAPI();
|
||||
var connectAPI = new ConnectAPI();
|
||||
|
||||
$(function() {
|
||||
// console.log("ready");
|
||||
|
||||
networkAPI.init();
|
||||
|
||||
$intro = $("#intro");
|
||||
$list = $("#list");
|
||||
|
||||
$hint = $("#hint");
|
||||
$preloader = $("#preloader");
|
||||
|
||||
var spinnerSettings = {
|
||||
lines: 7, // The number of lines to draw
|
||||
length: 0, // The length of each line
|
||||
width: 14, // The line thickness
|
||||
radius: 15, // The radius of the inner circle
|
||||
corners: 1, // Corner roundness (0..1)
|
||||
rotate: 0, // The rotation offset
|
||||
direction: 1, // 1: clockwise, -1: counterclockwise
|
||||
color: '#57BF42', // #rgb or #rrggbb or array of colors
|
||||
speed: 1.2, // Rounds per second
|
||||
trail: 69, // Afterglow percentage
|
||||
shadow: false, // Whether to render a shadow
|
||||
hwaccel: false, // Whether to use hardware acceleration
|
||||
className: 'spinner', // The CSS class to assign to the spinner
|
||||
zIndex: 2e9, // The z-index (defaults to 2000000000)
|
||||
top: 'auto', // Top position relative to parent in px
|
||||
left: 'auto' // Left position relative to parent in px
|
||||
};
|
||||
spinner = new Spinner(spinnerSettings);
|
||||
spinner.spin($preloader[0]);
|
||||
|
||||
retrieveList();
|
||||
|
||||
// make sure all links are opened in same WebApp (added to homescreen)
|
||||
// and they don't start a browser
|
||||
$.stayInWebApp('a',true);
|
||||
});
|
||||
|
||||
function retrieveList() {
|
||||
$preloader.show();
|
||||
//spinner.spin($preloader[0]);
|
||||
connectAPI.list(function(foundBoxes) {
|
||||
//console.log(" foundBoxes: ",foundBoxes);
|
||||
foundBoxes.push(connectedBox);
|
||||
updateList(foundBoxes);
|
||||
clearTimeout(retrieveListDelay);
|
||||
retrieveListDelay = setTimeout(retrieveList, retrieveListInterval);
|
||||
removeBox(apBox.localip,true);
|
||||
}, function() {
|
||||
// if web is not accessible try to find the box as an accesspoint
|
||||
// if not found, we look for a wired box
|
||||
networkAPI.alive(apBox.localip,boxTimeoutTime,function() {
|
||||
updateList([apBox]);
|
||||
}, function() {
|
||||
updateList([connectedBox]);
|
||||
var d3d = {};
|
||||
d3d.util = {
|
||||
// Helper function that splits a URL just the way we want it
|
||||
parseURL:function(url) {
|
||||
var parsed = $.mobile.path.parseUrl( url );
|
||||
var hashParts = parsed.hash.split( "?" );
|
||||
var parameters = {};
|
||||
// Assemble query parameters object from the query string
|
||||
if (hashParts.length > 1) {
|
||||
$.each(hashParts[1].split( "&" ), function( index, value ) {
|
||||
var pair = value.split( "=" );
|
||||
if ( pair.length > 0 && pair[ 0 ] ) {
|
||||
parameters[ pair[ 0 ] ] =
|
||||
( pair.length > 1 ? pair[ 1 ] : true );
|
||||
}
|
||||
});
|
||||
}
|
||||
return {
|
||||
parsed: parsed,
|
||||
hash: ( hashParts.length > 0 ? hashParts[ 0 ] : "" ),
|
||||
parameters: parameters
|
||||
};
|
||||
},
|
||||
getPageParams:function(pageID) {
|
||||
return d3d.pageParams[pageID];
|
||||
},
|
||||
replaceURLParameters:function(href,parameters){
|
||||
//console.log("replaceURLParameters: ",href,parameters);
|
||||
href = href.split("?")[0];
|
||||
var i = 0;
|
||||
jQuery.each(parameters, function (key,value) {
|
||||
href += (i===0)? "?" : "&";
|
||||
href += key+"="+value;
|
||||
i++;
|
||||
});
|
||||
clearTimeout(retrieveListDelay);
|
||||
retrieveListDelay = setTimeout(retrieveList, retrieveListInterval); // retry after delay
|
||||
});
|
||||
}
|
||||
|
||||
function updateList(foundBoxes) {
|
||||
//console.log("updateList");
|
||||
numBoxesChecking = 0;
|
||||
numBoxesFound = 0;
|
||||
|
||||
if (foundBoxes===undefined) foundBoxes = [];
|
||||
|
||||
// remove displayed, but not found boxes
|
||||
jQuery.each(boxes, function (index,box) {
|
||||
var found = false;
|
||||
jQuery.each(foundBoxes, function (index,foundBox) {
|
||||
if(foundBox.localip == box.localip &&
|
||||
foundBox.wifiboxid == box.wifiboxid) found = true;
|
||||
});
|
||||
if(!found) removeBox(box.localip);
|
||||
})
|
||||
|
||||
// check if all found boxes are alive
|
||||
jQuery.each(foundBoxes, function (index,foundBox) {
|
||||
checkBox(foundBox);
|
||||
});
|
||||
|
||||
updateIntro();
|
||||
}
|
||||
|
||||
function checkBox(boxData) {
|
||||
//console.log(" checkBox: ",boxData.localip);
|
||||
numBoxesChecking++;
|
||||
|
||||
networkAPI.alive(boxData.localip,boxTimeoutTime,function() {
|
||||
addBox(boxData);
|
||||
numBoxesFound++;
|
||||
numBoxesChecking--;
|
||||
}, function() {
|
||||
removeBox(boxData.localip);
|
||||
numBoxesChecking--;
|
||||
});
|
||||
}
|
||||
function getBox(localip) {
|
||||
return boxes[localip];
|
||||
}
|
||||
function addBox(boxData) {
|
||||
if(getBox(boxData.localip) !== undefined) return;
|
||||
//console.log("addBox: ",boxData.localip);
|
||||
var box = new Box();
|
||||
box.init(boxData,$list);
|
||||
box.destroyedHandler = boxDestroyedHandler;
|
||||
boxes[box.localip] = box;
|
||||
numBoxes++;
|
||||
updateIntro();
|
||||
}
|
||||
function removeBox(localip,force) {
|
||||
var box = getBox(localip);
|
||||
if(box === undefined) return;
|
||||
//console.log("removeBox: ",localip," force: ",force);
|
||||
if(!force && box.connecting) return;
|
||||
//console.log(" calling destroyed");
|
||||
box.destroy();
|
||||
}
|
||||
function boxDestroyedHandler(box) {
|
||||
//console.log("boxDestroyedHandler");
|
||||
delete boxes[box.localip];
|
||||
numBoxes--;
|
||||
updateIntro();
|
||||
}
|
||||
|
||||
function updateIntro() {
|
||||
//console.log("updateIntro, numBoxes: ",numBoxes);
|
||||
if(numBoxes > 0) {
|
||||
$intro.html("Found the following boxes near you:");
|
||||
$hint.fadeOut();
|
||||
} else {
|
||||
$intro.html("No boxes found near you.");
|
||||
$hint.fadeIn();
|
||||
return href;
|
||||
},
|
||||
showLoader:function(autoHide) {
|
||||
setTimeout(function(){
|
||||
$.mobile.loading('show');
|
||||
if(autoHide) {
|
||||
setTimeout(function() {
|
||||
$.mobile.loading('hide');
|
||||
},1000);
|
||||
}
|
||||
}, 1);
|
||||
},
|
||||
hideLoader:function() {
|
||||
$.mobile.loading('hide');
|
||||
}
|
||||
$preloader.fadeOut(1000);
|
||||
}
|
||||
};
|
||||
|
||||
(function (w) {
|
||||
|
||||
/*$.mobile.document.on( "pagebeforechange", function( event, data ) {
|
||||
console.log("pagebeforechange");
|
||||
//console.log(" event: ",event);
|
||||
//console.log(" data: ",data);
|
||||
d3d.pageParams[pageID]
|
||||
|
||||
if ($.type(data.toPage) === "string") {
|
||||
console.log(" data.toPage: ",data.toPage);
|
||||
//var url = d3d.util.processURL(data.toPage);
|
||||
//data.url = url;
|
||||
// add to data attribute of target page ?
|
||||
}
|
||||
});*/
|
||||
|
||||
// to get to url parameters we need the url
|
||||
// only pagecontainer events contain url's
|
||||
// we parse the parameters and store them in a global object
|
||||
$.mobile.document.on( "pagecontainerbeforetransition", function( event, data ) {
|
||||
//console.log("pagecontainerbeforetransition");
|
||||
var url = d3d.util.parseURL(data.absUrl);
|
||||
//console.log(" url: ",url);
|
||||
if(!d3d.pageParams) { d3d.pageParams = {}; }
|
||||
d3d.pageParams[url.hash] = url.parameters;
|
||||
});
|
||||
|
||||
})(window);
|
31
less/styles.less
Normal file
31
less/styles.less
Normal file
@ -0,0 +1,31 @@
|
||||
body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#logo {
|
||||
|
||||
margin: 10px 5px 5px 5px;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
.ui-content{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ui-content p{
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#drawingCanvas {
|
||||
border: 2px solid black;
|
||||
height: 20em;
|
||||
width: 100%;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 768px) {
|
||||
body {
|
||||
padding-left: 20em;
|
||||
padding-right: 20em;
|
||||
}
|
||||
}
|
BIN
www/img/Connect to home.png
Normal file
BIN
www/img/Connect to home.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.7 KiB |
BIN
www/img/Step_1.png
Normal file
BIN
www/img/Step_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
462
www/index.html
Normal file
462
www/index.html
Normal file
@ -0,0 +1,462 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Doodle3D Connect</title>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
|
||||
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="./img/apple-touch-icon-144x144-precomposed.png">
|
||||
<link rel="shortcut" sizes="144x144" href="./img/apple-touch-icon-144x144-precomposed.png">
|
||||
<link rel="icon" type="image/ico" href="./img/favicon.ico">
|
||||
|
||||
<!-- <link rel="stylesheet" href="js/libs/jquery.mobile/jquery.mobile-1.4.2.min.css" /> -->
|
||||
<!-- <link rel="stylesheet" href="css/add2home.css" media="screen"> -->
|
||||
<link rel="stylesheet" href="css/doodle3d-server.min.css"/>
|
||||
|
||||
<!-- <script src="jquery/jquery-1.11.0.min.js"></script>
|
||||
<script src="jquery.mobile/jquery.mobile-1.4.2.min.js"></script>
|
||||
<script src="js/libs/spin.min.js" type="text/javascript"></script>
|
||||
<script src="js/libs/add2home.js" type="text/javascript"></script>
|
||||
<script src="js/libs/jquery.showpassword.js" type="text/javascript"></script>
|
||||
<script src="js/libs/jquery.stayInWebApp.js" type="text/javascript"></script>
|
||||
<script src="js/api/NetworkAPI.js" type="text/javascript"></script>
|
||||
<script src="js/api/ConnectAPI.js" type="text/javascript"></script>
|
||||
<script src="js/main.js"></script>
|
||||
<script src="js/boxes.js"></script>
|
||||
<script src="js/box.js"></script> -->
|
||||
<script src="js/doodle3d-server.js" type="text/javascript"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- Start of first page -->
|
||||
<div data-role="page" id="boxes">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
<p>makes 3D printing very easy</p>
|
||||
|
||||
<!-- <p>Please select your Doodle3D WiFi-Box to connect or press search to add your box to this list.</p> -->
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
|
||||
<ul data-role="listview" id="boxeslist">
|
||||
<!-- <li><a href="#wifibox">Doodle3D-A4D953</a></li>
|
||||
<li><a href="#wifibox">Doodle3D-Rick</a></li>
|
||||
<li><a href="#wifibox">Doodle3D-D63BA4</a></li>
|
||||
<li><a href="#connect_ap">Wired WiFi-Box</a></li> -->
|
||||
<li id="findItem"><a href="#find">Find...</a></li>
|
||||
</ul>
|
||||
|
||||
</div><!-- /content -->
|
||||
|
||||
</div><!-- /page -->
|
||||
|
||||
|
||||
<div data-role="page" id="box">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1></h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
<p class="intro"></p>
|
||||
<ul data-role="listview">
|
||||
<li id="drawItem"><a href="#draw">Draw</a></li>
|
||||
<li id="updateItem"><a href="#update">Update</a></li>
|
||||
<li id="joinNetworkItem"><a href="#join_network">Join network</a></li>
|
||||
</ul>
|
||||
|
||||
</div><!-- /content -->
|
||||
|
||||
</div><!-- /page -->
|
||||
</body>
|
||||
|
||||
<!-- Start of FIND page -->
|
||||
<div data-role="page" id="find">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Find a WiFi-Box</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
|
||||
<img id = "logo" src="img/Step_1.png">
|
||||
<h1>Step 1 of 2</h1>
|
||||
<p>There's a big chance the Doodle3D WiFi-Box you're looking for is running it's own network. Please open your network settings and connect to a network like 'Doodle3D-...'. Once connected return to this page.<small> (<a href="#problems">problems?</a>)</small>
|
||||
|
||||
<a href="#find_step2" class="ui-btn">Next</a>
|
||||
|
||||
</div><!-- /content -->
|
||||
</div><!-- /page -->
|
||||
|
||||
|
||||
<!-- Start of FIND_STEP2 page -->
|
||||
<div data-role="page" id="find_step2">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Find a WiFi-Box</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
|
||||
<h1>Step 2 of 2</h1>
|
||||
|
||||
<p>We found your Doodle3D WiFi-Box. Please connect your WiFi-Box to the internet. You can also use it offline but then you aren't able to update.</p>
|
||||
<br>
|
||||
<ul data-role="listview">
|
||||
<li><a href="#network">Connect to the internet</a></li>
|
||||
<li><a href="#draw">Draw (offline)</a></li>
|
||||
</ul>
|
||||
|
||||
</div><!-- /content -->
|
||||
</div><!-- /page -->
|
||||
|
||||
<!-- Start of STEP1_PROBLEMS page -->
|
||||
<div data-role="page" id="problems">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Troubleshooting</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
|
||||
<p>Having troubles getting started with your WiFi-Box?</p>
|
||||
|
||||
<h3><p>Make sure that:</p></h3>
|
||||
<ul>
|
||||
<li><p>The box gets power (green lights should be on).</p></li>
|
||||
<li><p>The box has fully started (takes a minute or two)?</p></li>
|
||||
<li><p>You are looking for the WiFi-Box in your local WiFi list. <a href="#locate_wifibox">more info</a></p></li> <!-- link to explenation how to connect to a WiFi-->
|
||||
</ul>
|
||||
|
||||
<h3><p>That is not the problem?</p></h3>
|
||||
<ul>
|
||||
<li><p>Is your box connected to another network? <a href="#reset">more info</a></p></li>
|
||||
<li><p>If your computer has an ethernet (network) port you can connect it directly to the Doodle3D WiFi-Box using the supplied ethernet cable. <a href="#ethernet">more info</a></p></li> <!-- explain how to connect a ethernet cable and what is next -->
|
||||
<!-- There should be a point about repeaters as well, for which we do not have a solution yet -->
|
||||
</ul>
|
||||
|
||||
<h3><p>Got stuck?</p></h3>
|
||||
<ul>
|
||||
<li><p>If the problems remain please email us at <a href="mailto:help@doodle3d.com">help@doodle3d.com</a></p></li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div><!-- /content -->
|
||||
</div><!-- /page -->
|
||||
|
||||
<div data-role="page" id="ethernet">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Troubleshooting</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
<p>If your computer has an Ethernet port you are able to connect to the WiFi-Box through the Ethernet cable. Use the Ethernet cable that is provided with the WiFi-Box. Plug one end of the cable in the WiFi-Box and the other in your computer. Usually this forces the connection of your WiFi-Box over the connection of the internet, making you able to connect to the WiFi-Box but unable to connect to the internet.</p> <p>If this is not the case, search for a connection icon (on WINDOWS usually in the lower right corner and for MAC usually in the upper right corner). Click on the icon and search for options to change your current network(probably wireless) to a cable connection.</p><p>Once your computer is connected to the WiFi-Box, return to this page. The 'Find' page will automatically change if you have a connection to a WiFi-Box and will guide you further.</p>
|
||||
</div><!-- /content -->
|
||||
</div><!-- /page -->
|
||||
|
||||
<div data-role="page" id="locate_wifibox">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Troubleshooting</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
<h3>Locate WiFi-Box</h3>
|
||||
<p>If you are able to connect to connect.doodle3d.com through the internet this means you are connected to a network.</p>
|
||||
<ul>
|
||||
<li><p>If your device can connect to the internet wirelessly it is able to connect to the WiFi-Box through WiFi.</p></li>
|
||||
<li><p>If your device is only able to connect to the internet through a cable it is usaully able to connect to the WiFi-Box through the Ethernet cable. In that case you are able to find more info <a href="#ethernet">here</a>.</p></li>
|
||||
</ul>
|
||||
<p>If you run the WiFi-Box for the first time it creates its own network. So aside of the network you are using right now to access the internet there is another network named 'Doodle3D-...' followed by the last 6 characters of the code that is printed on the side of the WiFi-Box.</p>
|
||||
<p>To access this network you have to connect to the WiFi-Box network <strong>instead</strong> of your own network. How you are able to switch between a network differs from device you are using, here is a list of the most common used devices:</p>
|
||||
<ul>
|
||||
<li><p>SMARTPHONE/TABLET: Smartphones or tablets usually have a settings option in their main menu. Within the settings menu there usually is an option to change settings about your WiFi connection. Usually you are able to switch between different WiFi-spots (Networks) within these settings. Look for a list with different WiFi-spots, if everything works fine, and your WiFi-Box is on, there should be a WiFi-spot called 'Doodle3D...' followed by the last 6 characters of the code that is printed on the side of the WiFi-Box. Connect to this WiFi-spot and return to this page.</p></li>
|
||||
<li><p>WINDOWS COMPUTER/LAPTOP: Windows computers usually (from windows Vista and above) have a small icon in the right lower corner of the screen which displays if you are currently connected to the internet (and if your connection is wireless or not). If you click on this icon a list will display with the network you are currently using and the networks that your computer is able to connect to. If everything works fine, and your WiFi-Box is on, there should be a WiFi-spot called 'Doodle3D...' followed by the last 6 characters of the code that is printed on the side of the WiFi-Box within this list. Connect to this WiFi-spot and return to this page.</p></li>
|
||||
<li><p>MAC COMPUTER/LAPTOP: For most MAC computers there is a small WiFi icon in the upper right corner of their screen. If the WiFi connection is on you can click on the icon and a list with possible networks would appear. If everything works fine, and your WiFi-Box is on, there should be a WiFi-spot called 'Doodle3D...' followed by the last 6 characters of the code that is printed on the side of the WiFi-Box. Connect to this WiFi-spot and return to this page.</p></li>
|
||||
</ul>
|
||||
|
||||
<p>Once you are connect to the WiFi-spot, the 'Find' page will automatically change and will guide you through the next steps.</p>
|
||||
</div><!-- /content -->
|
||||
</div><!-- /page -->
|
||||
|
||||
<!-- Start of CONNECT AP page -->
|
||||
<div data-role="page" id="connect_ap">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Doodle3D-987654 (accesspoint)</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
|
||||
<ul data-role="listview">
|
||||
<li><a href="#network">Join a network</a></li>
|
||||
<li><a href="#draw">Draw (offline)</a></li>
|
||||
</ul>
|
||||
|
||||
</div><!-- /content -->
|
||||
</div><!-- /page -->
|
||||
|
||||
|
||||
|
||||
<!-- Start of reset page -->
|
||||
<div data-role="page" id="reset">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Troubleshooting</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
|
||||
<p>If your WiFi-Box is already connected to another network, it is possible to reset the WiFi-Box and make it run it's own network again.</p>
|
||||
<ul>
|
||||
<li><p>You can do this by press and holding the green light button on the top of the WiFi-Box. By holding this button for 3 seconds the WiFi-Box will reset its own network.</p></li>
|
||||
|
||||
<li><p>If you have a device with an Ethernet port, it is always possible to connect your WiFi-Box through the ethernet cable.</p></li>
|
||||
</ul>
|
||||
|
||||
</div><!-- /content -->
|
||||
</div><!-- /page -->
|
||||
|
||||
<!-- Start of first page -->
|
||||
<div data-role="page" id="status">
|
||||
|
||||
<img id="logo" src="img/logo_full.png">
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Ultimaker @ Doodle3D-123456</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
|
||||
<ul data-role="listview">
|
||||
<li data-role="list-divider">temperature</li>
|
||||
<li>nozzle: 223</li>
|
||||
<li>bed: 85</li>
|
||||
<li data-role="list-divider">progress</li>
|
||||
<li>printing time: 20m</li>
|
||||
<li>time left: 2h30</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div><!-- /content -->
|
||||
|
||||
</div><!-- /page -->
|
||||
|
||||
|
||||
<div data-role="page" id="join_network">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Join network</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
<p>Select your own network from the following list:</p>
|
||||
<br/>
|
||||
<ul data-role="listview">
|
||||
<!-- <li data-icon="lock"><a href="#join_secured_network">Baksteen</a></li>
|
||||
<li><a href="#connecting_to_network">Thomson12445</a></li>
|
||||
<li><a href="#connecting_to_network">H234SD53</a></li>
|
||||
<li data-icon="edit"><a href="#join_other_network">Other...</a></li> -->
|
||||
</ul>
|
||||
</div><!-- /content -->
|
||||
|
||||
</div><!-- /page -->
|
||||
|
||||
|
||||
<div data-role="page" id="join_other_network">
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Connect</h1>
|
||||
</div><!-- /header -->
|
||||
<div role="main" class="ui-content">
|
||||
<h3>Join a hidden network</h3>
|
||||
<input type="text" name="textinput-s" id="ssid" placeholder="Network name" value="" data-clear-btn="true">
|
||||
<input type="password" name="textinput-s" id="textinput-s" placeholder="Password" value="" data-clear-btn="true">
|
||||
<button class="ui-shadow ui-btn ui-corner-all">Connect</button>
|
||||
</div><!-- /content -->
|
||||
</div><!-- /page -->
|
||||
|
||||
<div data-role="page" id="join_secured_network">
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Connect</h1>
|
||||
</div><!-- /header -->
|
||||
<div role="main" class="ui-content">
|
||||
<h3>Join a secured network</h3>
|
||||
<input type="password" name="textinput-s" id="textinput-s" placeholder="Password" value="" data-clear-btn="true">
|
||||
<button class="ui-shadow ui-btn ui-corner-all">Connect</button>
|
||||
</div><!-- /content -->
|
||||
</div><!-- /page -->
|
||||
|
||||
<div data-role="page" id="connecting_to_network">
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Connect</h1>
|
||||
</div><!-- /header -->
|
||||
<div role="main" class="ui-content">
|
||||
<img id="logo" src="img/Connect to home.png">
|
||||
<h3>Connecting to network...</h3>
|
||||
<p>Your WiFi-Box is trying to connect to your local network. To use your WiFi-Box, reconnect to the network you directed the WiFi-Box to. Once you are connected return to this page.</p>
|
||||
<!-- redirect to connect.doodle3d.com when reconnected to internet -->
|
||||
</div><!-- /content -->
|
||||
</div><!-- /page -->
|
||||
|
||||
<div data-role="page" id="draw">
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
<div id="drawingCanvas"></div>
|
||||
</div><!-- /content -->
|
||||
|
||||
</div><!-- /page -->
|
||||
|
||||
|
||||
<div data-role="page" id="settings">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
<p>Settings</p>
|
||||
|
||||
</div><!-- /content -->
|
||||
|
||||
</div><!-- /page -->
|
||||
|
||||
|
||||
<div data-role="page" id="tune">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Ultimaker @ Doodle3D-123456</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
|
||||
<h3>Tune [current value's]</h3>
|
||||
<div data-role="fieldcontain">
|
||||
<label for="slider-0">Speed [<div id="divSpeed" style="display: inline;">100</div>%]:</label>
|
||||
<input type="range" name="slider" id="slider-0" value="100" min="0" max="300" step="1" />
|
||||
</div>
|
||||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="slider-0">Temp [<div id="divHotend" style="display: inline;"></div>°C/<div id="divHotendTarget" style="display: inline;">0</div>°C]:</label>
|
||||
<input type="range" name="printer.temperature" id="sliderHotend" value="200" min="0" max="250" step="1" />
|
||||
</div>
|
||||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="slider-0">Flow [<div id="divFlow" style="display: inline;">100</div>%]:</label>
|
||||
<input type="range" name="slider" id="slider-0" value="100" min="10" max="300" step="1" />
|
||||
</div>
|
||||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="slider-0">Fan Speed [<div id="divFan" style="display: inline;">0</div>%]:</label>
|
||||
<input type="range" name="slider" id="slider-0" value="255" min="0" max="255" step="1" />
|
||||
</div>
|
||||
|
||||
<div data-role="fieldcontain">
|
||||
<label for="basic">Custom gcode:</label>
|
||||
<input type="text" name="name" id="basic" value="" />
|
||||
</div>
|
||||
<div class="ui-body">
|
||||
<fieldset class="ui-grid-a">
|
||||
<div class="ui-block-a"><button type="submit" data-theme="c">Cancel</button></div>
|
||||
<div class="ui-block-b"><button type="submit" data-theme="b">Submit</button></div>
|
||||
</fieldset>
|
||||
</div>
|
||||
|
||||
</div><!-- /content -->
|
||||
</div><!-- /page -->
|
||||
|
||||
|
||||
<div data-role="page" id="control">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Ultimaker @ Doodle3D-123456</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
|
||||
<h3>Control</h3>
|
||||
|
||||
<div class="ui-grid-a">
|
||||
<div class="ui-block-a"><button type="submit" data-theme="c" class="ui-btn ui-icon-arrow-l ui-btn-icon-left">X-</button></div>
|
||||
<div class="ui-block-b"><button type="submit" data-theme="c" class="ui-btn ui-icon-arrow-r ui-btn-icon-right">X+</button></div>
|
||||
</div>
|
||||
|
||||
<div class="ui-grid-a">
|
||||
<div class="ui-block-a"><button type="submit" data-theme="c" class="ui-btn ui-icon-arrow-u ui-btn-icon-left">Y-</button></div>
|
||||
<div class="ui-block-b"><button type="submit" data-theme="c" class="ui-btn ui-icon-arrow-d ui-btn-icon-right">Y+</button></div>
|
||||
</div>
|
||||
|
||||
<div class="ui-grid-a">
|
||||
<div class="ui-block-a"><button type="submit" data-theme="c" class="ui-btn ui-icon-arrow-u ui-btn-icon-left">Z-</button></div>
|
||||
<div class="ui-block-b"><button type="submit" data-theme="c" class="ui-btn ui-icon-arrow-d ui-btn-icon-right">Z+</button></div>
|
||||
</div>
|
||||
|
||||
</div><!-- /content -->
|
||||
|
||||
</div><!-- /page -->
|
||||
|
||||
|
||||
<div data-role="page" id="update">
|
||||
|
||||
<a href="#devices"><img id="logo" src="img/logo_full.png"></a>
|
||||
|
||||
<div data-role="header">
|
||||
<a href="../toolbar/" data-rel="back" class="ui-btn ui-btn-left ui-alt-icon ui-nodisc-icon ui-corner-all ui-btn-icon-notext ui-icon-carat-l">Back</a>
|
||||
<h1>Update</h1>
|
||||
</div><!-- /header -->
|
||||
|
||||
<div role="main" class="ui-content">
|
||||
|
||||
</div><!-- /content -->
|
||||
|
||||
</div><!-- /page -->
|
||||
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$( "[data-role='header'], [data-role='footer']" ).toolbar();
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user