Skip to content

Commit

Permalink
Build new version
Browse files Browse the repository at this point in the history
  • Loading branch information
icetee committed May 23, 2016
1 parent 4b75538 commit 076db36
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion dist/cookiebar.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* cookiebar - It is a pure JS code, that warns the visitors in the notification bar, the page saves cookies. This is Compliant with the new EU cookie law.
* Date 2016-05-23T09:52:35Z
* Date 2016-05-23T21:30:06Z
*
* @author Tamás András Horváth <[email protected]> (http://icetee.hu)
* @version v0.9.3
Expand Down
31 changes: 17 additions & 14 deletions dist/cookiebar.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* cookiebar - It is a pure JS code, that warns the visitors in the notification bar, the page saves cookies. This is Compliant with the new EU cookie law.
* Date 2016-05-23T09:52:35Z
* Date 2016-05-23T21:30:06Z
*
* @author Tamás András Horváth <[email protected]> (http://icetee.hu)
* @version v0.9.3
Expand Down Expand Up @@ -134,7 +134,8 @@ var Cookiebar = function(opt) {
Cookiebar.prototype.init = function() {
var self = this;
if (self.debug) {
self.setCookie('debug_cookibar', "test", 365, function() {
self.setCookie('debug_cookibar', "test", 365, function() {
self.delCookie(self.id);
self.checkCookie();
});
} else {
Expand Down Expand Up @@ -172,7 +173,11 @@ Cookiebar.prototype.setCookie = function(cname, value, exdays, cb) {
if (typeof cb === "function") {
cb();
}
};
};

Cookiebar.prototype.delCookie = function(cname) {
document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
};

Cookiebar.prototype.draw = function() {
var self = this,
Expand Down Expand Up @@ -207,11 +212,9 @@ Cookiebar.prototype.draw = function() {
e.returnValue = false;
}

self.setCookie(self.cookie, true, 365, function() {
self.setStatus(self.cookie);
});

document.getElementById(self.id).style.display = 'none';
self.setCookie(self.cookie, true, 365);
self.setStatus(true);
document.getElementById(self.id).style.display = 'none';
});

document.body.insertBefore(bar, document.body.firstChild);
Expand All @@ -221,7 +224,7 @@ Cookiebar.prototype.checkCookie = function() {
var self = this,
cookie = self.getCookie(self.cookie);

if ((self.exitsCookie() && (cookie === "null" || cookie === "")) && cookie !== "true") {
if ((/*self.exitsCookie() &&*/ (cookie === "null" || cookie === "")) && cookie !== "true") {
self.draw();
_("#" + self.id).fade(this.fade.type, this.fade.ms);
self.setCookie(self.cookie, null, 365);
Expand All @@ -230,11 +233,11 @@ Cookiebar.prototype.checkCookie = function() {
self.setStatus(cookie);
};

Cookiebar.prototype.setStatus = function(status) {
if (status === "true") {
this.status = true;
}
};
Cookiebar.prototype.setStatus = function(status) {
if (!!status) {
this.status = !!status;
}
};

Cookiebar.prototype.getStatus = function() {
return this.status;
Expand Down
2 changes: 1 addition & 1 deletion dist/cookiebar.min.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* cookiebar - It is a pure JS code, that warns the visitors in the notification bar, the page saves cookies. This is Compliant with the new EU cookie law.
* Date 2016-05-23T09:52:35Z
* Date 2016-05-23T21:30:06Z
*
* @author Tamás András Horváth <[email protected]> (http://icetee.hu)
* @version v0.9.3
Expand Down
4 changes: 2 additions & 2 deletions dist/cookiebar.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cookiebar",
"version": "0.9.3",
"version": "0.9.4",
"description": "It is a pure JS code, that warns the visitors in the notification bar, the page saves cookies. This is Compliant with the new EU cookie law.",
"main": "index.js",
"config": {
Expand Down

0 comments on commit 076db36

Please sign in to comment.