@@ -4,10 +4,11 @@ var startingDateElement = document.getElementById("startingDate");
4
4
var endingDateElement = document . getElementById ( "endingDate" ) ;
5
5
var showOpenLabelElement = document . getElementById ( "showOpenLabel" ) ;
6
6
var showClosedLabelElement = document . getElementById ( "showClosedLabel" ) ;
7
+ var userReasonElement = document . getElementById ( "userReason" ) ;
7
8
8
9
function handleBodyOnLoad ( ) {
9
10
// 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 ) {
11
12
if ( items . githubUsername ) {
12
13
githubUsernameElement . value = items . githubUsername ;
13
14
}
@@ -26,6 +27,9 @@ function handleBodyOnLoad(){
26
27
if ( items . showClosedLabel ) {
27
28
showClosedLabelElement . checked = items . showClosedLabel ;
28
29
}
30
+ if ( items . userReason ) {
31
+ userReasonElement . value = items . userReason ;
32
+ }
29
33
} ) ;
30
34
}
31
35
function handleEnableChange ( ) {
@@ -52,6 +56,10 @@ function handleClosedLabelChange(){
52
56
var value = showClosedLabelElement . checked ;
53
57
chrome . storage . local . set ( { "showClosedLabel" : value } ) ;
54
58
}
59
+ function handleUserReasonChange ( ) {
60
+ var value = userReasonElement . value ;
61
+ chrome . storage . local . set ( { "userReason" : value } ) ;
62
+ }
55
63
function handleRefresh ( ) {
56
64
window . close ( ) ;
57
65
chrome . tabs . executeScript ( {
@@ -64,5 +72,6 @@ startingDateElement.addEventListener("keyup", handleStartingDateChange);
64
72
endingDateElement . addEventListener ( "keyup" , handleEndingDateChange ) ;
65
73
showOpenLabelElement . addEventListener ( "change" , handleOpenLabelChange ) ;
66
74
showClosedLabelElement . addEventListener ( "change" , handleClosedLabelChange ) ;
75
+ userReasonElement . addEventListener ( "keyup" , handleUserReasonChange ) ;
67
76
document . getElementById ( "refresh" ) . addEventListener ( "click" , handleRefresh ) ;
68
77
document . addEventListener ( "DOMContentLoaded" , handleBodyOnLoad ) ;
0 commit comments