@@ -16,12 +16,13 @@ const Inputs = (function () {
1616 notespacing : "savednotespacing" ,
1717 notestartcolor : "note_color_start" ,
1818 noteendcolor : "note_color_end" ,
19- foldername : "trackRef" ,
19+ trackRef : "trackRef" ,
20+ prefixTrackRef : "prefixTrackRef" ,
2021 songendpoint : "endpoint" ,
2122 } ;
2223
2324 /** Inputs that are not required to be filled in */
24- const optionalInputNames = new Set ( [ "foldername" , " songendpoint"] ) ;
25+ const optionalInputNames = new Set ( [ "songendpoint" ] ) ;
2526
2627 /** Inputs that need to be formatted as ints */
2728 const intInputNames = new Set ( [
@@ -39,6 +40,9 @@ const Inputs = (function () {
3940 /** Inputs that need to be formatted as colors */
4041 const colorInputNames = new Set ( [ "notestartcolor" , "noteendcolor" ] ) ;
4142
43+ /** Checkbox inputs fetch `checked` instead of `value` */
44+ const checkboxInputNames = new Set ( [ "prefixTrackRef" ] ) ;
45+
4246 /** Returns whether all required fields are filled in */
4347 function verifyInputs ( ) {
4448 for ( const [ inputName , input ] of Object . entries ( inputs ) ) {
@@ -59,6 +63,8 @@ const Inputs = (function () {
5963 result [ inputMap [ inputName ] ] = Number ( input . value ) ;
6064 } else if ( colorInputNames . has ( inputName ) ) {
6165 result [ inputMap [ inputName ] ] = Color . hexToFloats ( input . value ) ;
66+ } else if ( checkboxInputNames . has ( inputName ) ) {
67+ result [ inputMap [ inputName ] ] = input . checked ;
6268 } else {
6369 result [ inputMap [ inputName ] ] = input . value ;
6470 }
@@ -94,6 +100,9 @@ const Inputs = (function () {
94100 }
95101 input . dispatchEvent ( new Event ( "change" ) ) ;
96102 }
103+
104+ // Do not prefix if the trackRef was passed
105+ if ( obj . trackRef ) inputs . prefixTrackRef . checked = false ;
97106 }
98107
99108 /** Converts a string to an number, warning if it's actually a float */
0 commit comments