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

Merge branch 'master' into develop

This commit is contained in:
Wouter R 2013-11-22 18:03:17 +01:00
commit a545f8f2b1
9 changed files with 64 additions and 19 deletions

1
.gitignore vendored
View File

@ -3,6 +3,7 @@
.idea/*
www/js/*.js
www/js/libs/*.js
www/css/styles.css
www/css/*.min.css
__index.html

View File

@ -43,6 +43,7 @@ function SettingsWindow() {
this.retryLoadSettingsDelay; // retry setTimout instance
this.retrySaveSettingsDelay; // retry setTimout instance
this.retryResetSettingsDelay // retry setTimout instance
this.retryRetrieveNetworkStatusDelay;// retry setTimout instance
this.apFieldSet;
@ -119,7 +120,8 @@ function SettingsWindow() {
self.clientFieldSet = self.form.find("#clientSettings");
self.gcodeSettings = self.form.find("#gcodeSettings");
self.x3gSettings = self.form.find("#x3gSettings");
self.btnRestoreSettings = self.form.find("#restoreSettings");
btnAP.on('touchstart mousedown',self.showAPSettings);
btnClient.on('touchstart mousedown',self.showClientSettings);
btnRefresh.on('touchstart mousedown',self.refreshNetworks);
@ -127,6 +129,8 @@ function SettingsWindow() {
btnCreate.on('touchstart mousedown',self.createAP);
self.printerSelector.change(self.printerSelectorChanged);
networkSelector.change(self.networkSelectorChanged);
self.btnRestoreSettings.on('touchstart mousedown',self.resetSettings);
// update panel
var $updatePanelElement = self.form.find("#updatePanel");
@ -263,6 +267,40 @@ function SettingsWindow() {
});
}
}
this.resetSettings = function() {
console.log("resetSettings");
//$("#restoreSettings").addClass("disabled");
self.btnRestoreSettings.attr("disabled", true);
//console.log(" self.wifiboxURL: ",self.wifiboxURL);
if (communicateWithWifibox) {
$.ajax({
url: self.wifiboxURL + "/config/resetall",
type: "POST",
dataType: 'json',
timeout: this.timeoutTime,
success: function(response){
console.log("Settings:resetSettings response: ",response);
if(response.status == "error") {
clearTimeout(self.retryResetSettingsDelay);
self.retryResetSettingsDelay = setTimeout(function() { self.resetSettings() },self.retryDelay); // retry after delay
} else {
settings = response.data;
console.log(" settings: ",settings);
self.fillForm();
$(document).trigger(SettingsWindow.SETTINGS_LOADED);
self.btnRestoreSettings.removeAttr("disabled");
}
}
}).fail(function() {
console.log("Settings:resetSettings: failed");
clearTimeout(self.retryResetSettingsDelay);
self.retryResetSettingsDelay = setTimeout(function() { self.resetSettings() },self.retryDelay); // retry after delay
});
}
}
this.displayValidationError = function(key,msg) {
var formElement = self.form.find("[name|='"+key+"']");
formElement.addClass("error");

View File

@ -64,23 +64,28 @@
border: 1px solid rgb(187, 187, 187);
border-radius: 5px;
}
> .btnContainer {
> .right {
width: 15%;
height: 100%;
float:right;
position:relative;
right: 0;
> .btnOK {
position: absolute;
bottom: 3%;
right: 7%;
max-width: 85px;
min-width: 42px;
width: 88%;
height: auto;
margin: 0 2% 2% 0;
cursor: pointer;
> .btnContainer {
position: absolute;
bottom: 3%;
right: 7%;
width: 100%;
> .btn {
max-width: 85px;
min-width: 42px;
width: 88%;
height: auto;
margin: 8% 2% 2% 0;
cursor: pointer;
float:right;
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

@ -115,8 +115,10 @@
</div>
<div class="bottompanel">
<div class="settingsContainer"></div>
<div class="btnContainer">
<img src="img/buttons/btnOk_settings.png" class="btnOK" alt="settings"/>
<div class="right">
<div class="btnContainer">
<img src="img/buttons/btnOk_settings.png" class="btn btnOK" alt="save"/>
</div>
</div>
</div>
</div>

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
!function(a,b,c){function d(a){return a}function e(a){return decodeURIComponent(a.replace(f," "))}var f=/\+/g;a.cookie=function(f,g,h){if(g!==c&&!/Object/.test(Object.prototype.toString.call(g))){if(h=a.extend({},a.cookie.defaults,h),null===g&&(h.expires=-1),"number"==typeof h.expires){var i=h.expires,j=h.expires=new Date;j.setDate(j.getDate()+i)}return g=String(g),b.cookie=[encodeURIComponent(f),"=",h.raw?g:encodeURIComponent(g),h.expires?"; expires="+h.expires.toUTCString():"",h.path?"; path="+h.path:"",h.domain?"; domain="+h.domain:"",h.secure?"; secure":""].join("")}h=g||a.cookie.defaults||{};for(var k,l=h.raw?d:e,m=b.cookie.split("; "),n=0;k=m[n]&&m[n].split("=");n++)if(l(k.shift())===f)return l(k.join("="));return null},a.cookie.defaults={},a.removeCookie=function(b,c){return null!==a.cookie(b,c)?(a.cookie(b,null,c),!0):!1}}(jQuery,document);

File diff suppressed because one or more lines are too long

View File

@ -180,6 +180,10 @@
<legend>Debug</legend>
<input type="button" onclick="settingsWindow.downloadlogs()" name="downloadlogs" value="Download logs" class="button" id="downloadlogs"/>
</fieldset>
<fieldset id="restorePanel">
<legend>Restore</legend>
<input type="button" name="restoresettings" value="Restore settings to defaults" class="button" id="restoreSettings"/>
</fieldset>
</form><br/>
</div>
</body>