@@ -86,7 +86,7 @@ socket.addEventListener('message', (event) => {
86
86
resetButton . textContent = translateElements . timer . buttons . reset
87
87
88
88
if ( elementVariables && typeof elementVariables === 'object' ) {
89
- checkTextTime = MsToText ( elementVariables . textmilliseconds )
89
+ checkTextTime = MsToText ( elementVariables . textMilliseconds )
90
90
checkHexColor = elementVariables . colorText
91
91
92
92
// Format selector options
@@ -101,10 +101,10 @@ socket.addEventListener('message', (event) => {
101
101
// Perform necessary actions with the variables here
102
102
textMsg . textContent = elementVariables . msgEnd
103
103
if ( elementVariables . msgEnd === '' ) {
104
- textMsg . textContent = translateElements . timer . ph_msgend
104
+ textMsg . textContent = translateElements . timer . phMsgEnd
105
105
textMsg . style . color = '#555'
106
106
} else { textMsg . style . color = '#000' }
107
- timeText . value = MsToText ( elementVariables . textmilliseconds )
107
+ timeText . value = MsToText ( elementVariables . textMilliseconds )
108
108
formatSelector . value = elementVariables . formatTime
109
109
fontSelect . value = elementVariables . font
110
110
fontSize . value = elementVariables . size
@@ -122,10 +122,10 @@ socket.addEventListener('message', (event) => {
122
122
if ( message [ classElement ] . status !== 'started' ) {
123
123
textMsg . textContent = message [ classElement ] . msgEnd
124
124
if ( message [ classElement ] . msgEnd === '' ) {
125
- textMsg . textContent = translateElements . timer . ph_msgend
125
+ textMsg . textContent = translateElements . timer . phMsgEnd
126
126
textMsg . style . color = '#555'
127
127
} else { textMsg . style . color = '#000' }
128
- timeText . value = MsToText ( message [ classElement ] . textmilliseconds )
128
+ timeText . value = MsToText ( message [ classElement ] . textMilliseconds )
129
129
formatSelector . value = message [ classElement ] . formatTime
130
130
fontSelect . value = message [ classElement ] . font
131
131
fontSize . value = message [ classElement ] . size
@@ -172,7 +172,7 @@ timeText.addEventListener('change', () => {
172
172
const textTime = timeText . value . trim ( )
173
173
174
174
// Regular expression to check the correct time format
175
- const timeRegex = / ^ ( [ 0 - 9 ] + ) : ( [ 0 - 5 ] ? [ 0 - 9 ] ) : ( [ 0 - 5 ] ? [ 0 - 9 ] ) $ /
175
+ const timeRegex = / ^ ( \d + ) : ( [ 0 - 5 ] ? \d ) : ( [ 0 - 5 ] ? \d ) $ /
176
176
177
177
if ( timeRegex . test ( textTime ) ) {
178
178
checkTextTime = textTime
@@ -218,7 +218,7 @@ subContainer.addEventListener('click', (event) => {
218
218
} )
219
219
220
220
textMsg . addEventListener ( 'focus' , ( ) => {
221
- if ( textMsg . textContent === translateElements . timer . ph_msgend ) {
221
+ if ( textMsg . textContent === translateElements . timer . phMsgEnd ) {
222
222
textMsg . textContent = ''
223
223
textMsg . style . color = '#000'
224
224
}
@@ -227,17 +227,17 @@ textMsg.addEventListener('focus', () => {
227
227
textMsg . addEventListener ( 'blur' , ( ) => {
228
228
socket . send ( JSON . stringify ( { action : 'editMsgCdown' , msg : textMsg . textContent , classElement } ) )
229
229
if ( textMsg . textContent === '' ) {
230
- textMsg . textContent = translateElements . timer . ph_msgend
230
+ textMsg . textContent = translateElements . timer . phMsgEnd
231
231
textMsg . style . color = '#555'
232
232
} else { textMsg . style . color = '#000' }
233
233
} )
234
234
235
235
formatSelector . addEventListener ( 'change' , ( ) => {
236
- socket . send ( JSON . stringify ( { action : 'changeFormatCdown ' , format : formatSelector . value , classElement } ) )
236
+ socket . send ( JSON . stringify ( { action : 'changeFormat ' , format : formatSelector . value , classElement } ) )
237
237
} )
238
238
239
239
fontSelect . addEventListener ( 'change' , ( ) => {
240
- socket . send ( JSON . stringify ( { action : 'changeFontCdown ' , font : fontSelect . value , classElement } ) )
240
+ socket . send ( JSON . stringify ( { action : 'changeFont ' , font : fontSelect . value , classElement } ) )
241
241
} )
242
242
243
243
fontSize . addEventListener ( 'change' , ( ) => {
@@ -255,37 +255,37 @@ fontSize.addEventListener('change', () => {
255
255
}
256
256
257
257
// Send the new size to the server
258
- socket . send ( JSON . stringify ( { action : 'changeSizeCdown ' , size : newSize , classElement } ) )
258
+ socket . send ( JSON . stringify ( { action : 'changeSize ' , size : newSize , classElement } ) )
259
259
} )
260
260
261
261
boldButton . addEventListener ( 'click' , ( ) => {
262
- socket . send ( JSON . stringify ( { action : 'textFormatCdown ' , format : 'bold' , classElement } ) )
262
+ socket . send ( JSON . stringify ( { action : 'textFormat ' , format : 'bold' , classElement } ) )
263
263
} )
264
264
265
265
italicButton . addEventListener ( 'click' , ( ) => {
266
- socket . send ( JSON . stringify ( { action : 'textFormatCdown ' , format : 'italic' , classElement } ) )
266
+ socket . send ( JSON . stringify ( { action : 'textFormat ' , format : 'italic' , classElement } ) )
267
267
} )
268
268
269
269
underlineButton . addEventListener ( 'click' , ( ) => {
270
- socket . send ( JSON . stringify ( { action : 'textFormatCdown ' , format : 'underline' , classElement } ) )
270
+ socket . send ( JSON . stringify ( { action : 'textFormat ' , format : 'underline' , classElement } ) )
271
271
} )
272
272
273
273
alignLeftButton . addEventListener ( 'click' , ( ) => {
274
- socket . send ( JSON . stringify ( { action : 'alignCdown ' , align : 'left' , classElement } ) )
274
+ socket . send ( JSON . stringify ( { action : 'align ' , align : 'left' , classElement } ) )
275
275
} )
276
276
277
277
alignCenterButton . addEventListener ( 'click' , ( ) => {
278
- socket . send ( JSON . stringify ( { action : 'alignCdown ' , align : 'center' , classElement } ) )
278
+ socket . send ( JSON . stringify ( { action : 'align ' , align : 'center' , classElement } ) )
279
279
} )
280
280
281
281
alignRightButton . addEventListener ( 'click' , ( ) => {
282
- socket . send ( JSON . stringify ( { action : 'alignCdown ' , align : 'right' , classElement } ) )
282
+ socket . send ( JSON . stringify ( { action : 'align ' , align : 'right' , classElement } ) )
283
283
} )
284
284
285
285
colorPicker . addEventListener ( 'change' , ( ) => {
286
286
checkHexColor = colorPicker . value . toUpperCase ( )
287
287
// If the hexadecimal code is valid, send the color to the server
288
- socket . send ( JSON . stringify ( { action : 'changeColorCdown ' , color : colorPicker . value . toUpperCase ( ) , classElement } ) )
288
+ socket . send ( JSON . stringify ( { action : 'changeColor ' , color : colorPicker . value . toUpperCase ( ) , classElement } ) )
289
289
colorHex . value = checkHexColor
290
290
} )
291
291
@@ -298,7 +298,7 @@ colorHex.addEventListener('change', () => {
298
298
if ( hexRegex . test ( hexColor ) ) {
299
299
checkHexColor = hexColor . toUpperCase ( )
300
300
// If the hexadecimal code is valid, send the color to the server
301
- socket . send ( JSON . stringify ( { action : 'changeColorCdown ' , color : checkHexColor , classElement } ) )
301
+ socket . send ( JSON . stringify ( { action : 'changeColor ' , color : checkHexColor , classElement } ) )
302
302
colorPicker . value = checkHexColor
303
303
colorHex . value = checkHexColor
304
304
} else {
0 commit comments