cookies eingebaut

This commit is contained in:
Manuel Friedli 2013-11-25 14:38:25 +01:00
parent f229a7968d
commit e95affcb60
2 changed files with 31 additions and 1 deletions

View file

@ -50,7 +50,33 @@
$('#layoutswitcher').on('change', function() {
switchLayout(this.value);
});
switchLayout('de_CH');
$.cookie.defaults.expires = 365;
$.cookie.defaults.path = '/';
var theme = $.cookie('theme');
var layout = $.cookie('layout');
var status = $.cookie('status');
if (theme == undefined) {
theme = 'black';
}
if(layout == undefined) {
layout = 'de_CH';
}
if (status == undefined) {
status = 'on';
}
$('#themeswitcher').val(theme);
switchTheme(theme);
$('#layoutswitcher').val(layout);
switchLayout(layout);
if (status == 'on') {
if(!isOn()) {
$('#onoffswitch').click();
}
} else {
if(isOn()) {
$('#onoffswitch').click();
}
}
});
</script>
</body>