clear-urls-browser-extension/popup.js

47 lines
1.2 KiB
JavaScript
Raw Normal View History

2017-08-06 16:34:02 +00:00
var status = "enabled";
var exception = "false";
function changeStatus() {
var text = $("#statusText");
var button = $("#statusBtn");
if(status == "enabled") {
console.log("was enabled");
text.html("Dis");
button.removeClass("statusEnabled").addClass("statusDisabled");
status = "disabled";
console.log("is disabled");
2017-08-05 21:22:38 +00:00
}
2017-08-06 16:34:02 +00:00
else {
console.log("was disabled");
text.html("En");
button.removeClass("statusDisabled").addClass("statusEnabled");
status = "enabled";
console.log("is enabled");
}
};
/*
function handleException() {
2017-08-05 21:22:38 +00:00
var element = $("#exception");
var val = "Enable on page";
2017-08-06 16:34:02 +00:00
if(exception == false) {
val = "Disable on page";
exception = "true";
element.removeClass().addClass("disable");
}
else {
exception = "false";
element.removeClass().addClass("enable");
2017-08-05 21:22:38 +00:00
}
element.html(val);
2017-08-06 16:34:02 +00:00
};
*/
/*
$(document).ready(function() {
$("#statusBtn").on("click", changeStatus);
//$("#exception").on("click", handleException);
});
*/
document.addEventListener("DOMContentLoaded", function() {
$("#statusBtn").on("click", changeStatus);
2017-08-05 21:22:38 +00:00
});