Skip to content

Commit e8dc8d3

Browse files
author
hkedia321
committed
make custom reason
1 parent 0581e17 commit e8dc8d3

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

src/popup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ <h6 class="center">
5151
<label for="showClosedLabel">Show Closed Label</label>
5252
</div>
5353
<div class="input-field col s12">
54-
<input placeholder="Reason" id="UserReason" type="text">
54+
<input placeholder="Reason" id="userReason" type="text">
5555
<label for="UserReason">What is stopping you from doing your work?</label>
5656
</div>
5757
<div class="col center s12">

src/scripts/main.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ var startingDateElement = document.getElementById("startingDate");
44
var endingDateElement = document.getElementById("endingDate");
55
var showOpenLabelElement = document.getElementById("showOpenLabel");
66
var showClosedLabelElement = document.getElementById("showClosedLabel");
7+
var userReasonElement = document.getElementById("userReason");
78

89
function handleBodyOnLoad(){
910
// prefill name
10-
chrome.storage.local.get(["githubUsername","enableToggle","startingDate","endingDate","showOpenLabel","showClosedLabel"],function(items){
11+
chrome.storage.local.get(["githubUsername","enableToggle","startingDate","endingDate","showOpenLabel","showClosedLabel","userReason"],function(items){
1112
if(items.githubUsername){
1213
githubUsernameElement.value=items.githubUsername;
1314
}
@@ -26,6 +27,9 @@ function handleBodyOnLoad(){
2627
if(items.showClosedLabel){
2728
showClosedLabelElement.checked= items.showClosedLabel;
2829
}
30+
if(items.userReason){
31+
userReasonElement.value = items.userReason;
32+
}
2933
});
3034
}
3135
function handleEnableChange(){
@@ -52,6 +56,10 @@ function handleClosedLabelChange(){
5256
var value = showClosedLabelElement.checked;
5357
chrome.storage.local.set({"showClosedLabel": value});
5458
}
59+
function handleUserReasonChange(){
60+
var value = userReasonElement.value;
61+
chrome.storage.local.set({"userReason": value});
62+
}
5563
function handleRefresh(){
5664
window.close();
5765
chrome.tabs.executeScript({
@@ -64,5 +72,6 @@ startingDateElement.addEventListener("keyup", handleStartingDateChange);
6472
endingDateElement.addEventListener("keyup", handleEndingDateChange);
6573
showOpenLabelElement.addEventListener("change", handleOpenLabelChange);
6674
showClosedLabelElement.addEventListener("change", handleClosedLabelChange);
75+
userReasonElement.addEventListener("keyup", handleUserReasonChange);
6776
document.getElementById("refresh").addEventListener("click",handleRefresh);
6877
document.addEventListener("DOMContentLoaded", handleBodyOnLoad);

src/scripts/scrumHelper.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var issue_opened_button="<div style=\"vertical-align:middle;display: inline-bloc
2424

2525
var linkStyle="";
2626

27-
chrome.storage.local.get(["githubUsername","enableToggle","startingDate","endingDate","showOpenLabel","showClosedLabel","UserReason"],function(items){
27+
chrome.storage.local.get(["githubUsername","enableToggle","startingDate","endingDate","showOpenLabel","showClosedLabel","userReason"],function(items){
2828
if(!items.enableToggle){
2929
enableToggle=items.enableToggle;
3030
}
@@ -48,10 +48,10 @@ chrome.storage.local.get(["githubUsername","enableToggle","startingDate","ending
4848
pr_merged_button="";
4949
issue_closed_button="";
5050
}
51-
if(items.UserReason){
52-
userReason=items.UserReason;
51+
if(items.userReason){
52+
userReason=items.userReason;
5353
}
54-
if(!items.UserReason){
54+
if(!items.userReason){
5555
userReason="No Blocker at the moment";
5656
}
5757
});

0 commit comments

Comments
 (0)