@@ -6,7 +6,6 @@ const led_strip = {
66 directions : [ 'n' , 'e' , 's' , 'w' , 'u' , 'd' ] ,
77 } ;
88
9-
109led_strip . initialize = function ( callback , scrollPosition ) {
1110 let selectedColorIndex = null ;
1211 let selectedModeColor = null ;
@@ -34,7 +33,6 @@ led_strip.initialize = function (callback, scrollPosition) {
3433 MSP . send_message ( MSPCodes . MSP_LED_STRIP_MODECOLOR , false , false , load_html ) ;
3534 }
3635
37-
3836 function load_html ( ) {
3937 $ ( '#content' ) . load ( "./tabs/led_strip.html" , process_html ) ;
4038 }
@@ -186,7 +184,6 @@ led_strip.initialize = function (callback, scrollPosition) {
186184 } ) ;
187185
188186 updateBulkCmd ( ) ;
189-
190187 } ) ;
191188
192189 // Color sliders
@@ -217,7 +214,6 @@ led_strip.initialize = function (callback, scrollPosition) {
217214 }
218215 }
219216
220-
221217 setColorSliders ( selectedColorIndex ) ;
222218
223219 $ ( this ) . addClass ( 'btnOn' ) ;
@@ -396,6 +392,9 @@ led_strip.initialize = function (callback, scrollPosition) {
396392 } ,
397393 } ) ;
398394
395+ // Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
396+ $ ( '#ledStripFunctionSelect' ) . sortSelect ( i18n . getMessage ( "ledStripFunctionNoneOption" ) ) ;
397+
399398 // UI: select LED function from drop-down
400399 $ ( '.functionSelect' ) . on ( 'change' , function ( ) {
401400 clearModeColorSelection ( ) ;
@@ -405,6 +404,9 @@ led_strip.initialize = function (callback, scrollPosition) {
405404 updateBulkCmd ( ) ;
406405 } ) ;
407406
407+ // Sort the element, if need to group, do it by lexical sort, ie. by naming of (the translated) selection text
408+ $ ( '#ledStripModeColorsModeSelect' ) . sortSelect ( i18n . getMessage ( "ledStripModeColorsModeOrientation" ) ) ;
409+
408410 // UI: select mode from drop-down
409411 $ ( '.modeSelect' ) . on ( 'change' , function ( ) {
410412
@@ -425,8 +427,7 @@ led_strip.initialize = function (callback, scrollPosition) {
425427 $ ( '.mode_colors' ) . each ( function ( ) { setModeBackgroundColor ( $ ( this ) ) ; } ) ;
426428 } ) ;
427429
428- function toggleSwitch ( that , letter )
429- {
430+ function toggleSwitch ( that , letter ) {
430431 if ( $ ( that ) . is ( ':checked' ) ) {
431432 $ ( '.ui-selected' ) . find ( '.wire' ) . each ( function ( ) {
432433 if ( $ ( this ) . text ( ) != "" ) {
@@ -528,8 +529,6 @@ led_strip.initialize = function (callback, scrollPosition) {
528529 }
529530 } ) ;
530531
531-
532-
533532 $ ( '.mainGrid' ) . disableSelection ( ) ;
534533
535534 $ ( '.gPoint' ) . each ( function ( ) {
@@ -563,7 +562,6 @@ led_strip.initialize = function (callback, scrollPosition) {
563562 }
564563
565564 $ ( this ) . addClass ( `color-${ led . color } ` ) ;
566-
567565 } ) ;
568566
569567 $ ( 'a.save' ) . on ( 'click' , function ( ) {
@@ -582,7 +580,6 @@ led_strip.initialize = function (callback, scrollPosition) {
582580 GUI . log ( i18n . getMessage ( 'ledStripEepromSaved' ) ) ;
583581 } ) ;
584582 }
585-
586583 } ) ;
587584
588585 colorDefineSliders . hide ( ) ;
@@ -601,12 +598,6 @@ led_strip.initialize = function (callback, scrollPosition) {
601598 GUI . content_ready ( callback ) ;
602599 }
603600
604-
605-
606-
607-
608-
609-
610601 function findLed ( x , y ) {
611602 for ( let ledIndex = 0 ; ledIndex < FC . LED_STRIP . length ; ledIndex ++ ) {
612603 const led = FC . LED_STRIP [ ledIndex ] ;
@@ -617,7 +608,6 @@ led_strip.initialize = function (callback, scrollPosition) {
617608 return undefined ;
618609 }
619610
620-
621611 function updateBulkCmd ( ) {
622612 const ledStripLength = FC . LED_STRIP . length ;
623613
@@ -943,7 +933,6 @@ led_strip.initialize = function (callback, scrollPosition) {
943933 }
944934 }
945935
946-
947936 // refresh color buttons
948937 $ ( '.colors' ) . children ( ) . each ( function ( ) { setBackgroundColor ( $ ( this ) ) ; } ) ;
949938 $ ( '.overlay-color' ) . each ( function ( ) { setBackgroundColor ( $ ( this ) ) ; } ) ;
@@ -1005,7 +994,6 @@ led_strip.initialize = function (callback, scrollPosition) {
1005994 // only fire events when all values are set
1006995 if ( change )
1007996 sliders . trigger ( 'input' ) ;
1008-
1009997 }
1010998
1011999 function HsvToColor ( input ) {
0 commit comments