Skip to content

Commit 2036aee

Browse files
author
Harshit Kedia
committed
merge open/close label
1 parent 275e748 commit 2036aee

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

src/popup.html

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,7 @@ <h6 class="center">
6363
<div class="col s12">
6464
<br />
6565
<input type="checkbox" class="filled-in" id="showOpenLabel"/>
66-
<label for="showOpenLabel">Show Open Label</label>
67-
</div>
68-
<div class="col s12">
69-
<input type="checkbox" class="filled-in" id="showClosedLabel"/>
70-
<label for="showClosedLabel">Show Closed Label</label>
66+
<label for="showOpenLabel">Show Open/Closed Label</label>
7167
</div>
7268
<div class="input-field col s12">
7369
<input placeholder="Reason" id="userReason" type="text">

src/scripts/main.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ var lastWeekContributionElement=document.getElementById("lastWeekContribution");
55
var startingDateElement = document.getElementById("startingDate");
66
var endingDateElement = document.getElementById("endingDate");
77
var showOpenLabelElement = document.getElementById("showOpenLabel");
8-
var showClosedLabelElement = document.getElementById("showClosedLabel");
98
var userReasonElement = document.getElementById("userReason");
109
var gsoc = 0;//0 means gsoc. 1 means gsoc
1110
function handleBodyOnLoad(){
@@ -34,13 +33,6 @@ function handleBodyOnLoad(){
3433
showOpenLabelElement.checked=true;
3534
handleOpenLabelChange();
3635
}
37-
if(items.showClosedLabel){
38-
showClosedLabelElement.checked= items.showClosedLabel;
39-
}
40-
else if(items.showClosedLabel!==false){
41-
showClosedLabelElement.checked=true;
42-
handleClosedLabelChange();
43-
}
4436
if(items.userReason){
4537
userReasonElement.value = items.userReason;
4638
}
@@ -116,6 +108,7 @@ function handleGithubUsernameChange(){
116108
function handleOpenLabelChange(){
117109
var value = showOpenLabelElement.checked;
118110
chrome.storage.local.set({"showOpenLabel": value});
111+
chrome.storage.local.set({"showClosedLabel": value});
119112
}
120113
function handleClosedLabelChange(){
121114
var value = showClosedLabelElement.checked;
@@ -147,12 +140,7 @@ startingDateElement.addEventListener("keyup", handleStartingDateChange);
147140
endingDateElement.addEventListener("keyup", handleEndingDateChange);
148141
lastWeekContributionElement.addEventListener("change", handleLastWeekContributionChange);
149142
showOpenLabelElement.addEventListener("change", handleOpenLabelChange);
150-
showClosedLabelElement.addEventListener("change", handleClosedLabelChange);
151143
userReasonElement.addEventListener("keyup", handleUserReasonChange);
152144
document.addEventListener("DOMContentLoaded", handleBodyOnLoad);
153145
document.getElementById("codeheatTab").addEventListener("click",handleCodeheatClick);
154146
document.getElementById("gsocTab").addEventListener("click",handleGsocClick);
155-
chrome.runtime.onMessage.addListener(
156-
function(request, sender, sendResponse) {
157-
chrome.notifications.create("Updated SCRUM!");
158-
});

src/scripts/scrumHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var refreshButton_Placed=false;
2+
var enableToggle=true;
23
function allIncluded(){
34
/* global $*/
45
var scrumBody = null;
@@ -14,7 +15,6 @@ function allIncluded(){
1415
var githubUserData=null;
1516
var githubPrsReviewDataProccessed = {};
1617
var showOpenLabel=true;
17-
var enableToggle=true;
1818
var showClosedLabel=true;
1919
var userReason="";
2020
var gsoc = 0;//0 means codeheat. 1 means gsoc
@@ -345,7 +345,7 @@ var intervalWriteGithubReviews = setInterval(function(){
345345
},500);
346346
if(!refreshButton_Placed){
347347
var intervalWriteButton = setInterval(function(){
348-
if(document.getElementsByClassName("F0XO1GC-x-b").length==3 && scrumBody){
348+
if(document.getElementsByClassName("F0XO1GC-x-b").length==3 && scrumBody && enableToggle){
349349
refreshButton_Placed=true;
350350
clearInterval(intervalWriteButton);
351351
var td=document.createElement("td");

0 commit comments

Comments
 (0)