2017-08-06 18:19:53 +00:00
|
|
|
function init()
|
2017-08-06 16:34:23 +00:00
|
|
|
{
|
2017-08-06 18:19:53 +00:00
|
|
|
setStatus();
|
2017-08-06 16:34:23 +00:00
|
|
|
}
|
|
|
|
|
2017-08-06 18:19:53 +00:00
|
|
|
function setStatus()
|
|
|
|
{
|
|
|
|
browser.storage.local.get('globalStatus', function(data){
|
|
|
|
//Hier neue ID des Mülleimers
|
2017-08-06 16:34:23 +00:00
|
|
|
var element = $("#globalStatus");
|
2017-08-06 18:19:53 +00:00
|
|
|
data = data.globalStatus;
|
|
|
|
if(data == null){
|
|
|
|
browser.storage.local.set({"globalStatus": true});
|
|
|
|
}
|
|
|
|
if(data){
|
|
|
|
//Hier neue Enable Classe des Mülleimers
|
|
|
|
element.removeClass().addClass("status statusEnabled");
|
|
|
|
}else{
|
|
|
|
//Hier neue Disable Classe des Mülleimers
|
|
|
|
element.removeClass().addClass("status statusDisabled");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2017-08-06 16:34:23 +00:00
|
|
|
|
2017-08-06 18:19:53 +00:00
|
|
|
function changeStatus(){
|
|
|
|
browser.storage.local.get('globalStatus', function(data){
|
|
|
|
//Hier neue ID des Mülleimers
|
|
|
|
var element = $("#globalStatus");
|
|
|
|
data = data.globalStatus;
|
2017-08-06 16:34:23 +00:00
|
|
|
|
2017-08-06 18:19:53 +00:00
|
|
|
if(data){
|
|
|
|
browser.storage.local.set({"globalStatus": false});
|
|
|
|
//Hier neue Disable Classe des Mülleimers
|
2017-08-06 16:34:23 +00:00
|
|
|
element.removeClass().addClass("status statusDisabled");
|
|
|
|
}else{
|
2017-08-06 18:19:53 +00:00
|
|
|
browser.storage.local.set({"globalStatus": true});
|
|
|
|
//Hier neue Enable Classe des Mülleimers
|
2017-08-06 16:34:23 +00:00
|
|
|
element.removeClass().addClass("status statusEnabled");
|
2017-08-06 18:19:53 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
2017-08-06 16:34:23 +00:00
|
|
|
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
2017-08-06 18:19:53 +00:00
|
|
|
init();
|
|
|
|
//Hier neue ID des Mülleimers
|
2017-08-06 16:34:23 +00:00
|
|
|
$("#globalStatus").on("click", changeStatus);
|
2017-08-05 21:22:38 +00:00
|
|
|
});
|