@@ -256,8 +256,8 @@ document.addEventListener('DOMContentLoaded', function () {
256
256
257
257
const startDateInput = document . getElementById ( 'startingDate' ) ;
258
258
const endDateInput = document . getElementById ( 'endingDate' ) ;
259
- startDateInput . disabled = false ;
260
- endDateInput . disabled = false ;
259
+ startDateInput . readOnly = false ;
260
+ endDateInput . readOnly = false ;
261
261
262
262
chrome . storage . local . set ( {
263
263
lastWeekContribution : false ,
@@ -294,9 +294,8 @@ document.addEventListener('DOMContentLoaded', function () {
294
294
startDateInput . value = getYesterday ( ) ;
295
295
endDateInput . value = getToday ( ) ;
296
296
}
297
-
298
- startDateInput . disabled = endDateInput . disabled = true ;
299
-
297
+ startDateInput . readOnly = endDateInput . readOnly = true ;
298
+
300
299
chrome . storage . local . set ( {
301
300
startingDate : startDateInput . value ,
302
301
endingDate : endDateInput . value ,
@@ -369,11 +368,9 @@ document.addEventListener('DOMContentLoaded', function () {
369
368
. then ( res => {
370
369
console . log ( '[Org Check] Response status for' , org , ':' , res . status ) ;
371
370
if ( res . status === 404 ) {
372
- console . log ( '[Org Check] Organisation not found on GitHub:' , org ) ;
373
- // Remove any existing toast with the same id
371
+ console . log ( '[Org Check] Organization not found on GitHub:' , org ) ;
374
372
const oldToast = document . getElementById ( 'invalid-org-toast' ) ;
375
373
if ( oldToast ) oldToast . parentNode . removeChild ( oldToast ) ;
376
- // Create a new toast div
377
374
const toastDiv = document . createElement ( 'div' ) ;
378
375
toastDiv . id = 'invalid-org-toast' ;
379
376
toastDiv . className = 'toast' ;
@@ -387,29 +384,25 @@ document.addEventListener('DOMContentLoaded', function () {
387
384
toastDiv . style . left = '50%' ;
388
385
toastDiv . style . transform = 'translateX(-50%)' ;
389
386
toastDiv . style . zIndex = '9999' ;
390
- toastDiv . innerText = 'Organisation not found on GitHub.' ;
387
+ toastDiv . innerText = 'Organization not found on GitHub.' ;
391
388
document . body . appendChild ( toastDiv ) ;
392
389
setTimeout ( ( ) => {
393
390
if ( toastDiv . parentNode ) toastDiv . parentNode . removeChild ( toastDiv ) ;
394
391
} , 3000 ) ;
395
- // Do NOT update storage or fetch data for invalid org
396
392
return ;
397
393
}
398
- // Remove any existing toast with the same id (for valid orgs)
399
394
const oldToast = document . getElementById ( 'invalid-org-toast' ) ;
400
395
if ( oldToast ) oldToast . parentNode . removeChild ( oldToast ) ;
401
396
console . log ( '[Org Check] Organisation exists on GitHub:' , org ) ;
402
- // Valid org: update storage and fetch data
397
+ console . log ( '[Org Check] Organization exists on GitHub:' , org ) ;
403
398
chrome . storage . local . set ( { orgName : org } , function ( ) {
404
399
if ( window . generateScrumReport ) window . generateScrumReport ( ) ;
405
400
} ) ;
406
401
} )
407
402
. catch ( ( err ) => {
408
403
console . log ( '[Org Check] Error validating organisation:' , org , err ) ;
409
- // Remove any existing toast with the same id
410
404
const oldToast = document . getElementById ( 'invalid-org-toast' ) ;
411
405
if ( oldToast ) oldToast . parentNode . removeChild ( oldToast ) ;
412
- // Create a new toast div
413
406
const toastDiv = document . createElement ( 'div' ) ;
414
407
toastDiv . id = 'invalid-org-toast' ;
415
408
toastDiv . className = 'toast' ;
@@ -423,12 +416,11 @@ document.addEventListener('DOMContentLoaded', function () {
423
416
toastDiv . style . left = '50%' ;
424
417
toastDiv . style . transform = 'translateX(-50%)' ;
425
418
toastDiv . style . zIndex = '9999' ;
426
- toastDiv . innerText = 'Error validating organisation .' ;
419
+ toastDiv . innerText = 'Error validating organization .' ;
427
420
document . body . appendChild ( toastDiv ) ;
428
421
setTimeout ( ( ) => {
429
422
if ( toastDiv . parentNode ) toastDiv . parentNode . removeChild ( toastDiv ) ;
430
423
} , 3000 ) ;
431
- // Do NOT update storage or fetch data for invalid org
432
424
} ) ;
433
425
} , 3000 ) ;
434
426
@@ -485,8 +477,8 @@ document.querySelectorAll('input[name="timeframe"]').forEach(radio => {
485
477
486
478
const startDateInput = document . getElementById ( 'startingDate' ) ;
487
479
const endDateInput = document . getElementById ( 'endingDate' ) ;
488
- startDateInput . disabled = false ;
489
- endDateInput . disabled = false ;
480
+ startDateInput . readOnly = false ;
481
+ endDateInput . readOnly = false ;
490
482
491
483
chrome . storage . local . set ( {
492
484
lastWeekContribution : false ,
@@ -558,7 +550,7 @@ function toggleRadio(radio) {
558
550
endDateInput . value = getToday ( ) ;
559
551
}
560
552
561
- startDateInput . disabled = endDateInput . disabled = true ;
553
+ startDateInput . readOnly = endDateInput . readOnly = true ;
562
554
563
555
chrome . storage . local . set ( {
564
556
startingDate : startDateInput . value ,
@@ -576,7 +568,7 @@ function toggleRadio(radio) {
576
568
} ) ;
577
569
}
578
570
579
- const cacheInput = document . getElementById ( 'cacheInput' ) ;
571
+ let cacheInput = document . getElementById ( 'cacheInput' ) ;
580
572
if ( cacheInput ) {
581
573
chrome . storage . local . get ( [ 'cacheInput' ] , function ( result ) {
582
574
if ( result . cacheInput ) {
0 commit comments