set cookie path and date

This commit is contained in:
Manuel Friedli 2013-11-27 17:45:28 +01:00
parent 2fa23c2f07
commit 714e86a53c

8
uhr.js
View file

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