Force the user to pick a fimrware before loading
parent
a7dc838cdc
commit
7a800444b5
|
@ -828,6 +828,9 @@
|
|||
"firmwareFlasherFlashSlowlyDescription": {
|
||||
"message": "Use 115200 baudrate for flashing (useful for flashing via bluetooth)"
|
||||
},
|
||||
"firmwareFlasherOptionLabelSelectFirmware": {
|
||||
"message": "Choose a Firmware / Board"
|
||||
},
|
||||
"firmwareFlasherButtonLoadLocal": {
|
||||
"message": "Load Firmware [Local]"
|
||||
},
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
margin-left: 6px;
|
||||
}
|
||||
.tab-firmware_flasher .options select {
|
||||
width: 180px;
|
||||
width: 280px;
|
||||
height: 20px;
|
||||
|
||||
border: 1px solid silver;
|
||||
|
@ -82,7 +82,7 @@
|
|||
}
|
||||
.tab-firmware_flasher .options .description {
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
left: 300px;
|
||||
|
||||
font-style: italic;
|
||||
color: #818181;
|
||||
|
@ -194,6 +194,13 @@
|
|||
cursor: default;
|
||||
background-color: #b8b8b8;
|
||||
}
|
||||
.tab-firmware_flasher .buttons a.load_remote_file.locked {
|
||||
background-color: #b8b8b8;
|
||||
}
|
||||
.tab-firmware_flasher .buttons a.load_remote_file.locked:hover {
|
||||
cursor: default;
|
||||
background-color: #b8b8b8;
|
||||
}
|
||||
.tab-firmware_flasher .buttons a.back {
|
||||
float: right;
|
||||
margin: 0;
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
</div>
|
||||
<div class="buttons">
|
||||
<a class="load_file" href="#" i18n="firmwareFlasherButtonLoadLocal"></a>
|
||||
<a class="load_remote_file" href="#" i18n="firmwareFlasherButtonLoadOnline"></a>
|
||||
<a class="load_remote_file locked" href="#" i18n="firmwareFlasherButtonLoadOnline"></a>
|
||||
<a class="flash_firmware locked" href="#" i18n="firmwareFlasherFlashFirmware"></a>
|
||||
<a class="back" href="#" i18n="firmwareFlasherButtonLeave"></a>
|
||||
</div>
|
||||
|
|
|
@ -32,6 +32,8 @@ TABS.firmware_flasher.initialize = function (callback) {
|
|||
var processReleases = function (releases){
|
||||
var releases_e = $('select[name="release"]').empty();
|
||||
|
||||
releases_e.append($("<option value='0'>{0}</option>".format(chrome.i18n.getMessage('firmwareFlasherOptionLabelSelectFirmware'))));
|
||||
|
||||
for(var releaseIndex = 0; releaseIndex < releases.length; releaseIndex++){
|
||||
$.get(releases[releaseIndex].assets_url).done(
|
||||
(function (releases, releaseIndex, releases_e, assets){
|
||||
|
@ -206,8 +208,26 @@ TABS.firmware_flasher.initialize = function (callback) {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
/**
|
||||
* Lock / Unlock the firmware download button according to the firmware selection dropdown.
|
||||
*/
|
||||
$('select[name="release"]').change(function(evt){
|
||||
if (evt.target.value=="0") {
|
||||
$("a.load_remote_file").addClass('locked');
|
||||
}
|
||||
else {
|
||||
$("a.load_remote_file").removeClass('locked');
|
||||
}
|
||||
});
|
||||
|
||||
$('a.load_remote_file').click(function () {
|
||||
$('a.load_remote_file').click(function (evt) {
|
||||
|
||||
if ($('select[name="release"]').val() == "0") {
|
||||
GUI.log("<b>No firmware selected to load</b>");
|
||||
return;
|
||||
}
|
||||
|
||||
function process_hex(data, summary) {
|
||||
intel_hex = data;
|
||||
|
||||
|
|
Loading…
Reference in New Issue