dobarkod/cookie-banner — pull request #5 by zytzagoo (2014-01-15 15:21:52+00:00)
Title: Refactor + tests + cookie expiration feature/option

Started working on #3 and figured, wth, might as well give it the full treatment :)

The major motivator is that now we can create an instance using `var banner = new Cookiebanner(opts);` and call `banner.run()`, `banner.insert()`, `banner.close()`, `banner.agree()`, `banner.agreed()` etc. (method names not set in stone) in the exact moment we'd like to (as opposed to just having a bunch of stuff magically happen without any control over it).

The "old" mode of operation is still supported and is functioning just as it did earlier -- see/run `tests.js`

The few initial tests I wrote all pass, but I probably missed something somewhere...

This hopefully makes any potential further changes easier to implement (and easier to guard against breakage).

While we're on the subject of further changes, the option names are really ripe for a rewrite IMO (could now be easily done in this branch while maintaining full backwards compatibility -- just needs a small options re-writer).

It'd be awesome to get more eyes on this before moving further.