Skip to content

Commit 076db36

Browse files
committed
Build new version
1 parent 4b75538 commit 076db36

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

dist/cookiebar.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* 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.
3-
* Date 2016-05-23T09:52:35Z
3+
* Date 2016-05-23T21:30:06Z
44
*
55
* @author Tamás András Horváth <[email protected]> (http://icetee.hu)
66
* @version v0.9.3

dist/cookiebar.js

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* 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.
3-
* Date 2016-05-23T09:52:35Z
3+
* Date 2016-05-23T21:30:06Z
44
*
55
* @author Tamás András Horváth <[email protected]> (http://icetee.hu)
66
* @version v0.9.3
@@ -134,7 +134,8 @@ var Cookiebar = function(opt) {
134134
Cookiebar.prototype.init = function() {
135135
var self = this;
136136
if (self.debug) {
137-
self.setCookie('debug_cookibar', "test", 365, function() {
137+
self.setCookie('debug_cookibar', "test", 365, function() {
138+
self.delCookie(self.id);
138139
self.checkCookie();
139140
});
140141
} else {
@@ -172,7 +173,11 @@ Cookiebar.prototype.setCookie = function(cname, value, exdays, cb) {
172173
if (typeof cb === "function") {
173174
cb();
174175
}
175-
};
176+
};
177+
178+
Cookiebar.prototype.delCookie = function(cname) {
179+
document.cookie = cname + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/";
180+
};
176181

177182
Cookiebar.prototype.draw = function() {
178183
var self = this,
@@ -207,11 +212,9 @@ Cookiebar.prototype.draw = function() {
207212
e.returnValue = false;
208213
}
209214

210-
self.setCookie(self.cookie, true, 365, function() {
211-
self.setStatus(self.cookie);
212-
});
213-
214-
document.getElementById(self.id).style.display = 'none';
215+
self.setCookie(self.cookie, true, 365);
216+
self.setStatus(true);
217+
document.getElementById(self.id).style.display = 'none';
215218
});
216219

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

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

233-
Cookiebar.prototype.setStatus = function(status) {
234-
if (status === "true") {
235-
this.status = true;
236-
}
237-
};
236+
Cookiebar.prototype.setStatus = function(status) {
237+
if (!!status) {
238+
this.status = !!status;
239+
}
240+
};
238241

239242
Cookiebar.prototype.getStatus = function() {
240243
return this.status;

dist/cookiebar.min.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/**
22
* 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.
3-
* Date 2016-05-23T09:52:35Z
3+
* Date 2016-05-23T21:30:06Z
44
*
55
* @author Tamás András Horváth <[email protected]> (http://icetee.hu)
66
* @version v0.9.3

dist/cookiebar.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cookiebar",
3-
"version": "0.9.3",
3+
"version": "0.9.4",
44
"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.",
55
"main": "index.js",
66
"config": {

0 commit comments

Comments
 (0)