-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from CCEM/development
Development
- Loading branch information
Showing
7 changed files
with
134 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,4 +100,4 @@ ENV/ | |
# mypy | ||
.mypy_cache/ | ||
|
||
.DS_Store | ||
*.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<style> | ||
section.options div { | ||
margin: 5px 0; | ||
} | ||
</style> | ||
<title>My Test Extension Options</title> | ||
</head> | ||
<body> | ||
<section class="options"> | ||
Comment types to highlight: | ||
<div> | ||
<input type="checkbox" id="positive" name="positive" /> | ||
<label for="positive"><span></span>Positive</label> | ||
</div> | ||
|
||
<div> | ||
<input type="checkbox" id="neutral" name="neutral" /> | ||
<label for="neutral"><span></span>Neutral</label> | ||
</div> | ||
|
||
<div> | ||
<input type="checkbox" id="negative" name="negative" /> | ||
<label for="negative"><span></span>Negative</label> | ||
</div> | ||
|
||
<div> | ||
<input type="checkbox" id="all" name="all" checked /> | ||
<label for="all"><span></span>All</label> | ||
</div> | ||
<div id="status"></div> | ||
<button id="save">Save</button> | ||
</section> | ||
|
||
<script src="options.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Saves options to chrome.storage | ||
function save_options() { | ||
var positive = document.getElementById('positive').checked; | ||
var neutral = document.getElementById('neutral').checked; | ||
var negative = document.getElementById('negative').checked; | ||
var all = document.getElementById('all').checked; | ||
console.log(positive, neutral, negative, all); | ||
// var color = document.getElementById('color').value; | ||
// var likesColor = document.getElementById('like').checked; | ||
chrome.storage.sync.set({ | ||
showPositive: positive, | ||
showNeutral: neutral, | ||
showNegative: negative, | ||
showAll: all | ||
}, function() { | ||
// Update status to let user know options were saved. | ||
var status = document.getElementById('status'); | ||
status.textContent = 'Options saved.'; | ||
}); | ||
} | ||
|
||
// Restores select box and checkbox state using the preferences | ||
// stored in chrome.storage. | ||
function restore_options() { | ||
// Use default value of show all. | ||
chrome.storage.sync.get({ | ||
showPositive: false, | ||
showNeutral: false, | ||
showNegative: false, | ||
showAll: true | ||
}, function(items) { | ||
document.getElementById('positive').checked = items.showPositive; | ||
document.getElementById('neutral').checked = items.showNeutral; | ||
document.getElementById('negative').checked = items.showNegative; | ||
document.getElementById('all').checked = items.showAll; | ||
}); | ||
} | ||
document.addEventListener('DOMContentLoaded', restore_options); | ||
document.getElementById('save').addEventListener('click', | ||
save_options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,20 @@ | ||
/*styles*/ | ||
div.neg1 { | ||
border-style: solid !important; | ||
border-width: 2px !important; | ||
border-color: rgba(255, 0, 0, 0.5) !important; | ||
background-color: #ffeef0 !important; | ||
} | ||
|
||
div.neg2 { | ||
border-style: solid !important; | ||
border-width: 2px !important; | ||
border-color: rgba(255, 0, 0, 0.7) !important; | ||
background-color: #FFD5DA !important; | ||
} | ||
|
||
div.pos1 { | ||
border-style: solid !important; | ||
border-width: 2px !important; | ||
border-color: rgba(0, 245, 33, 0.5) !important; | ||
background-color: #e6ffed !important; | ||
} | ||
|
||
div.pos2 { | ||
border-style: solid !important; | ||
border-width: 2px !important; | ||
border-color: rgba(0, 245, 33, 0.7) !important; | ||
background-color: #BEFECC !important; | ||
} | ||
|
||
div.neu { | ||
border-style: solid !important; | ||
border-width: 2px !important; | ||
border-color: rgba(0, 78, 245, 0.7) !important; | ||
background-color: #F2F2F2 !important; | ||
} |