Skip to content

Commit

Permalink
cleaned up code to match format of the rest of file
Browse files Browse the repository at this point in the history
  • Loading branch information
adjohu committed Jul 28, 2015
1 parent 56dec60 commit 3a1248b
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions cookieconsent.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,13 @@
return null;
},

setCookie: function (name, value, expirydays, path) {
setCookie: function (name, value, expiryDays, path) {
expiryDays = expiryDays || 365;
path = path || '/';

var exdate = new Date();
expirydays = (typeof expirydays === 'undefined') ? 365 : expirydays;
path = (typeof path === 'undefined') ? '/' : path;
exdate.setDate(exdate.getDate() + expirydays);
exdate.setDate(exdate.getDate() + expiryDays);

document.cookie = name + '=' + value + '; expires=' + exdate.toUTCString() + '; path=' + path;
},

Expand Down Expand Up @@ -220,8 +222,8 @@
link: null,
container: null, // selector
theme: 'light-floating',
cookiePath: '/',
cookieExpiryDays: 365,
path: '/',
expiryDays: 365,
markup: [
'<div class="cc_banner-wrapper {{containerClasses}}">',
'<div class="cc_banner cc_container cc_container--open">',
Expand Down Expand Up @@ -318,7 +320,7 @@
},

setDismissedCookie: function () {
Util.setCookie(DISMISSED_COOKIE, 'yes', this.options.cookieExpiryDays, this.options.cookiePath);
Util.setCookie(DISMISSED_COOKIE, 'yes', this.options.expiryDays, this.options.path);
}
};

Expand Down

0 comments on commit 3a1248b

Please sign in to comment.