mirror of
https://github.com/Doodle3D/doodle3d-connect.git
synced 2024-12-25 18:13:48 +01:00
Cleanup
This commit is contained in:
parent
34a28911f8
commit
1835a0275f
@ -6,7 +6,7 @@
|
||||
* See file LICENSE.txt or visit http://www.gnu.org/licenses/gpl.html for full license details.
|
||||
*/
|
||||
|
||||
var BoxPage = (function (w) {
|
||||
(function (w) {
|
||||
var _page;
|
||||
var _list;
|
||||
var _title;
|
||||
@ -58,29 +58,10 @@ var BoxPage = (function (w) {
|
||||
|
||||
|
||||
function retrieveNetworkStatus() {
|
||||
//console.log("retrieveNetworkStatus");
|
||||
_networkAPI.status(function(data) {
|
||||
//console.log("_networkAPI.status complete");
|
||||
//console.log(" data: ",data);
|
||||
data.status = parseInt(data.status,10);
|
||||
//console.log(" data.status: ",data.status);
|
||||
//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
|
||||
|
||||
setNetworkStatus(data.status);
|
||||
|
||||
/*// 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
|
||||
});
|
||||
@ -122,20 +103,4 @@ var BoxPage = (function (w) {
|
||||
_list.listview('refresh'); // jQuery mobile enhance content
|
||||
_networkStatus = 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);
|
@ -6,7 +6,7 @@
|
||||
* See file LICENSE.txt or visit http://www.gnu.org/licenses/gpl.html for full license details.
|
||||
*/
|
||||
|
||||
var BoxesPage = (function (w) {
|
||||
(function (w) {
|
||||
var _connectAPI = new ConnectAPI();
|
||||
|
||||
var _page;
|
||||
|
@ -6,7 +6,7 @@
|
||||
* See file LICENSE.txt or visit http://www.gnu.org/licenses/gpl.html for full license details.
|
||||
*/
|
||||
|
||||
(function ConnectingToNetworkPage(w) {
|
||||
(function (w) {
|
||||
|
||||
var _page;
|
||||
var _statusField;
|
||||
@ -185,6 +185,7 @@
|
||||
};
|
||||
_connectedBoxNetworkAPI.startAutoRefresh();
|
||||
}
|
||||
// when no wifiboxid or wifiboxSSID is available but we are online, we redirect to the boxes page
|
||||
function onListSuccess() {
|
||||
_backupRedirectDelay = setTimeout(function () {
|
||||
$.mobile.changePage("#boxes");
|
||||
|
@ -6,7 +6,7 @@
|
||||
* See file LICENSE.txt or visit http://www.gnu.org/licenses/gpl.html for full license details.
|
||||
*/
|
||||
|
||||
(function JoinNetworkPage(w) {
|
||||
(function (w) {
|
||||
|
||||
var _page;
|
||||
var _list;
|
||||
@ -25,7 +25,6 @@
|
||||
_page = $(this);
|
||||
_list = _page.find("ul[data-role=listview]");
|
||||
//_joinOtherItem = _list.find("#joinOther");
|
||||
//console.log(" list: ",_list);
|
||||
});
|
||||
$.mobile.document.on( "pagebeforeshow", PAGE_ID, function( event, data ) {
|
||||
console.log("Join network page pagebeforeshow");
|
||||
@ -85,5 +84,4 @@
|
||||
//_list.append(_joinOtherItem);
|
||||
_list.listview('refresh'); // jQuery mobile enhance content
|
||||
}
|
||||
})(window);
|
||||
//new JoinNetworkPage();
|
||||
})(window);
|
@ -6,7 +6,7 @@
|
||||
* See file LICENSE.txt or visit http://www.gnu.org/licenses/gpl.html for full license details.
|
||||
*/
|
||||
|
||||
(function JoinSecuredNetworkPage(w) {
|
||||
(function (w) {
|
||||
|
||||
var _page;
|
||||
var _title;
|
||||
|
17
js/main.js
17
js/main.js
@ -34,7 +34,6 @@ d3d.util = {
|
||||
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) {
|
||||
@ -78,7 +77,6 @@ d3d.util = {
|
||||
preventRefresh:function(event) {
|
||||
if((event.which === 82 && (event.ctrlKey || event.metaKey)) || // ctrl+r
|
||||
event.which === 116) { // F5
|
||||
console.log("d3d.util.preventRefresh");
|
||||
event.preventDefault();
|
||||
event.stopImmediatePropagation();
|
||||
return false;
|
||||
@ -92,7 +90,6 @@ d3d.util = {
|
||||
warning = "Are you sure you want to leave?";
|
||||
}
|
||||
window.onbeforeunload = function() {
|
||||
console.log("WARNING:"+warning);
|
||||
return warning;
|
||||
};
|
||||
},
|
||||
@ -105,22 +102,12 @@ d3d.util = {
|
||||
};
|
||||
|
||||
(function (w) {
|
||||
//$(function () {
|
||||
//to get to url parameters we need the url
|
||||
// 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( "pagebeforechange", function( event, data ) {
|
||||
//console.log("pagebeforechange");
|
||||
//console.log(" event: ",event);
|
||||
//console.log(" data: ",data);
|
||||
//d3d.pageParams[pageID]
|
||||
//console.log(" data.toPage: ",data.toPage);
|
||||
if (typeof data.toPage !== "string") { return; }
|
||||
|
||||
//console.log("pagebeforechange, data: ",data);
|
||||
if (typeof data.toPage !== "string") { return; }
|
||||
var url = d3d.util.parseURL(data.toPage);
|
||||
//console.log(" url: ",url);
|
||||
//console.log(" url.hash: ",url.hash);
|
||||
if(url.parameters === undefined) { return; }
|
||||
if(!d3d.pageParams) { d3d.pageParams = {}; }
|
||||
d3d.pageParams[url.hash] = url.parameters;
|
||||
|
Loading…
Reference in New Issue
Block a user