dobarkod / cookie-banner

JavaScript based cookie-info banner for complying with EU cookie law
MIT License
425 stars 85 forks source link

acceptOnTimeout, cookieSecure, acceptOnFirstVisit, and more #39

Closed webaddicto closed 7 years ago

webaddicto commented 7 years ago

1) Added option to agree and close the banner after N milliseconds: this.options.acceptOnTimeout 2) Added option cookieSecure: this.options.cookieSecure 3) Added option to agree the cookie on first time the user visit a page (but do not close the cookiebanner window): this.options.acceptOnFirstVisit 4) Added option to set moreinfo decoration: this.options.moreinfoDecoration 5) Added option to set moreinfo font weight: this.options.moreinfoFontWeight

senko commented 7 years ago

Hey @webaddicto thanks for the PR. Regarding the %LEARNMORE% alias feature, I’d rather not include it because it’s already possible by customizing message (add the link in the directly) and linkmsg (empty).

I’d like to merge the other commits, but before that could you check indentation / line length? In a couple of places looks like (at least in the github ui) the indentation is not aligned with the nearby code, possibly as a result of mixing tab + spaces. Ideally we’d be using spaces everywhere for indentation.

webaddicto commented 7 years ago

@senko have aligned the text and removed %LEARNMORE% references.

I made a small update on the last commit 22c8124, basically have added the check to see if linkmsg is empty:

'<span>' + this.options.message + (this.options.linkmsg ? ' <a>' + this.options.linkmsg + '</a>' : '') + '</span>';

What do you think?

webaddicto commented 7 years ago

Ops, didn't noticed that, should be fine now.

zytzagoo commented 7 years ago

lgtm