cookies_eu 1.5.2 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b266c2df0f4ef5479babb96f59a1d2af0e9c4c0
4
- data.tar.gz: 6a9dcb9777e7d526c9751bb37afa28e19924a052
3
+ metadata.gz: 0af5f3efcb9332dc96e91d481d2a65452d54b71a
4
+ data.tar.gz: 1459279722688895ab98b9a8142fa416976b55f7
5
5
  SHA512:
6
- metadata.gz: c30656b037cf10a1a8ba92cfa6fabf64969bc449dd4aa208355c8ecb71ed2a1d56b7788eadc595bb42b34586b0a429b7683563946964e92c250ec1a84d9ac6b8
7
- data.tar.gz: 9d0bcf8c8d2c4db5405b5fa4e6e8aeb4ea33d1c0e6237c9e551c45b838f73adb44ff299d2404b3a262fb9b53ea34766ca450ba23c4ded322ce279e26a76ed9df
6
+ metadata.gz: f5e1699675a21390072d85e162cee697095818c2201ca8b0e6a8a1e397eb5ec02ffc95089158b56ec0c887b94e7efb3818c783087b50cb63bc391945fc8c94d2
7
+ data.tar.gz: f8b150edf6a08cb41f4885286794cfbfc25b0d6f8f349d78009c16f4a7ce0985b09a1bdd1d77b7b2782bad8f13439b40a026f33687a2b3b7e108f162727b2f18
@@ -1,34 +1,50 @@
1
1
  //= require js.cookie
2
2
  'use strict';
3
3
 
4
- document.addEventListener('DOMContentLoaded', function() {
5
-
6
- var cookiesEu = {
7
- init: function() {
8
- var cookiesEuOKButton = document.querySelector('.js-cookies-eu-ok');
9
-
10
- if (cookiesEuOKButton) {
11
- this.addListener(cookiesEuOKButton);
12
- }
13
- },
14
-
15
- addListener: function(target) {
16
- // Support for IE < 9
17
- if (target.attachEvent) {
18
- target.attachEvent('onclick', this.setCookie);
19
- } else {
20
- target.addEventListener('click', this.setCookie, false);
21
- }
22
- },
23
-
24
- setCookie: function() {
25
- Cookies.set('cookie_eu_consented', true, { path: '/', expires: 365 });
26
-
27
- var container = document.querySelector('.js-cookies-eu');
28
- container.parentNode.removeChild(container);
4
+ var cookiesEu = {
5
+ init: function() {
6
+ var cookiesEuOKButton = document.querySelector('.js-cookies-eu-ok');
7
+
8
+ if (cookiesEuOKButton) {
9
+ this.addListener(cookiesEuOKButton);
10
+ }
11
+ },
12
+
13
+ addListener: function(target) {
14
+ // Support for IE < 9
15
+ if (target.attachEvent) {
16
+ target.attachEvent('onclick', this.setCookie);
17
+ } else {
18
+ target.addEventListener('click', this.setCookie, false);
29
19
  }
20
+ },
21
+
22
+ setCookie: function() {
23
+ Cookies.set('cookie_eu_consented', true, { path: '/', expires: 365 });
24
+
25
+ var container = document.querySelector('.js-cookies-eu');
26
+ container.parentNode.removeChild(container);
27
+ }
28
+ };
29
+
30
+ (function() {
31
+ var isCalled = false;
32
+
33
+ function isReady() {
34
+ if (isCalled) return;
35
+ isCalled = true;
36
+
37
+ cookiesEu.init();
30
38
  }
31
39
 
32
- cookiesEu.init();
40
+ if (document.addEventListener) {
41
+ document.addEventListener('DOMContentLoaded', isReady, false);
42
+ }
33
43
 
34
- });
44
+ // Old browsers IE < 9
45
+ if (window.addEventListener) {
46
+ window.addEventListener('load', isReady, false);
47
+ } else if (window.attachEvent) {
48
+ window.attachEvent('onload', isReady);
49
+ }
50
+ })();
@@ -1,3 +1,3 @@
1
1
  module CookiesEu
2
- VERSION = "1.5.2"
2
+ VERSION = "1.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cookies_eu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stjepan Hadjic