-
Notifications
You must be signed in to change notification settings - Fork 82
Revert "To show Commits in Scrum Report " #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
var enableToggleElement = document.getElementById('enable'); | ||
var githubUsernameElement = document.getElementById('githubUsername'); | ||
var projectNameElement = document.getElementById('projectName'); | ||
|
@@ -8,7 +7,6 @@ var startingDateElement = document.getElementById('startingDate'); | |
var endingDateElement = document.getElementById('endingDate'); | ||
var showOpenLabelElement = document.getElementById('showOpenLabel'); | ||
var userReasonElement = document.getElementById('userReason'); | ||
|
||
function handleBodyOnLoad() { | ||
chrome.storage.local.get( | ||
[ | ||
|
@@ -72,49 +70,22 @@ function handleBodyOnLoad() { | |
}, | ||
); | ||
} | ||
|
||
document.getElementById('refreshCache').addEventListener('click', async (e) => { | ||
const button = e.currentTarget; | ||
button.classList.add('loading'); | ||
button.disabled = true; | ||
|
||
try { | ||
const tabs = await chrome.tabs.query({active: true, currentWindow: true}); | ||
await chrome.tabs.sendMessage(tabs[0].id, { | ||
action: 'forceRefresh', | ||
timestamp: Date.now() | ||
}); | ||
|
||
// Reload the active tab to re-inject content | ||
chrome.tabs.reload(tabs[0].id); | ||
|
||
M.toast({html: 'Data refreshed successfully!', classes: 'green'}); | ||
} catch (err) { | ||
console.error('Refresh failed:', err); | ||
M.toast({html: 'Failed to refresh data', classes: 'red'}); | ||
} finally { | ||
setTimeout(() => { | ||
button.classList.remove('loading'); | ||
button.disabled = false; | ||
}, 500); | ||
} | ||
}); | ||
|
||
function handleEnableChange() { | ||
let value = enableToggleElement.checked; | ||
var value = enableToggleElement.checked; | ||
chrome.storage.local.set({ enableToggle: value }); | ||
} | ||
function handleStartingDateChange() { | ||
let value = startingDateElement.value; | ||
var value = startingDateElement.value; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
chrome.storage.local.set({ startingDate: value }); | ||
} | ||
function handleEndingDateChange() { | ||
let value = endingDateElement.value; | ||
var value = endingDateElement.value; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
chrome.storage.local.set({ endingDate: value }); | ||
} | ||
function handleLastWeekContributionChange() { | ||
let value = lastWeekContributionElement.checked; | ||
let labelElement = document.querySelector("label[for='lastWeekContribution']"); | ||
var value = lastWeekContributionElement.checked; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
var labelElement = document.querySelector("label[for='lastWeekContribution']"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
|
||
if (value) { | ||
startingDateElement.disabled = true; | ||
endingDateElement.disabled = true; | ||
|
@@ -157,14 +128,12 @@ function handleYesterdayContributionChange() { | |
} | ||
|
||
function getLastWeek() { | ||
|
||
var today = new Date(); | ||
var lastWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - 1); | ||
var lastWeekMonth = lastWeek.getMonth() + 1; | ||
var lastWeekDay = lastWeek.getDate(); | ||
var lastWeekYear = lastWeek.getFullYear(); | ||
var lastWeekDisplayPadded = | ||
|
||
('0000' + lastWeekYear.toString()).slice(-4) + | ||
'-' + | ||
('00' + lastWeekMonth.toString()).slice(-2) + | ||
|
@@ -187,12 +156,12 @@ function getYesterday() { | |
return yesterdayPadded; | ||
} | ||
function getToday() { | ||
let today = new Date(); | ||
let Week = new Date(today.getFullYear(), today.getMonth(), today.getDate()); | ||
let WeekMonth = Week.getMonth() + 1; | ||
let WeekDay = Week.getDate(); | ||
let WeekYear = Week.getFullYear(); | ||
let WeekDisplayPadded = | ||
var today = new Date(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
var Week = new Date(today.getFullYear(), today.getMonth(), today.getDate()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
var WeekMonth = Week.getMonth() + 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
var WeekDay = Week.getDate(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
var WeekYear = Week.getFullYear(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
var WeekDisplayPadded = | ||
('0000' + WeekYear.toString()).slice(-4) + | ||
'-' + | ||
('00' + WeekMonth.toString()).slice(-2) + | ||
|
@@ -202,16 +171,16 @@ function getToday() { | |
} | ||
|
||
function handleGithubUsernameChange() { | ||
let value = githubUsernameElement.value; | ||
var value = githubUsernameElement.value; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
chrome.storage.local.set({ githubUsername: value }); | ||
} | ||
function handleProjectNameChange() { | ||
let value = projectNameElement.value; | ||
var value = projectNameElement.value; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
chrome.storage.local.set({ projectName: value }); | ||
} | ||
function handleOpenLabelChange() { | ||
let value = showOpenLabelElement.checked; | ||
let labelElement = document.querySelector("label[for='showOpenLabel']"); | ||
var value = showOpenLabelElement.checked; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
var labelElement = document.querySelector("label[for='showOpenLabel']"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
|
||
if (value) { | ||
labelElement.classList.add("selectedLabel"); | ||
|
@@ -225,7 +194,7 @@ function handleOpenLabelChange() { | |
} | ||
|
||
function handleUserReasonChange() { | ||
let value = userReasonElement.value; | ||
var value = userReasonElement.value; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (code-quality): Use Explanation`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide |
||
chrome.storage.local.set({ userReason: value }); | ||
} | ||
enableToggleElement.addEventListener('change', handleEnableChange); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue (code-quality): Use
const
orlet
instead ofvar
. (avoid-using-var
)Explanation
`const` is preferred as it ensures you cannot reassign references (which can lead to buggy and confusing code). `let` may be used if you need to reassign references - it's preferred to `var` because it is block- rather than function-scoped.From the Airbnb JavaScript Style Guide