@@ -227,17 +227,6 @@ TABS.firmware_flasher.initialize = function (callback) {
227227 }
228228 } ;
229229
230- function showOrHideBuildTypeSelect ( ) {
231- var showDevReleases = $ ( this ) . is ( ':checked' ) ;
232-
233- if ( showDevReleases ) {
234- $ ( 'tr.build_type' ) . show ( ) ;
235- } else {
236- $ ( 'tr.build_type' ) . hide ( ) ;
237- buildType_e . val ( 0 ) . trigger ( 'change' ) ;
238- }
239- }
240-
241230 var buildTypes = [
242231 {
243232 tag : 'firmwareFlasherOptionLabelBuildTypeRelease' ,
@@ -255,16 +244,48 @@ TABS.firmware_flasher.initialize = function (callback) {
255244 loader : ( ) => self . jenkinsLoader . loadBuilds ( job . name , buildJenkinsBoardOptions )
256245 } ;
257246 } )
258-
259- buildTypes = buildTypes . concat ( ciBuildsTypes ) ;
247+ var buildTypesToShow ;
260248
261249 var buildType_e = $ ( 'select[name="build_type"]' ) ;
262- buildTypes . forEach ( ( build , index ) => {
263- buildType_e . append ( $ ( "<option value='{0}' selected>{1}</option>" . format ( index , build . tag ? i18n . getMessage ( build . tag ) : build . title ) ) )
264- } ) ;
250+ function buildBuildTypeOptionsList ( ) {
251+ buildType_e . empty ( ) ;
252+ buildTypesToShow . forEach ( ( build , index ) => {
253+ buildType_e . append ( $ ( "<option value='{0}' selected>{1}</option>" . format ( index , build . tag ? i18n . getMessage ( build . tag ) : build . title ) ) )
254+ } ) ;
255+ }
256+
257+ function showOrHideBuildTypes ( ) {
258+ var showExtraReleases = $ ( this ) . is ( ':checked' ) ;
259+
260+ if ( showExtraReleases ) {
261+ $ ( 'tr.build_type' ) . show ( ) ;
262+ $ ( 'tr.expert_mode' ) . show ( ) ;
263+ } else {
264+ $ ( 'tr.build_type' ) . hide ( ) ;
265+ $ ( 'tr.expert_mode' ) . hide ( ) ;
266+ buildType_e . val ( 0 ) . trigger ( 'change' ) ;
267+ }
268+ }
269+
270+ var globalExpertMode_e = $ ( 'input[name="expertModeCheckbox"]' ) ;
271+ function showOrHideBuildTypeSelect ( ) {
272+ var expertModeChecked = $ ( this ) . is ( ':checked' ) ;
273+
274+ globalExpertMode_e . prop ( 'checked' , expertModeChecked ) ;
275+ if ( expertModeChecked ) {
276+ buildTypesToShow = buildTypes . concat ( ciBuildsTypes ) ;
277+ buildBuildTypeOptionsList ( ) ;
278+ } else {
279+ buildTypesToShow = buildTypes ;
280+ buildBuildTypeOptionsList ( ) ;
281+ buildType_e . val ( 0 ) . trigger ( 'change' ) ;
282+ }
283+ }
265284
266- showOrHideBuildTypeSelect ( ) ;
267- $ ( 'input.show_development_releases' ) . change ( showOrHideBuildTypeSelect ) ;
285+ var expertMode_e = $ ( '.tab-firmware_flasher input.expert_mode' ) ;
286+ expertMode_e . prop ( 'checked' , globalExpertMode_e . is ( ':checked' ) ) ;
287+ $ ( 'input.show_development_releases' ) . change ( showOrHideBuildTypes ) . change ( ) ;
288+ expertMode_e . change ( showOrHideBuildTypeSelect ) . change ( ) ;
268289
269290 // translate to user-selected language
270291 i18n . localizePage ( ) ;
@@ -282,7 +303,7 @@ TABS.firmware_flasher.initialize = function (callback) {
282303 . append ( $ ( "<option value='0'>{0}</option>" . format ( i18n . getMessage ( 'firmwareFlasherOptionLabelSelectFirmwareVersion' ) ) ) ) ;
283304
284305 if ( ! GUI . connect_lock ) {
285- buildTypes [ build_type ] . loader ( ) ;
306+ buildTypesToShow [ build_type ] . loader ( ) ;
286307 }
287308
288309 chrome . storage . local . set ( { 'selected_build_type' : build_type } ) ;
0 commit comments