set cookie path and date

This commit is contained in:
Manuel Friedli 2013-11-27 17:45:28 +01:00
parent 2fa23c2f07
commit 714e86a53c
1 changed files with 4 additions and 4 deletions

8
uhr.js
View File

@ -50,7 +50,7 @@ Uhr.prototype.start = function() {
var uhr = this;
this.timer = window.setInterval(function() {uhr.update();}, 1000);
this.update();
$.cookie('status', 'on');
$.cookie('status', 'on', {expires: 365, path: '/'});
}
}
Uhr.prototype.stop = function() {
@ -58,7 +58,7 @@ Uhr.prototype.stop = function() {
window.clearInterval(this.timer);
this.timer = null;
this.update();
$.cookie('status', 'off');
$.cookie('status', 'off', {expires: 365, path: '/'});
}
}
Uhr.prototype.isOn = function() {
@ -70,14 +70,14 @@ Uhr.prototype.setLayout = function(locale) {
this.currentLayout = newLayout;
var renderer = new UhrRenderer(this.currentLayout, this.letterarea);
renderer.render(this);
$.cookie('layout', locale);
$.cookie('layout', locale, {expires: 365, path: '/'});
}
}
Uhr.prototype.setTheme = function(theme) {
if (theme != this.currentTheme) {
this.currentTheme = theme;
this.themeElement.attr('href', 'uhr-' + theme + '.css');
$.cookie('theme', theme);
$.cookie('theme', theme, {expires: 365, path: '/'});
}
}
Uhr.prototype.update = function() {