diff --git a/_locales/en/messages.json b/_locales/en/messages.json old mode 100644 new mode 100755 index 0f640d5a..2c14c9cb --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -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]" }, diff --git a/tabs/firmware_flasher.css b/tabs/firmware_flasher.css old mode 100644 new mode 100755 index 72d243f5..cc938883 --- a/tabs/firmware_flasher.css +++ b/tabs/firmware_flasher.css @@ -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; diff --git a/tabs/firmware_flasher.html b/tabs/firmware_flasher.html old mode 100644 new mode 100755 index 120453d7..23c3cd8f --- a/tabs/firmware_flasher.html +++ b/tabs/firmware_flasher.html @@ -69,7 +69,7 @@
- +
diff --git a/tabs/firmware_flasher.js b/tabs/firmware_flasher.js old mode 100644 new mode 100755 index 984ef09a..07bef240 --- a/tabs/firmware_flasher.js +++ b/tabs/firmware_flasher.js @@ -32,6 +32,8 @@ TABS.firmware_flasher.initialize = function (callback) { var processReleases = function (releases){ var releases_e = $('select[name="release"]').empty(); + releases_e.append($("".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("No firmware selected to load"); + return; + } + function process_hex(data, summary) { intel_hex = data;