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

Small fixes

This commit is contained in:
peteruithoven 2014-02-10 14:54:24 +01:00
parent 079ed5a164
commit d8dea626fe
2 changed files with 8 additions and 4 deletions

View File

@ -29,10 +29,8 @@ function NetworkAPI() {
_wifiboxURL = wifiboxURL; _wifiboxURL = wifiboxURL;
_wifiboxCGIBinURL = wifiboxCGIBinURL; _wifiboxCGIBinURL = wifiboxCGIBinURL;
} }
this.scan = function(completeHandler) {
this.scan = function(completeHandler,failedHandler) { this.scan = function(completeHandler,failedHandler) {
//console.log("NetworkAPI:scan"); //console.log("NetworkAPI:scan");
//console.log(" _wifiboxURL: ",_wifiboxURL);
$.ajax({ $.ajax({
url: _wifiboxURL + "/network/scan", url: _wifiboxURL + "/network/scan",
type: "GET", type: "GET",

View File

@ -28,6 +28,8 @@ function NetworkPanel() {
var _currentAP; var _currentAP;
var _currentNetworkStatus; var _currentNetworkStatus;
var _retryDelay = 2000;
//var _retryRefreshNetworksDelay;
var _retryRetrieveStatusDelayTime = 1000; var _retryRetrieveStatusDelayTime = 1000;
var _retryRetrieveStatusDelay; var _retryRetrieveStatusDelay;
// after switching wifi network or creating a access point we delay the status retrieval // after switching wifi network or creating a access point we delay the status retrieval
@ -109,7 +111,7 @@ function NetworkPanel() {
} }
this.refreshNetworks = function(completeHandler) { this.refreshNetworks = function(completeHandler) {
//console.log("NetworkPanel:refreshNetworks"); //console.log("NetworkPanel:refreshNetworks");
_api.scan(function(data) { _api.scan(function(data) { // completed
//console.log("NetworkPanel:scanned"); //console.log("NetworkPanel:scanned");
_networks = {}; _networks = {};
var foundCurrentNetwork = false; var foundCurrentNetwork = false;
@ -132,7 +134,11 @@ function NetworkPanel() {
_self.selectNetwork(_currentNetwork); _self.selectNetwork(_currentNetwork);
} }
if(completeHandler) completeHandler(); if(completeHandler) completeHandler();
}); }/*,
function() { // failed
clearTimeout(_retryRefreshNetworksDelay);
_retryRetrieveStatusDelay = setTimeout(function() { _self.refreshNetworks(completeHandler); },_retryDelay); // retry after delay
}*/);
}; };
this.retrieveNetworkStatus = function(connecting) { this.retrieveNetworkStatus = function(connecting) {