updated readme

This commit is contained in:
Sriram Hariharan
2018-07-18 20:18:41 -05:00
parent 33edd6388a
commit 6f91831e29
2 changed files with 16 additions and 11 deletions

View File

@@ -1,11 +1,9 @@
chrome.storage.sync.get('courseConflictHighlight', function(data) {
if(data.courseConflictHighlight){
$("#toggleConflictHighlighting").text("Turn Off");
$("#toggleConflictHighlighting").css("background","#F44336");
off();
}
else {
$("#toggleConflictHighlighting").text("Turn On");
$("#toggleConflictHighlighting").css("background","#4CAF50");
on();
}
});
@@ -13,13 +11,11 @@ $("#toggleConflictHighlighting").click(function(){
var action = $("#toggleConflictHighlighting").text();
if(action == "Turn Off"){
chrome.storage.sync.set({courseConflictHighlight: false}, function() {
$("#toggleConflictHighlighting").text("Turn On");
$("#toggleConflictHighlighting").css("background","#4CAF50");
on();
});
} else{
chrome.storage.sync.set({courseConflictHighlight: true}, function() {
$("#toggleConflictHighlighting").text("Turn Off");
$("#toggleConflictHighlighting").css("background","#F44336");
off();
});
}
chrome.tabs.query({}, function(tabs) {
@@ -27,4 +23,14 @@ $("#toggleConflictHighlighting").click(function(){
chrome.tabs.sendMessage(tabs[i].id, {command: "updateCourseList"});
}
});
});
});
function on(){
$("#toggleConflictHighlighting").text("Turn On");
$("#toggleConflictHighlighting").css("background","#4CAF50");
}
function off(){
$("#toggleConflictHighlighting").text("Turn Off");
$("#toggleConflictHighlighting").css("background","#F44336");
}