@@ -87,10 +87,10 @@ socket.addEventListener('message', (event) => {
87
87
? message . config . lang
88
88
: 'en'
89
89
90
- controlButton . textContent = translateElements . timer . buttons . start
91
- resetButton . textContent = translateElements . timer . buttons . reset
92
- checkboxLabelStopAdd . textContent = translateElements . timer . enableStopAdd
93
- checkboxLabelPauseAdd . textContent = translateElements . timer . enablePauseAdd
90
+ controlButton . textContent = translateElements . timer . buttons . start || 'n/a'
91
+ resetButton . textContent = translateElements . timer . buttons . reset || 'n/a'
92
+ checkboxLabelStopAdd . textContent = translateElements . timer . enableStopAdd || 'n/a'
93
+ checkboxLabelPauseAdd . textContent = translateElements . timer . enablePauseAdd || 'n/a'
94
94
95
95
if ( elementVariables && typeof elementVariables === 'object' ) {
96
96
checkTextTime = MsToText ( elementVariables . textMilliseconds )
@@ -116,7 +116,7 @@ socket.addEventListener('message', (event) => {
116
116
// Perform necessary actions with the variables here
117
117
textMsg . textContent = elementVariables . msgEnd
118
118
if ( elementVariables . msgEnd === '' ) {
119
- textMsg . textContent = translateElements . timer . phMsgEnd
119
+ textMsg . textContent = translateElements . timer . phMsgEnd || 'n/a'
120
120
textMsg . style . color = '#555'
121
121
} else { textMsg . style . color = '#000' }
122
122
timeText . value = MsToText ( elementVariables . textMilliseconds )
@@ -140,7 +140,7 @@ socket.addEventListener('message', (event) => {
140
140
if ( message [ classElement ] . status !== 'started' ) {
141
141
textMsg . textContent = message [ classElement ] . msgEnd
142
142
if ( message [ classElement ] . msgEnd === '' ) {
143
- textMsg . textContent = translateElements . timer . phMsgEnd
143
+ textMsg . textContent = translateElements . timer . phMsgEnd || 'n/a'
144
144
textMsg . style . color = '#555'
145
145
} else { textMsg . style . color = '#000' }
146
146
timeText . value = MsToText ( message [ classElement ] . textMilliseconds )
@@ -179,7 +179,7 @@ selectorLang.addEventListener('change', () => {
179
179
} )
180
180
181
181
controlButton . addEventListener ( 'click' , ( ) => {
182
- if ( controlButton . textContent === translateElements . timer . buttons . start ) {
182
+ if ( controlButton . textContent === translateElements . timer . buttons . start || 'n/a' ) {
183
183
socket . send ( JSON . stringify ( { action : 'startTimer' , classElement } ) )
184
184
} else {
185
185
socket . send ( JSON . stringify ( { action : 'pauseExtensible' , classElement } ) )
@@ -248,7 +248,7 @@ checkboxPauseAdd.addEventListener('change', () => {
248
248
} )
249
249
250
250
textMsg . addEventListener ( 'focus' , ( ) => {
251
- if ( textMsg . textContent === translateElements . timer . phMsgEnd ) {
251
+ if ( textMsg . textContent === translateElements . timer . phMsgEnd || 'n/a' ) {
252
252
textMsg . textContent = ''
253
253
textMsg . style . color = '#000'
254
254
}
@@ -257,7 +257,7 @@ textMsg.addEventListener('focus', () => {
257
257
textMsg . addEventListener ( 'blur' , ( ) => {
258
258
socket . send ( JSON . stringify ( { action : 'editMsg' , msg : textMsg . textContent , classElement } ) )
259
259
if ( textMsg . textContent === '' ) {
260
- textMsg . textContent = translateElements . timer . phMsgEnd
260
+ textMsg . textContent = translateElements . timer . phMsgEnd || 'n/a'
261
261
textMsg . style . color = '#555'
262
262
} else { textMsg . style . color = '#000' }
263
263
} )
@@ -362,17 +362,17 @@ function updateControlButton (status) {
362
362
controlButton . style . width = maxWidth
363
363
364
364
if ( status === 'started' ) {
365
- controlButton . textContent = translateElements . timer . buttons . pause
365
+ controlButton . textContent = translateElements . timer . buttons . pause || 'n/a'
366
366
} else {
367
- controlButton . textContent = translateElements . timer . buttons . start
367
+ controlButton . textContent = translateElements . timer . buttons . start || 'n/a'
368
368
}
369
369
}
370
370
371
371
function getMaxButtonWidth ( ) {
372
372
const widths = [ ]
373
373
374
374
Object . keys ( translateElements . timer . buttons ) . forEach ( ( value ) => {
375
- controlButton . textContent = translateElements . timer . buttons [ value ]
375
+ controlButton . textContent = translateElements . timer . buttons [ value ] || 'n/a'
376
376
widths . push ( parseFloat ( window . getComputedStyle ( controlButton ) . getPropertyValue ( 'width' ) ) )
377
377
} )
378
378
// Get the maximum of the two widths
0 commit comments