Skip to content

Commit 1080353

Browse files
authored
Merge branch 'master' into loadBug
2 parents e37a73a + 181be30 commit 1080353

File tree

4 files changed

+36
-38
lines changed

4 files changed

+36
-38
lines changed

src/popup.html

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,11 @@ <h4>Your Github Username</h4>
7474
<p class="text-sm">Fetch your contributions between:</p>
7575
<div class="flex justify-between items-center my-2 mx-4">
7676
<div class="flex items-center gap-2">
77-
<input type="radio" id="lastWeekContribution" name="timeframe" class="form-radio"
78-
onclick="toggleRadio(this)">
77+
<input type="radio" id="lastWeekContribution" name="timeframe" class="form-radio">
7978
<label for="lastWeekContribution">Last 7 days</label>
8079
</div>
8180
<div class="flex items-center gap-2">
82-
<input type="radio" id="yesterdayContribution" name="timeframe" class="form-radio"
83-
onclick="toggleRadio(this)">
81+
<input type="radio" id="yesterdayContribution" name="timeframe" class="form-radio">
8482
<label for="yesterdayContribution">Last 1 day</label>
8583
</div>
8684
</div>
@@ -132,19 +130,19 @@ <h6 class="text-base font-semibold">Scrum Report</h6>
132130
<div id="settingsSection" class="tab-content hidden">
133131
<div class="">
134132
<div class="flex items-center mt-4">
135-
<h4>Organisation Name</h4>
133+
<h4>Organization Name</h4>
136134
<span class="tooltip-container ml-2">
137135
<i class="fa fa-question-circle question-icon"></i>
138136
<span class="tooltip-bubble">
139-
<b>Which organisation's GitHub activity?</b><br>
140-
Enter the GitHub organisation name to fetch activites for. Default is <b>fossasia</b>.
141-
Organisation name is not case-sensitive.
137+
<b>Which organization's GitHub activity?</b><br>
138+
Enter the GitHub organization name to fetch activites for. Default is <b>fossasia</b>.
139+
Organization name is not case-sensitive.
142140
</span>
143141
</span>
144142
</div>
145143
<input id="orgInput" type="text"
146144
class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 my-2"
147-
placeholder="Enter organisation name (default: fossasia)">
145+
placeholder="Enter organization name (default: fossasia)">
148146
</div>
149147
<div class="">
150148
<div class="flex items-center justify-between">

src/scripts/main.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -123,19 +123,19 @@ function handleLastWeekContributionChange() {
123123
let value = lastWeekContributionElement.checked;
124124
let labelElement = document.querySelector("label[for='lastWeekContribution']");
125125
if (value) {
126-
startingDateElement.disabled = true;
127-
endingDateElement.disabled = true;
128-
endingDateElement.value = getToday();
129-
startingDateElement.value = getLastWeek();
130-
handleEndingDateChange();
131-
handleStartingDateChange();
132-
labelElement.classList.add("selectedLabel");
133-
labelElement.classList.remove("unselectedLabel");
126+
startingDateElement.readOnly = true;
127+
endingDateElement.readOnly = true;
128+
endingDateElement.value = getToday();
129+
startingDateElement.value = getLastWeek();
130+
handleEndingDateChange();
131+
handleStartingDateChange();
132+
labelElement.classList.add("selectedLabel");
133+
labelElement.classList.remove("unselectedLabel");
134134
} else {
135-
startingDateElement.disabled = false;
136-
endingDateElement.disabled = false;
137-
labelElement.classList.add("unselectedLabel");
138-
labelElement.classList.remove("selectedLabel");
135+
startingDateElement.readOnly = false;
136+
endingDateElement.readOnly = false;
137+
labelElement.classList.add("unselectedLabel");
138+
labelElement.classList.remove("selectedLabel");
139139
}
140140

141141
chrome.storage.local.set({ lastWeekContribution: value });
@@ -146,17 +146,17 @@ function handleYesterdayContributionChange() {
146146
let labelElement = document.querySelector("label[for='yesterdayContribution']");
147147

148148
if (value) {
149-
startingDateElement.disabled = true;
150-
endingDateElement.disabled = true;
149+
startingDateElement.readOnly = true;
150+
endingDateElement.readOnly = true;
151151
endingDateElement.value = getToday();
152152
startingDateElement.value = getYesterday();
153153
handleEndingDateChange();
154154
handleStartingDateChange();
155155
labelElement.classList.add("selectedLabel");
156156
labelElement.classList.remove("unselectedLabel");
157157
} else {
158-
startingDateElement.disabled = false;
159-
endingDateElement.disabled = false;
158+
startingDateElement.readOnly = false;
159+
endingDateElement.readOnly = false;
160160
labelElement.classList.add("unselectedLabel");
161161
labelElement.classList.remove("selectedLabel");
162162
}

src/scripts/popup.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ document.addEventListener('DOMContentLoaded', function () {
256256

257257
const startDateInput = document.getElementById('startingDate');
258258
const endDateInput = document.getElementById('endingDate');
259-
startDateInput.disabled = false;
260-
endDateInput.disabled = false;
259+
startDateInput.readOnly = false;
260+
endDateInput.readOnly = false;
261261

262262
chrome.storage.local.set({
263263
lastWeekContribution: false,
@@ -294,9 +294,8 @@ document.addEventListener('DOMContentLoaded', function () {
294294
startDateInput.value = getYesterday();
295295
endDateInput.value = getToday();
296296
}
297-
298-
startDateInput.disabled = endDateInput.disabled = true;
299-
297+
startDateInput.readOnly = endDateInput.readOnly = true;
298+
300299
chrome.storage.local.set({
301300
startingDate: startDateInput.value,
302301
endingDate: endDateInput.value,
@@ -369,7 +368,7 @@ document.addEventListener('DOMContentLoaded', function () {
369368
.then(res => {
370369
console.log('[Org Check] Response status for', org, ':', res.status);
371370
if (res.status === 404) {
372-
console.log('[Org Check] Organisation not found on GitHub:', org);
371+
console.log('[Org Check] Organization not found on GitHub:', org);
373372
const oldToast = document.getElementById('invalid-org-toast');
374373
if (oldToast) oldToast.parentNode.removeChild(oldToast);
375374
const toastDiv = document.createElement('div');
@@ -385,7 +384,7 @@ document.addEventListener('DOMContentLoaded', function () {
385384
toastDiv.style.left = '50%';
386385
toastDiv.style.transform = 'translateX(-50%)';
387386
toastDiv.style.zIndex = '9999';
388-
toastDiv.innerText = 'Organisation not found on GitHub.';
387+
toastDiv.innerText = 'Organization not found on GitHub.';
389388
document.body.appendChild(toastDiv);
390389
setTimeout(() => {
391390
if (toastDiv.parentNode) toastDiv.parentNode.removeChild(toastDiv);
@@ -395,6 +394,7 @@ document.addEventListener('DOMContentLoaded', function () {
395394
const oldToast = document.getElementById('invalid-org-toast');
396395
if (oldToast) oldToast.parentNode.removeChild(oldToast);
397396
console.log('[Org Check] Organisation exists on GitHub:', org);
397+
console.log('[Org Check] Organization exists on GitHub:', org);
398398
chrome.storage.local.set({ orgName: org }, function () {
399399
if (window.generateScrumReport) window.generateScrumReport();
400400
});
@@ -416,7 +416,7 @@ document.addEventListener('DOMContentLoaded', function () {
416416
toastDiv.style.left = '50%';
417417
toastDiv.style.transform = 'translateX(-50%)';
418418
toastDiv.style.zIndex = '9999';
419-
toastDiv.innerText = 'Error validating organisation.';
419+
toastDiv.innerText = 'Error validating organization.';
420420
document.body.appendChild(toastDiv);
421421
setTimeout(() => {
422422
if (toastDiv.parentNode) toastDiv.parentNode.removeChild(toastDiv);
@@ -477,8 +477,8 @@ document.querySelectorAll('input[name="timeframe"]').forEach(radio => {
477477

478478
const startDateInput = document.getElementById('startingDate');
479479
const endDateInput = document.getElementById('endingDate');
480-
startDateInput.disabled = false;
481-
endDateInput.disabled = false;
480+
startDateInput.readOnly = false;
481+
endDateInput.readOnly = false;
482482

483483
chrome.storage.local.set({
484484
lastWeekContribution: false,
@@ -550,7 +550,7 @@ function toggleRadio(radio) {
550550
endDateInput.value = getToday();
551551
}
552552

553-
startDateInput.disabled = endDateInput.disabled = true;
553+
startDateInput.readOnly = endDateInput.readOnly = true;
554554

555555
chrome.storage.local.set({
556556
startingDate: startDateInput.value,

src/scripts/scrumHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,9 @@ function allIncluded(outputTarget = 'email') {
393393

394394
if (issuesRes.status === 404 || prRes.status === 404) {
395395
if (outputTarget === 'popup') {
396-
Materialize.toast && Materialize.toast('Organisation not found on GitHub', 3000);
396+
Materialize.toast && Materialize.toast('Organization not found on GitHub', 3000);
397397
}
398-
throw new Error('Organisation not found');
398+
throw new Error('Organization not found');
399399
}
400400

401401
if (!issuesRes.ok) throw new Error(`Error fetching Github issues: ${issuesRes.status} ${issuesRes.statusText}`);

0 commit comments

Comments
 (0)