mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-11-22 01:07:56 +01:00
Improved retain configuration over update ui
This commit is contained in:
parent
d5220225cc
commit
ae5950eb08
@ -45,18 +45,18 @@ function UpdatePanel() {
|
|||||||
this.wifiboxURL = wifiboxURL;
|
this.wifiboxURL = wifiboxURL;
|
||||||
|
|
||||||
this.element = updatePanelElement;
|
this.element = updatePanelElement;
|
||||||
this.noRetainCheckbox = this.element.find("#noRetain");
|
this.retainCheckbox = this.element.find("#retainConfiguration");
|
||||||
this.btnUpdate = this.element.find("#update");
|
this.btnUpdate = this.element.find("#update");
|
||||||
this.statusDisplay = this.element.find("#updateState");
|
this.statusDisplay = this.element.find("#updateState");
|
||||||
this.infoDisplay = this.element.find("#updateInfo");
|
this.infoDisplay = this.element.find("#updateInfo");
|
||||||
|
|
||||||
this.noRetainCheckbox.change(this.noRetainChanged);
|
this.retainCheckbox.change(this.retainChanged);
|
||||||
this.btnUpdate.click(this.update);
|
this.btnUpdate.click(this.update);
|
||||||
|
|
||||||
this.checkStatus(false);
|
this.checkStatus(false);
|
||||||
}
|
}
|
||||||
this.noRetainChanged = function(e) {
|
this.retainChanged = function(e) {
|
||||||
console.log("UpdatePanel:noRetainChanged");
|
console.log("UpdatePanel:retainChanged");
|
||||||
|
|
||||||
self.setState(self.state,true);
|
self.setState(self.state,true);
|
||||||
}
|
}
|
||||||
@ -82,10 +82,12 @@ function UpdatePanel() {
|
|||||||
this.installUpdate = function() {
|
this.installUpdate = function() {
|
||||||
console.log("UpdatePanel:installUpdate");
|
console.log("UpdatePanel:installUpdate");
|
||||||
|
|
||||||
var noRetain = self.noRetainCheckbox.prop('checked');
|
// should personal sketches and settings be retained over update?
|
||||||
|
var retain = self.retainCheckbox.prop('checked');
|
||||||
|
console.log(" retain: ",retain);
|
||||||
|
|
||||||
self.stopCheckingStatus();
|
self.stopCheckingStatus();
|
||||||
postData = {no_retain:noRetain}
|
postData = {no_retain:!retain}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: self.wifiboxURL + "/update/install",
|
url: self.wifiboxURL + "/update/install",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
@ -175,8 +177,9 @@ function UpdatePanel() {
|
|||||||
console.log("UpdatePanel:setState: ",this.state," > ",newState,"(",this.stateText,") (networkMode: ",self.networkMode,") (newestVersion: ",self.newestVersion,") (refresh: ",refresh,")");
|
console.log("UpdatePanel:setState: ",this.state," > ",newState,"(",this.stateText,") (networkMode: ",self.networkMode,") (newestVersion: ",self.newestVersion,") (refresh: ",refresh,")");
|
||||||
this.state = newState;
|
this.state = newState;
|
||||||
|
|
||||||
var noRetain = self.noRetainCheckbox.prop('checked');
|
// should personal sketches and settings be retained over update?
|
||||||
console.log(" noRetain", noRetain);
|
var retain = self.retainCheckbox.prop('checked');
|
||||||
|
console.log(" retain", retain);
|
||||||
|
|
||||||
// download button
|
// download button
|
||||||
// if there isn't newestVersion data something went wrong,
|
// if there isn't newestVersion data something went wrong,
|
||||||
@ -189,7 +192,7 @@ function UpdatePanel() {
|
|||||||
case UpdatePanel.DOWNLOAD_FAILED:
|
case UpdatePanel.DOWNLOAD_FAILED:
|
||||||
case UpdatePanel.INSTALL_FAILED:
|
case UpdatePanel.INSTALL_FAILED:
|
||||||
console.log(" self.canUpdate: ",self.canUpdate);
|
console.log(" self.canUpdate: ",self.canUpdate);
|
||||||
if(self.canUpdate || noRetain) {
|
if(self.canUpdate || !retain) {
|
||||||
self.btnUpdate.removeAttr("disabled");
|
self.btnUpdate.removeAttr("disabled");
|
||||||
} else {
|
} else {
|
||||||
self.btnUpdate.attr("disabled", true);
|
self.btnUpdate.attr("disabled", true);
|
||||||
|
@ -137,3 +137,7 @@ form dl dt {
|
|||||||
font-style: italic;
|
font-style: italic;
|
||||||
width: 10em;
|
width: 10em;
|
||||||
}
|
}
|
||||||
|
#updatePanel #retainConfigurationLabel {
|
||||||
|
display: inline;
|
||||||
|
float: none;
|
||||||
|
}
|
@ -162,7 +162,7 @@
|
|||||||
|
|
||||||
<fieldset id="updatePanel">
|
<fieldset id="updatePanel">
|
||||||
<legend>Update</legend>
|
<legend>Update</legend>
|
||||||
<label for="noRetain">Remove personal data:</label><input id="noRetain" type="checkbox" name="" value="noRetain">
|
<input id="retainConfiguration" type="checkbox" name="" value="retainConfiguration" checked="true"> <label for="retainConfiguration" id="retainConfigurationLabel">Preserve personal sketches and settings</label>
|
||||||
<br/><br/>
|
<br/><br/>
|
||||||
<input type="button" name="update" value="Update" class="button" id="update"/>
|
<input type="button" name="update" value="Update" class="button" id="update"/>
|
||||||
<span id="updateState"></span><br/>
|
<span id="updateState"></span><br/>
|
||||||
|
Loading…
Reference in New Issue
Block a user