@@ -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,32 +384,34 @@ 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 ) ;
397
+ < << << << preview-bug
402
398
// Valid org: update storage and fetch data
403
399
chrome . storage . local . set ( { orgName : org , githubCache : null } , function ( ) {
404
400
const scrumReport = document . getElementById ( 'scrumReport' ) ;
405
401
if ( scrumReport ) {
406
402
scrumReport . innerHTML = '<p style="text-align: center; color: #666; padding: 20px;">Organisation changed. Click "Generate Report" to fetch new data.</p>' ;
407
403
}
404
+ = === ===
405
+ console . log ( '[Org Check] Organization exists on GitHub:' , org ) ;
406
+ chrome . storage . local . set ( { orgName : org } , function ( ) {
407
+ if ( window . generateScrumReport ) window . generateScrumReport ( ) ;
408
+ > >>> >>> master
408
409
} ) ;
409
410
} )
410
411
. catch ( ( err ) => {
411
412
console . log ( '[Org Check] Error validating organisation:' , org , err ) ;
412
- // Remove any existing toast with the same id
413
413
const oldToast = document . getElementById ( 'invalid-org-toast' ) ;
414
414
if ( oldToast ) oldToast . parentNode . removeChild ( oldToast ) ;
415
- // Create a new toast div
416
415
const toastDiv = document . createElement ( 'div' ) ;
417
416
toastDiv . id = 'invalid-org-toast' ;
418
417
toastDiv . className = 'toast' ;
@@ -426,12 +425,11 @@ document.addEventListener('DOMContentLoaded', function () {
426
425
toastDiv . style . left = '50%' ;
427
426
toastDiv . style . transform = 'translateX(-50%)' ;
428
427
toastDiv . style . zIndex = '9999' ;
429
- toastDiv . innerText = 'Error validating organisation .' ;
428
+ toastDiv . innerText = 'Error validating organization .' ;
430
429
document . body . appendChild ( toastDiv ) ;
431
430
setTimeout ( ( ) => {
432
431
if ( toastDiv . parentNode ) toastDiv . parentNode . removeChild ( toastDiv ) ;
433
432
} , 3000 ) ;
434
- // Do NOT update storage or fetch data for invalid org
435
433
} ) ;
436
434
} , 2500 ) ;
437
435
@@ -488,8 +486,8 @@ document.querySelectorAll('input[name="timeframe"]').forEach(radio => {
488
486
489
487
const startDateInput = document . getElementById ( 'startingDate' ) ;
490
488
const endDateInput = document . getElementById ( 'endingDate' ) ;
491
- startDateInput . disabled = false ;
492
- endDateInput . disabled = false ;
489
+ startDateInput . readOnly = false ;
490
+ endDateInput . readOnly = false ;
493
491
494
492
chrome . storage . local . set ( {
495
493
lastWeekContribution : false ,
@@ -561,7 +559,7 @@ function toggleRadio(radio) {
561
559
endDateInput . value = getToday ( ) ;
562
560
}
563
561
564
- startDateInput . disabled = endDateInput . disabled = true ;
562
+ startDateInput . readOnly = endDateInput . readOnly = true ;
565
563
566
564
chrome . storage . local . set ( {
567
565
startingDate : startDateInput . value ,
@@ -579,7 +577,7 @@ function toggleRadio(radio) {
579
577
} ) ;
580
578
}
581
579
582
- const cacheInput = document . getElementById ( 'cacheInput' ) ;
580
+ let cacheInput = document . getElementById ( 'cacheInput' ) ;
583
581
if ( cacheInput ) {
584
582
chrome . storage . local . get ( [ 'cacheInput' ] , function ( result ) {
585
583
if ( result . cacheInput ) {
0 commit comments