Version Description
- Fix: Undefined constant HOURS_IN_SECONDS
- Fix: Button style none adding CSS classes "cn-set-cookie cn-button"
- Tweak: Switched the behavior of close icon from accept to reject
- Tweak: Minified frontend and admin js files
Download this release
Release Info
Developer | dfactory |
Plugin | Cookie Notice by dFactory |
Version | 2.0.4 |
Comparing to | |
See all releases |
Code changes from version 2.0.3 to 2.0.4
- cookie-notice.php +11 -5
- css/admin.min.css +1 -203
- css/front.css +7 -11
- css/front.min.css +1 -377
- includes/frontend.php +23 -2
- includes/settings.php +1 -1
- js/admin.min.js +5 -94
- js/front.js +1 -1
- js/front.min.js +1 -1
- readme.txt +13 -4
cookie-notice.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Cookie Notice & Compliance for GDPR / CCPA
|
4 |
Description: Cookie Notice allows you to you elegantly inform users that your site uses cookies and helps you comply with GDPR, CCPA and other data privacy laws.
|
5 |
-
Version: 2.0.
|
6 |
Author: Hu-manity.co
|
7 |
Author URI: https://hu-manity.co/
|
8 |
Plugin URI: https://hu-manity.co/
|
@@ -29,7 +29,7 @@ if ( ! defined( 'ABSPATH' ) )
|
|
29 |
* Cookie Notice class.
|
30 |
*
|
31 |
* @class Cookie_Notice
|
32 |
-
* @version 2.0.
|
33 |
*/
|
34 |
class Cookie_Notice {
|
35 |
|
@@ -85,7 +85,7 @@ class Cookie_Notice {
|
|
85 |
'update_notice' => true,
|
86 |
'update_delay_date' => 0
|
87 |
),
|
88 |
-
'version' => '2.0.
|
89 |
);
|
90 |
|
91 |
private static $_instance;
|
@@ -444,14 +444,20 @@ class Cookie_Notice {
|
|
444 |
* Add WP Super Cache cookie.
|
445 |
*/
|
446 |
public function wpsc_add_cookie() {
|
447 |
-
|
|
|
|
|
|
|
448 |
}
|
449 |
|
450 |
/**
|
451 |
* Delete WP Super Cache cookie.
|
452 |
*/
|
453 |
public function wpsc_delete_cookie() {
|
454 |
-
|
|
|
|
|
|
|
455 |
}
|
456 |
|
457 |
/**
|
2 |
/*
|
3 |
Plugin Name: Cookie Notice & Compliance for GDPR / CCPA
|
4 |
Description: Cookie Notice allows you to you elegantly inform users that your site uses cookies and helps you comply with GDPR, CCPA and other data privacy laws.
|
5 |
+
Version: 2.0.4
|
6 |
Author: Hu-manity.co
|
7 |
Author URI: https://hu-manity.co/
|
8 |
Plugin URI: https://hu-manity.co/
|
29 |
* Cookie Notice class.
|
30 |
*
|
31 |
* @class Cookie_Notice
|
32 |
+
* @version 2.0.4
|
33 |
*/
|
34 |
class Cookie_Notice {
|
35 |
|
85 |
'update_notice' => true,
|
86 |
'update_delay_date' => 0
|
87 |
),
|
88 |
+
'version' => '2.0.4'
|
89 |
);
|
90 |
|
91 |
private static $_instance;
|
444 |
* Add WP Super Cache cookie.
|
445 |
*/
|
446 |
public function wpsc_add_cookie() {
|
447 |
+
if ( Cookie_Notice()->get_status() === 'active' )
|
448 |
+
do_action( 'wpsc_add_cookie', 'hu-consent' );
|
449 |
+
else
|
450 |
+
do_action( 'wpsc_add_cookie', 'cookie_notice_accepted' );
|
451 |
}
|
452 |
|
453 |
/**
|
454 |
* Delete WP Super Cache cookie.
|
455 |
*/
|
456 |
public function wpsc_delete_cookie() {
|
457 |
+
if ( Cookie_Notice()->get_status() === 'active' )
|
458 |
+
do_action( 'wpsc_delete_cookie', 'hu-consent' );
|
459 |
+
else
|
460 |
+
do_action( 'wpsc_delete_cookie', 'cookie_notice_accepted' );
|
461 |
}
|
462 |
|
463 |
/**
|
css/admin.min.css
CHANGED
@@ -1,203 +1 @@
|
|
1 |
-
|
2 |
-
.cookie-notice-credits {
|
3 |
-
float: right;
|
4 |
-
width: 280px;
|
5 |
-
background: #fff;
|
6 |
-
margin: 20px -300px 20px 20px;
|
7 |
-
position: relative;
|
8 |
-
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
|
9 |
-
}
|
10 |
-
|
11 |
-
.cookie-notice-credits .inner {
|
12 |
-
padding: 1.33em;
|
13 |
-
}
|
14 |
-
|
15 |
-
.cookie-notice-credits .inner img {
|
16 |
-
max-width: 80%;
|
17 |
-
height: auto;
|
18 |
-
display: block;
|
19 |
-
margin: 20px auto;
|
20 |
-
}
|
21 |
-
|
22 |
-
.cookie-notice-settings .cookie-notice-credits h2 {
|
23 |
-
border: none;
|
24 |
-
padding-bottom: 0;
|
25 |
-
}
|
26 |
-
|
27 |
-
.cookie-notice-credits .inner {
|
28 |
-
text-align: center;
|
29 |
-
margin-bottom: 10px;
|
30 |
-
}
|
31 |
-
|
32 |
-
.cookie-notice-credits .cn-btn {
|
33 |
-
border-radius: 3em;
|
34 |
-
padding: 0.75em 2.5em;
|
35 |
-
box-shadow: none;
|
36 |
-
border: 2px solid #20C19E;
|
37 |
-
outline: none;
|
38 |
-
background: #20C19E;
|
39 |
-
font-size: 15px;
|
40 |
-
font-weight: bold;
|
41 |
-
color: #fff;
|
42 |
-
cursor: pointer;
|
43 |
-
display: inline-block;
|
44 |
-
text-decoration: none;
|
45 |
-
}
|
46 |
-
|
47 |
-
.cookie-notice-credits .cn-btn:hover,
|
48 |
-
.cookie-notice-credits .cn-btn:focus {
|
49 |
-
box-shadow: none;
|
50 |
-
border: 2px solid #20C19E;
|
51 |
-
background: #20C19E;
|
52 |
-
color: #fff;
|
53 |
-
text-decoration: none !important;
|
54 |
-
}
|
55 |
-
|
56 |
-
.cookie-notice-credits h3 {
|
57 |
-
font-size: 14px;
|
58 |
-
line-height: 1.4;
|
59 |
-
margin: 0;
|
60 |
-
padding: 0.66em 1.33em;;
|
61 |
-
border-bottom: 1px solid #eee;
|
62 |
-
}
|
63 |
-
|
64 |
-
.cookie-notice-settings .df-credits form {
|
65 |
-
min-width: 260px;
|
66 |
-
margin-bottom: 1em;
|
67 |
-
}
|
68 |
-
|
69 |
-
.cookie-notice-settings .df-credits form input {
|
70 |
-
margin: 0;
|
71 |
-
padding: 0;
|
72 |
-
}
|
73 |
-
|
74 |
-
.cookie-notice-settings {
|
75 |
-
margin-right: 300px;
|
76 |
-
}
|
77 |
-
|
78 |
-
.cookie-notice-settings hr, .df-credits hr {
|
79 |
-
border: solid #eee;
|
80 |
-
border-width: 1px 0 0;
|
81 |
-
clear: both;
|
82 |
-
height: 0;
|
83 |
-
}
|
84 |
-
|
85 |
-
.cookie-notice-settings h2 {
|
86 |
-
margin: 1.5em 0;
|
87 |
-
padding-bottom: 1em;
|
88 |
-
border-bottom: 1px solid #ccc;
|
89 |
-
}
|
90 |
-
|
91 |
-
.cookie-notice-settings form {
|
92 |
-
float: left;
|
93 |
-
min-width: 463px;
|
94 |
-
width: 100%;
|
95 |
-
}
|
96 |
-
|
97 |
-
.cookie-notice-settings .ui-button {
|
98 |
-
margin-bottom: 5px;
|
99 |
-
}
|
100 |
-
|
101 |
-
.cookie-notice-settings .description {
|
102 |
-
font-size: 13px;
|
103 |
-
margin-bottom: 8px;
|
104 |
-
}
|
105 |
-
|
106 |
-
.cookie-notice-settings .description strong {
|
107 |
-
color: #444;
|
108 |
-
}
|
109 |
-
|
110 |
-
#cn_colors label {
|
111 |
-
min-width: 10em;
|
112 |
-
display: inline-block;
|
113 |
-
}
|
114 |
-
|
115 |
-
#cn_colors div {
|
116 |
-
vertical-align: middle;
|
117 |
-
}
|
118 |
-
|
119 |
-
#cn_refuse_code .nav-tab-wrapper {
|
120 |
-
padding-top: 0;
|
121 |
-
}
|
122 |
-
|
123 |
-
#cn_refuse_code .refuse-code-tab {
|
124 |
-
display: none;
|
125 |
-
}
|
126 |
-
|
127 |
-
#cn_refuse_code .refuse-code-tab.active {
|
128 |
-
display: block;
|
129 |
-
}
|
130 |
-
|
131 |
-
#cn_refuse_code .refuse-code-tab .description {
|
132 |
-
margin-top: 10px;
|
133 |
-
}
|
134 |
-
|
135 |
-
.cn_compliance_status {
|
136 |
-
margin-right: 15px;
|
137 |
-
}
|
138 |
-
|
139 |
-
#cn_app_status .cn_compliance_status label {
|
140 |
-
margin-left: 5px !important;
|
141 |
-
}
|
142 |
-
|
143 |
-
#cn_app_status {
|
144 |
-
margin-bottom: 30px;
|
145 |
-
}
|
146 |
-
|
147 |
-
#cn_app_status label {
|
148 |
-
text-transform: uppercase;
|
149 |
-
font-weight: bold;
|
150 |
-
position: relative;
|
151 |
-
color: #999;
|
152 |
-
}
|
153 |
-
|
154 |
-
#cn_app_status label.cn-active {
|
155 |
-
color: green;
|
156 |
-
}
|
157 |
-
|
158 |
-
#cn_app_status label.cn-active:before {
|
159 |
-
background-color: green;
|
160 |
-
box-shadow: 0 0 0 2px green;
|
161 |
-
}
|
162 |
-
|
163 |
-
#cn_app_status label.cn-inactive {
|
164 |
-
color: red;
|
165 |
-
}
|
166 |
-
|
167 |
-
#cn_app_status label.cn-inactive:before {
|
168 |
-
background-color: red;
|
169 |
-
box-shadow: 0 0 0 2px red;
|
170 |
-
}
|
171 |
-
|
172 |
-
#cn_app_status label:before{
|
173 |
-
background-color: #999;
|
174 |
-
width: 10px;
|
175 |
-
height: 10px;
|
176 |
-
border-radius: 10px;
|
177 |
-
content: '';
|
178 |
-
display: inline-block;
|
179 |
-
vertical-align: middle;
|
180 |
-
margin-right: 10px;
|
181 |
-
box-shadow: 0 0 0 2px #999;
|
182 |
-
border: 2px solid #fff;
|
183 |
-
position: relative;
|
184 |
-
top: -2px;
|
185 |
-
}
|
186 |
-
|
187 |
-
#cn_colors_bar_opacity_range {
|
188 |
-
vertical-align: middle;
|
189 |
-
margin-right: 10px;
|
190 |
-
}
|
191 |
-
|
192 |
-
/* All Mobile Sizes (devices and browser) */
|
193 |
-
@media only screen and (max-width: 959px) {
|
194 |
-
.cookie-notice-credits {
|
195 |
-
width: 100%;
|
196 |
-
float: none;
|
197 |
-
margin: 20px 0;
|
198 |
-
}
|
199 |
-
|
200 |
-
.cookie-notice-settings {
|
201 |
-
margin-right: 0;
|
202 |
-
}
|
203 |
-
}
|
1 |
+
.cookie-notice-credits{float:right;width:280px;background:#fff;margin:20px -300px 20px 20px;position:relative;box-shadow:0 0 0 1px rgba(0,0,0,.05)}.cookie-notice-credits .inner{padding:1.33em}.cookie-notice-credits .inner img{max-width:80%;height:auto;display:block;margin:20px auto}.cookie-notice-settings .cookie-notice-credits h2{border:none;padding-bottom:0}.cookie-notice-credits .inner{text-align:center;margin-bottom:10px}.cookie-notice-credits .cn-btn{border-radius:3em;padding:.75em 2.5em;box-shadow:none;border:2px solid #20C19E;outline:none;background:#20C19E;font-size:15px;font-weight:700;color:#fff;cursor:pointer;display:inline-block;text-decoration:none}.cookie-notice-credits .cn-btn:hover,.cookie-notice-credits .cn-btn:focus{box-shadow:none;border:2px solid #20C19E;background:#20C19E;color:#fff;text-decoration:none!important}.cookie-notice-credits h3{font-size:14px;line-height:1.4;margin:0;padding:.66em 1.33em;;border-bottom:1px solid #eee}.cookie-notice-settings .df-credits form{min-width:260px;margin-bottom:1em}.cookie-notice-settings .df-credits form input{margin:0;padding:0}.cookie-notice-settings{margin-right:300px}.cookie-notice-settings hr,.df-credits hr{border:solid #eee;border-width:1px 0 0;clear:both;height:0}.cookie-notice-settings h2{margin:1.5em 0;padding-bottom:1em;border-bottom:1px solid #ccc}.cookie-notice-settings form{float:left;min-width:463px;width:100%}.cookie-notice-settings .ui-button{margin-bottom:5px}.cookie-notice-settings .description{font-size:13px;margin-bottom:8px}.cookie-notice-settings .description strong{color:#444}#cn_colors label{min-width:10em;display:inline-block}#cn_colors div{vertical-align:middle}#cn_refuse_code .nav-tab-wrapper{padding-top:0}#cn_refuse_code .refuse-code-tab{display:none}#cn_refuse_code .refuse-code-tab.active{display:block}#cn_refuse_code .refuse-code-tab .description{margin-top:10px}.cn_compliance_status{margin-right:15px}#cn_app_status .cn_compliance_status label{margin-left:5px!important}#cn_app_status{margin-bottom:30px}#cn_app_status label{text-transform:uppercase;font-weight:700;position:relative;color:#999}#cn_app_status label.cn-active{color:green}#cn_app_status label.cn-active:before{background-color:green;box-shadow:0 0 0 2px green}#cn_app_status label.cn-inactive{color:red}#cn_app_status label.cn-inactive:before{background-color:red;box-shadow:0 0 0 2px red}#cn_app_status label:before{background-color:#999;width:10px;height:10px;border-radius:10px;content:'';display:inline-block;vertical-align:middle;margin-right:10px;box-shadow:0 0 0 2px #999;border:2px solid #fff;position:relative;top:-2px}#cn_colors_bar_opacity_range{vertical-align:middle;margin-right:10px}@media only screen and (max-width:959px){.cookie-notice-credits{width:100%;float:none;margin:20px 0}.cookie-notice-settings{margin-right:0}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
css/front.css
CHANGED
@@ -106,17 +106,16 @@
|
|
106 |
|
107 |
#cookie-notice .cn-button {
|
108 |
margin: 0 0 0 10px;
|
109 |
-
border: none;
|
110 |
}
|
111 |
|
112 |
-
.cn-button
|
|
|
113 |
font-family: -apple-system,BlinkMacSystemFont,Arial,Roboto,"Helvetica Neue",sans-serif;
|
114 |
font-weight: normal;
|
115 |
font-size: 13px;
|
116 |
letter-spacing: 0.25px;
|
117 |
line-height: 20px;
|
118 |
margin: 0;
|
119 |
-
padding: 0;
|
120 |
text-align: center;
|
121 |
text-transform: none;
|
122 |
display: inline-block;
|
@@ -130,18 +129,15 @@
|
|
130 |
-webkit-border-radius: 3px;
|
131 |
-moz-border-radius: 3px;
|
132 |
border-radius: 3px;
|
133 |
-
}
|
134 |
-
|
135 |
-
.cn-button:hover {
|
136 |
-
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.05);
|
137 |
text-decoration: none;
|
|
|
|
|
138 |
}
|
139 |
|
140 |
-
.cn-button.wp-default,
|
141 |
-
.cn-button.bootstrap {
|
|
|
142 |
text-decoration: none;
|
143 |
-
padding: 8.5px 10px;
|
144 |
-
line-height: 1;
|
145 |
}
|
146 |
|
147 |
.cn-button.wp-default {
|
106 |
|
107 |
#cookie-notice .cn-button {
|
108 |
margin: 0 0 0 10px;
|
|
|
109 |
}
|
110 |
|
111 |
+
.cn-button.wp-default,
|
112 |
+
.cn-button.bootstrap {
|
113 |
font-family: -apple-system,BlinkMacSystemFont,Arial,Roboto,"Helvetica Neue",sans-serif;
|
114 |
font-weight: normal;
|
115 |
font-size: 13px;
|
116 |
letter-spacing: 0.25px;
|
117 |
line-height: 20px;
|
118 |
margin: 0;
|
|
|
119 |
text-align: center;
|
120 |
text-transform: none;
|
121 |
display: inline-block;
|
129 |
-webkit-border-radius: 3px;
|
130 |
-moz-border-radius: 3px;
|
131 |
border-radius: 3px;
|
|
|
|
|
|
|
|
|
132 |
text-decoration: none;
|
133 |
+
padding: 8.5px 10px;
|
134 |
+
line-height: 1;
|
135 |
}
|
136 |
|
137 |
+
.cn-button.wp-default:hover,
|
138 |
+
.cn-button.bootstrap:hover {
|
139 |
+
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.05);
|
140 |
text-decoration: none;
|
|
|
|
|
141 |
}
|
142 |
|
143 |
.cn-button.wp-default {
|
css/front.min.css
CHANGED
@@ -1,377 +1 @@
|
|
1 |
-
#cookie-notice {
|
2 |
-
position: fixed;
|
3 |
-
min-width: 100%;
|
4 |
-
height: auto;
|
5 |
-
z-index: 100000;
|
6 |
-
font-size: 13px;
|
7 |
-
letter-spacing: 0;
|
8 |
-
line-height: 20px;
|
9 |
-
left: 0;
|
10 |
-
text-align: center;
|
11 |
-
/* border-top: 2px solid #fbb03b; */
|
12 |
-
font-weight: normal;
|
13 |
-
font-family: -apple-system,BlinkMacSystemFont,Arial,Roboto,"Helvetica Neue",sans-serif;
|
14 |
-
}
|
15 |
-
|
16 |
-
#cookie-notice,
|
17 |
-
#cookie-notice * {
|
18 |
-
-webkit-box-sizing: border-box;
|
19 |
-
-moz-box-sizing: border-box;
|
20 |
-
box-sizing: border-box;
|
21 |
-
}
|
22 |
-
|
23 |
-
#cookie-notice.cn-animated {
|
24 |
-
-webkit-animation-duration: 0.5s !important;
|
25 |
-
animation-duration: 0.5s !important;
|
26 |
-
-webkit-animation-fill-mode: both;
|
27 |
-
animation-fill-mode: both;
|
28 |
-
}
|
29 |
-
|
30 |
-
#cookie-notice.cn-animated.cn-effect-none {
|
31 |
-
-webkit-animation-duration: 0.001s !important;
|
32 |
-
animation-duration: 0.001s !important;
|
33 |
-
}
|
34 |
-
|
35 |
-
#cookie-notice .cookie-notice-container {
|
36 |
-
display: block;
|
37 |
-
}
|
38 |
-
|
39 |
-
#cookie-notice.cookie-notice-hidden .cookie-notice-container {
|
40 |
-
display: none;
|
41 |
-
}
|
42 |
-
|
43 |
-
#cookie-notice .cookie-revoke-container {
|
44 |
-
display: block;
|
45 |
-
}
|
46 |
-
|
47 |
-
#cookie-notice.cookie-revoke-hidden .cookie-revoke-container {
|
48 |
-
display: none;
|
49 |
-
}
|
50 |
-
|
51 |
-
.cn-position-top {
|
52 |
-
top: 0;
|
53 |
-
}
|
54 |
-
|
55 |
-
.cn-position-bottom {
|
56 |
-
bottom: 0;
|
57 |
-
}
|
58 |
-
|
59 |
-
.cookie-notice-container {
|
60 |
-
padding: 15px 30px;
|
61 |
-
text-align: center;
|
62 |
-
width: 100%;
|
63 |
-
z-index: 2;
|
64 |
-
}
|
65 |
-
|
66 |
-
.cookie-revoke-container {
|
67 |
-
padding: 15px 30px;
|
68 |
-
width: 100%;
|
69 |
-
z-index: 1;
|
70 |
-
}
|
71 |
-
|
72 |
-
.cn-close-icon {
|
73 |
-
position: absolute;
|
74 |
-
right: 15px;
|
75 |
-
top: 50%;
|
76 |
-
margin-top: -10px;
|
77 |
-
width: 15px;
|
78 |
-
height: 15px;
|
79 |
-
opacity: 0.5;
|
80 |
-
padding: 10px;
|
81 |
-
outline: none;
|
82 |
-
}
|
83 |
-
|
84 |
-
.cn-close-icon:hover {
|
85 |
-
opacity: 1;
|
86 |
-
}
|
87 |
-
.cn-close-icon:before,
|
88 |
-
.cn-close-icon:after {
|
89 |
-
position: absolute;
|
90 |
-
content: ' ';
|
91 |
-
height: 15px;
|
92 |
-
width: 2px;
|
93 |
-
top: 3px;
|
94 |
-
background-color: #fff;
|
95 |
-
}
|
96 |
-
.cn-close-icon:before {
|
97 |
-
transform: rotate(45deg);
|
98 |
-
}
|
99 |
-
.cn-close-icon:after {
|
100 |
-
transform: rotate(-45deg);
|
101 |
-
}
|
102 |
-
|
103 |
-
#cookie-notice .cn-revoke-cookie {
|
104 |
-
margin: 0;
|
105 |
-
}
|
106 |
-
|
107 |
-
#cookie-notice .cn-button {
|
108 |
-
margin: 0 0 0 10px;
|
109 |
-
border: none;
|
110 |
-
}
|
111 |
-
|
112 |
-
.cn-button {
|
113 |
-
font-family: -apple-system,BlinkMacSystemFont,Arial,Roboto,"Helvetica Neue",sans-serif;
|
114 |
-
font-weight: normal;
|
115 |
-
font-size: 13px;
|
116 |
-
letter-spacing: 0.25px;
|
117 |
-
line-height: 20px;
|
118 |
-
margin: 0;
|
119 |
-
padding: 0;
|
120 |
-
text-align: center;
|
121 |
-
text-transform: none;
|
122 |
-
display: inline-block;
|
123 |
-
cursor: pointer;
|
124 |
-
touch-action: manipulation;
|
125 |
-
white-space: nowrap;
|
126 |
-
outline: none;
|
127 |
-
box-shadow: none;
|
128 |
-
text-shadow: none;
|
129 |
-
border: none;
|
130 |
-
-webkit-border-radius: 3px;
|
131 |
-
-moz-border-radius: 3px;
|
132 |
-
border-radius: 3px;
|
133 |
-
}
|
134 |
-
|
135 |
-
.cn-button:hover {
|
136 |
-
box-shadow: inset 0 0 0 99999px rgba(0,0,0,0.05);
|
137 |
-
text-decoration: none;
|
138 |
-
}
|
139 |
-
|
140 |
-
.cn-button.wp-default,
|
141 |
-
.cn-button.bootstrap {
|
142 |
-
text-decoration: none;
|
143 |
-
padding: 8.5px 10px;
|
144 |
-
line-height: 1;
|
145 |
-
}
|
146 |
-
|
147 |
-
.cn-button.wp-default {
|
148 |
-
color: #fff;
|
149 |
-
background: #fbb03b;
|
150 |
-
}
|
151 |
-
|
152 |
-
.cn-button.wp-default:hover {
|
153 |
-
}
|
154 |
-
|
155 |
-
.cn-button.bootstrap {
|
156 |
-
color: #fff;
|
157 |
-
background: #20C19E;
|
158 |
-
}
|
159 |
-
|
160 |
-
.cn-button.bootstrap:hover {
|
161 |
-
}
|
162 |
-
|
163 |
-
.cn-text-container {
|
164 |
-
margin: 0 0 6px 0;
|
165 |
-
}
|
166 |
-
|
167 |
-
.cn-text-container,
|
168 |
-
.cn-buttons-container {
|
169 |
-
display: inline-block;
|
170 |
-
}
|
171 |
-
|
172 |
-
#cookie-notice.cookie-notice-visible.cn-effect-none,
|
173 |
-
#cookie-notice.cookie-revoke-visible.cn-effect-none {
|
174 |
-
-webkit-animation-name: fadeIn;
|
175 |
-
animation-name: fadeIn;
|
176 |
-
}
|
177 |
-
|
178 |
-
#cookie-notice.cn-effect-none {
|
179 |
-
-webkit-animation-name: fadeOut;
|
180 |
-
animation-name: fadeOut;
|
181 |
-
}
|
182 |
-
|
183 |
-
#cookie-notice.cookie-notice-visible.cn-effect-fade,
|
184 |
-
#cookie-notice.cookie-revoke-visible.cn-effect-fade {
|
185 |
-
-webkit-animation-name: fadeIn;
|
186 |
-
animation-name: fadeIn;
|
187 |
-
}
|
188 |
-
|
189 |
-
#cookie-notice.cn-effect-fade {
|
190 |
-
-webkit-animation-name: fadeOut;
|
191 |
-
animation-name: fadeOut;
|
192 |
-
}
|
193 |
-
|
194 |
-
#cookie-notice.cookie-notice-visible.cn-effect-slide,
|
195 |
-
#cookie-notice.cookie-revoke-visible.cn-effect-slide{
|
196 |
-
-webkit-animation-name: slideInUp;
|
197 |
-
animation-name: slideInUp;
|
198 |
-
}
|
199 |
-
|
200 |
-
#cookie-notice.cn-effect-slide {
|
201 |
-
-webkit-animation-name: slideOutDown;
|
202 |
-
animation-name: slideOutDown;
|
203 |
-
}
|
204 |
-
|
205 |
-
#cookie-notice.cookie-notice-visible.cn-position-top.cn-effect-slide,
|
206 |
-
#cookie-notice.cookie-revoke-visible.cn-position-top.cn-effect-slide {
|
207 |
-
-webkit-animation-name: slideInDown;
|
208 |
-
animation-name: slideInDown;
|
209 |
-
}
|
210 |
-
|
211 |
-
#cookie-notice.cn-position-top.cn-effect-slide {
|
212 |
-
-webkit-animation-name: slideOutUp;
|
213 |
-
animation-name: slideOutUp;
|
214 |
-
}
|
215 |
-
|
216 |
-
@-webkit-keyframes fadeIn {
|
217 |
-
from {
|
218 |
-
opacity: 0;
|
219 |
-
}
|
220 |
-
|
221 |
-
to {
|
222 |
-
opacity: 1;
|
223 |
-
}
|
224 |
-
}
|
225 |
-
|
226 |
-
@keyframes fadeIn {
|
227 |
-
from {
|
228 |
-
opacity: 0;
|
229 |
-
}
|
230 |
-
|
231 |
-
to {
|
232 |
-
opacity: 1;
|
233 |
-
}
|
234 |
-
}
|
235 |
-
|
236 |
-
@-webkit-keyframes fadeOut {
|
237 |
-
from {
|
238 |
-
opacity: 1;
|
239 |
-
}
|
240 |
-
|
241 |
-
to {
|
242 |
-
opacity: 0;
|
243 |
-
}
|
244 |
-
}
|
245 |
-
|
246 |
-
@keyframes fadeOut {
|
247 |
-
from {
|
248 |
-
opacity: 1;
|
249 |
-
}
|
250 |
-
|
251 |
-
to {
|
252 |
-
opacity: 0;
|
253 |
-
}
|
254 |
-
}
|
255 |
-
|
256 |
-
@-webkit-keyframes slideInUp {
|
257 |
-
from {
|
258 |
-
-webkit-transform: translate3d(0, 100%, 0);
|
259 |
-
transform: translate3d(0, 100%, 0);
|
260 |
-
visibility: visible;
|
261 |
-
}
|
262 |
-
|
263 |
-
to {
|
264 |
-
-webkit-transform: translate3d(0, 0, 0);
|
265 |
-
transform: translate3d(0, 0, 0);
|
266 |
-
}
|
267 |
-
}
|
268 |
-
|
269 |
-
@keyframes slideInUp {
|
270 |
-
from {
|
271 |
-
-webkit-transform: translate3d(0, 100%, 0);
|
272 |
-
transform: translate3d(0, 100%, 0);
|
273 |
-
visibility: visible;
|
274 |
-
}
|
275 |
-
|
276 |
-
to {
|
277 |
-
-webkit-transform: translate3d(0, 0, 0);
|
278 |
-
transform: translate3d(0, 0, 0);
|
279 |
-
}
|
280 |
-
}
|
281 |
-
|
282 |
-
@-webkit-keyframes slideOutDown {
|
283 |
-
from {
|
284 |
-
-webkit-transform: translate3d(0, 0, 0);
|
285 |
-
transform: translate3d(0, 0, 0);
|
286 |
-
}
|
287 |
-
|
288 |
-
to {
|
289 |
-
visibility: hidden;
|
290 |
-
-webkit-transform: translate3d(0, 100%, 0);
|
291 |
-
transform: translate3d(0, 100%, 0);
|
292 |
-
}
|
293 |
-
}
|
294 |
-
|
295 |
-
@keyframes slideOutDown {
|
296 |
-
from {
|
297 |
-
-webkit-transform: translate3d(0, 0, 0);
|
298 |
-
transform: translate3d(0, 0, 0);
|
299 |
-
}
|
300 |
-
|
301 |
-
to {
|
302 |
-
visibility: hidden;
|
303 |
-
-webkit-transform: translate3d(0, 100%, 0);
|
304 |
-
transform: translate3d(0, 100%, 0);
|
305 |
-
}
|
306 |
-
}
|
307 |
-
|
308 |
-
@-webkit-keyframes slideInDown {
|
309 |
-
from {
|
310 |
-
-webkit-transform: translate3d(0, -100%, 0);
|
311 |
-
transform: translate3d(0, -100%, 0);
|
312 |
-
visibility: visible;
|
313 |
-
}
|
314 |
-
|
315 |
-
to {
|
316 |
-
-webkit-transform: translate3d(0, 0, 0);
|
317 |
-
transform: translate3d(0, 0, 0);
|
318 |
-
}
|
319 |
-
}
|
320 |
-
|
321 |
-
@keyframes slideInDown {
|
322 |
-
from {
|
323 |
-
-webkit-transform: translate3d(0, -100%, 0);
|
324 |
-
transform: translate3d(0, -100%, 0);
|
325 |
-
visibility: visible;
|
326 |
-
}
|
327 |
-
|
328 |
-
to {
|
329 |
-
-webkit-transform: translate3d(0, 0, 0);
|
330 |
-
transform: translate3d(0, 0, 0);
|
331 |
-
}
|
332 |
-
}
|
333 |
-
|
334 |
-
@-webkit-keyframes slideOutUp {
|
335 |
-
from {
|
336 |
-
-webkit-transform: translate3d(0, 0, 0);
|
337 |
-
transform: translate3d(0, 0, 0);
|
338 |
-
}
|
339 |
-
|
340 |
-
to {
|
341 |
-
visibility: hidden;
|
342 |
-
-webkit-transform: translate3d(0, -100%, 0);
|
343 |
-
transform: translate3d(0, -100%, 0);
|
344 |
-
}
|
345 |
-
}
|
346 |
-
|
347 |
-
@keyframes slideOutUp {
|
348 |
-
from {
|
349 |
-
-webkit-transform: translate3d(0, 0, 0);
|
350 |
-
transform: translate3d(0, 0, 0);
|
351 |
-
}
|
352 |
-
|
353 |
-
to {
|
354 |
-
visibility: hidden;
|
355 |
-
-webkit-transform: translate3d(0, -100%, 0);
|
356 |
-
transform: translate3d(0, -100%, 0);
|
357 |
-
}
|
358 |
-
}
|
359 |
-
|
360 |
-
@media all and (max-width: 900px) {
|
361 |
-
.cookie-notice-container #cn-notice-text {
|
362 |
-
display: block;
|
363 |
-
}
|
364 |
-
.cookie-notice-container #cn-notice-buttons {
|
365 |
-
display: block;
|
366 |
-
}
|
367 |
-
#cookie-notice .cn-button {
|
368 |
-
margin: 0 5px 5px 5px;
|
369 |
-
}
|
370 |
-
}
|
371 |
-
|
372 |
-
@media all and (max-width: 480px) {
|
373 |
-
.cookie-notice-container,
|
374 |
-
.cookie-revoke-container {
|
375 |
-
padding: 15px 25px;
|
376 |
-
}
|
377 |
-
}
|
1 |
+
#cookie-notice{position:fixed;min-width:100%;height:auto;z-index:100000;font-size:13px;letter-spacing:0;line-height:20px;left:0;text-align:center;font-weight:400;font-family:-apple-system,BlinkMacSystemFont,Arial,Roboto,"Helvetica Neue",sans-serif}#cookie-notice,#cookie-notice *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}#cookie-notice.cn-animated{-webkit-animation-duration:0.5s!important;animation-duration:0.5s!important;-webkit-animation-fill-mode:both;animation-fill-mode:both}#cookie-notice.cn-animated.cn-effect-none{-webkit-animation-duration:0.001s!important;animation-duration:0.001s!important}#cookie-notice .cookie-notice-container{display:block}#cookie-notice.cookie-notice-hidden .cookie-notice-container{display:none}#cookie-notice .cookie-revoke-container{display:block}#cookie-notice.cookie-revoke-hidden .cookie-revoke-container{display:none}.cn-position-top{top:0}.cn-position-bottom{bottom:0}.cookie-notice-container{padding:15px 30px;text-align:center;width:100%;z-index:2}.cookie-revoke-container{padding:15px 30px;width:100%;z-index:1}.cn-close-icon{position:absolute;right:15px;top:50%;margin-top:-10px;width:15px;height:15px;opacity:.5;padding:10px;outline:none}.cn-close-icon:hover{opacity:1}.cn-close-icon:before,.cn-close-icon:after{position:absolute;content:' ';height:15px;width:2px;top:3px;background-color:#fff}.cn-close-icon:before{transform:rotate(45deg)}.cn-close-icon:after{transform:rotate(-45deg)}#cookie-notice .cn-revoke-cookie{margin:0}#cookie-notice .cn-button{margin:0 0 0 10px}.cn-button.wp-default,.cn-button.bootstrap{font-family:-apple-system,BlinkMacSystemFont,Arial,Roboto,"Helvetica Neue",sans-serif;font-weight:400;font-size:13px;letter-spacing:.25px;line-height:20px;margin:0;text-align:center;text-transform:none;display:inline-block;cursor:pointer;touch-action:manipulation;white-space:nowrap;outline:none;box-shadow:none;text-shadow:none;border:none;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;text-decoration:none;padding:8.5px 10px;line-height:1}.cn-button.wp-default:hover,.cn-button.bootstrap:hover{box-shadow:inset 0 0 0 99999px rgba(0,0,0,.05);text-decoration:none}.cn-button.wp-default{color:#fff;background:#fbb03b}.cn-button.bootstrap{color:#fff;background:#20C19E}.cn-text-container{margin:0 0 6px 0}.cn-text-container,.cn-buttons-container{display:inline-block}#cookie-notice.cookie-notice-visible.cn-effect-none,#cookie-notice.cookie-revoke-visible.cn-effect-none{-webkit-animation-name:fadeIn;animation-name:fadeIn}#cookie-notice.cn-effect-none{-webkit-animation-name:fadeOut;animation-name:fadeOut}#cookie-notice.cookie-notice-visible.cn-effect-fade,#cookie-notice.cookie-revoke-visible.cn-effect-fade{-webkit-animation-name:fadeIn;animation-name:fadeIn}#cookie-notice.cn-effect-fade{-webkit-animation-name:fadeOut;animation-name:fadeOut}#cookie-notice.cookie-notice-visible.cn-effect-slide,#cookie-notice.cookie-revoke-visible.cn-effect-slide{-webkit-animation-name:slideInUp;animation-name:slideInUp}#cookie-notice.cn-effect-slide{-webkit-animation-name:slideOutDown;animation-name:slideOutDown}#cookie-notice.cookie-notice-visible.cn-position-top.cn-effect-slide,#cookie-notice.cookie-revoke-visible.cn-position-top.cn-effect-slide{-webkit-animation-name:slideInDown;animation-name:slideInDown}#cookie-notice.cn-position-top.cn-effect-slide{-webkit-animation-name:slideOutUp;animation-name:slideOutUp}@-webkit-keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@-webkit-keyframes fadeOut{from{opacity:1}to{opacity:0}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}@-webkit-keyframes slideInUp{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);visibility:visible}to{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes slideInUp{from{-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0);visibility:visible}to{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@-webkit-keyframes slideOutDown{from{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}to{visibility:hidden;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@keyframes slideOutDown{from{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}to{visibility:hidden;-webkit-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}@-webkit-keyframes slideInDown{from{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0);visibility:visible}to{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes slideInDown{from{-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0);visibility:visible}to{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@-webkit-keyframes slideOutUp{from{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}to{visibility:hidden;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@keyframes slideOutUp{from{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}to{visibility:hidden;-webkit-transform:translate3d(0,-100%,0);transform:translate3d(0,-100%,0)}}@media all and (max-width:900px){.cookie-notice-container #cn-notice-text{display:block}.cookie-notice-container #cn-notice-buttons{display:block}#cookie-notice .cn-button{margin:0 5px 5px 5px}}@media all and (max-width:480px){.cookie-notice-container,.cookie-revoke-container{padding:15px 25px}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/frontend.php
CHANGED
@@ -46,6 +46,7 @@ class Cookie_Notice_Frontend {
|
|
46 |
} else {
|
47 |
// actions
|
48 |
add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_notice_scripts' ) );
|
|
|
49 |
add_action( 'wp_head', array( $this, 'wp_print_header_scripts' ) );
|
50 |
add_action( 'wp_print_footer_scripts', array( $this, 'wp_print_footer_scripts' ) );
|
51 |
add_action( 'wp_footer', array( $this, 'add_cookie_notice' ), 1000 );
|
@@ -73,6 +74,11 @@ class Cookie_Notice_Frontend {
|
|
73 |
// get site language
|
74 |
$locale = get_locale();
|
75 |
$locale_code = explode( '_', $locale );
|
|
|
|
|
|
|
|
|
|
|
76 |
|
77 |
$options = array(
|
78 |
'appID' => Cookie_Notice()->options['general']['app_id'],
|
@@ -185,7 +191,7 @@ class Cookie_Notice_Frontend {
|
|
185 |
|
186 |
// message output
|
187 |
$output = '
|
188 |
-
<!-- Cookie Notice plugin v' . Cookie_Notice()->defaults['version'] . '
|
189 |
<div id="cookie-notice" role="banner" class="cookie-notice-hidden cookie-revoke-hidden cn-position-' . $options['position'] . '" aria-label="' . $options['aria_label'] . '" style="background-color: rgba(' . implode( ',', Cookie_Notice()->hex2rgb( $options['colors']['bar'] ) ) . ',' . $options['colors']['bar_opacity'] * 0.01 . ');">'
|
190 |
. '<div class="cookie-notice-container" style="color: ' . $options['colors']['text'] . ';">'
|
191 |
. '<span id="cn-notice-text" class="cn-text-container">'. $options['message_text'] . '</span>'
|
@@ -238,6 +244,21 @@ class Cookie_Notice_Frontend {
|
|
238 |
|
239 |
wp_enqueue_style( 'cookie-notice-front', plugins_url( '../css/front' . ( ! ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.min' : '' ) . '.css', __FILE__ ) );
|
240 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
241 |
|
242 |
/**
|
243 |
* Print non functional JavaScript in body.
|
@@ -308,7 +329,7 @@ class Cookie_Notice_Frontend {
|
|
308 |
|
309 |
// save data
|
310 |
if ( $config_data && is_array( $config_data ) )
|
311 |
-
set_transient( 'cookie_notice_compliance_cache', $config_data, 24 *
|
312 |
|
313 |
return true;
|
314 |
exit;
|
46 |
} else {
|
47 |
// actions
|
48 |
add_action( 'wp_enqueue_scripts', array( $this, 'wp_enqueue_notice_scripts' ) );
|
49 |
+
add_filter( 'script_loader_tag', array( $this, 'wp_enqueue_script_async' ), 10, 3 );
|
50 |
add_action( 'wp_head', array( $this, 'wp_print_header_scripts' ) );
|
51 |
add_action( 'wp_print_footer_scripts', array( $this, 'wp_print_footer_scripts' ) );
|
52 |
add_action( 'wp_footer', array( $this, 'add_cookie_notice' ), 1000 );
|
74 |
// get site language
|
75 |
$locale = get_locale();
|
76 |
$locale_code = explode( '_', $locale );
|
77 |
+
|
78 |
+
// exceptions, norwegian
|
79 |
+
if ( in_array( $locale_code, array( 'nb', 'nn' ) ) ) {
|
80 |
+
$locale_code = 'no';
|
81 |
+
}
|
82 |
|
83 |
$options = array(
|
84 |
'appID' => Cookie_Notice()->options['general']['app_id'],
|
191 |
|
192 |
// message output
|
193 |
$output = '
|
194 |
+
<!-- Cookie Notice plugin v' . Cookie_Notice()->defaults['version'] . ' -->
|
195 |
<div id="cookie-notice" role="banner" class="cookie-notice-hidden cookie-revoke-hidden cn-position-' . $options['position'] . '" aria-label="' . $options['aria_label'] . '" style="background-color: rgba(' . implode( ',', Cookie_Notice()->hex2rgb( $options['colors']['bar'] ) ) . ',' . $options['colors']['bar_opacity'] * 0.01 . ');">'
|
196 |
. '<div class="cookie-notice-container" style="color: ' . $options['colors']['text'] . ';">'
|
197 |
. '<span id="cn-notice-text" class="cn-text-container">'. $options['message_text'] . '</span>'
|
244 |
|
245 |
wp_enqueue_style( 'cookie-notice-front', plugins_url( '../css/front' . ( ! ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '.min' : '' ) . '.css', __FILE__ ) );
|
246 |
}
|
247 |
+
|
248 |
+
/**
|
249 |
+
* Make a JavaScript Asynchronous
|
250 |
+
*
|
251 |
+
* @param string $tag The original enqueued script tag
|
252 |
+
* @param string $handle The registered unique name of the script
|
253 |
+
* @param string $src
|
254 |
+
* @return string $tag The modified script tag
|
255 |
+
*/
|
256 |
+
public function wp_enqueue_script_async( $tag, $handle, $src ) {
|
257 |
+
if ( 'cookie-notice-front' === $handle ) {
|
258 |
+
$tag = str_replace( '<script', '<script async', $tag );
|
259 |
+
}
|
260 |
+
return $tag;
|
261 |
+
}
|
262 |
|
263 |
/**
|
264 |
* Print non functional JavaScript in body.
|
329 |
|
330 |
// save data
|
331 |
if ( $config_data && is_array( $config_data ) )
|
332 |
+
set_transient( 'cookie_notice_compliance_cache', $config_data, 24 * HOUR_IN_SECONDS );
|
333 |
|
334 |
return true;
|
335 |
exit;
|
includes/settings.php
CHANGED
@@ -565,7 +565,7 @@ class Cookie_Notice_Settings {
|
|
565 |
<span class="cn_compliance_status">' . __( 'Proof-of-Consent', 'cookie-notice' ) . ': <label class="cn-inactive">' . __( 'Inactive', 'cookie-notice' ) . '</label></span>
|
566 |
</div>
|
567 |
<div id="cn_app_actions">
|
568 |
-
<a href="' . admin_url( 'index.php?page=cookie-notice-welcome' ) . '" class="button button-primary button-hero">' . __( 'Add GDPR/CCPA Compliance', 'cookie-notice' ) . '</a>
|
569 |
<p class="description">' . __( 'Launch Cookie Compliance™ and add GDPR & CCPA compliance features.', 'cookie-notice' ) . '</p>
|
570 |
</div>
|
571 |
</fieldset>';
|
565 |
<span class="cn_compliance_status">' . __( 'Proof-of-Consent', 'cookie-notice' ) . ': <label class="cn-inactive">' . __( 'Inactive', 'cookie-notice' ) . '</label></span>
|
566 |
</div>
|
567 |
<div id="cn_app_actions">
|
568 |
+
<a href="' . admin_url( 'index.php?page=cookie-notice-welcome&screen=2' ) . '" class="button button-primary button-hero">' . __( 'Add GDPR/CCPA Compliance', 'cookie-notice' ) . '</a>
|
569 |
<p class="description">' . __( 'Launch Cookie Compliance™ and add GDPR & CCPA compliance features.', 'cookie-notice' ) . '</p>
|
570 |
</div>
|
571 |
</fieldset>';
|
js/admin.min.js
CHANGED
@@ -1,94 +1,5 @@
|
|
1 |
-
( function(
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
$( '.cn_color' ).wpColorPicker();
|
7 |
-
|
8 |
-
$( '#cn_app_purge_cache a' ).on( 'click', function( e ) {
|
9 |
-
e.preventDefault();
|
10 |
-
|
11 |
-
var el = this;
|
12 |
-
|
13 |
-
$( el ).parent().addClass( 'loading' ).append( '<span class="spinner is-active" style="float: none;"></span>' );
|
14 |
-
|
15 |
-
$.ajax( {
|
16 |
-
url: cnArgs.ajaxUrl,
|
17 |
-
type: 'POST',
|
18 |
-
dataType: 'json',
|
19 |
-
data: {
|
20 |
-
action: 'cn_purge_cache',
|
21 |
-
nonce: cnArgs.nonce
|
22 |
-
}
|
23 |
-
} )
|
24 |
-
.done ( function ( result ) {
|
25 |
-
console.log( result );
|
26 |
-
} )
|
27 |
-
.always ( function ( result ) {
|
28 |
-
$( el ).parent().find( '.spinner' ).remove();
|
29 |
-
} );
|
30 |
-
} );
|
31 |
-
|
32 |
-
// refuse option
|
33 |
-
$( '#cn_refuse_opt' ).on( 'change', function() {
|
34 |
-
if ( $( this ).is( ':checked' ) )
|
35 |
-
$( '#cn_refuse_opt_container' ).slideDown( 'fast' );
|
36 |
-
else
|
37 |
-
$( '#cn_refuse_opt_container' ).slideUp( 'fast' );
|
38 |
-
} );
|
39 |
-
|
40 |
-
// revoke option
|
41 |
-
$( '#cn_revoke_cookies' ).on( 'change', function() {
|
42 |
-
if ( $( this ).is( ':checked' ) )
|
43 |
-
$( '#cn_revoke_opt_container' ).slideDown( 'fast' );
|
44 |
-
else
|
45 |
-
$( '#cn_revoke_opt_container' ).slideUp( 'fast' );
|
46 |
-
} );
|
47 |
-
|
48 |
-
// privacy policy option
|
49 |
-
$( '#cn_see_more' ).on( 'change', function() {
|
50 |
-
if ( $( this ).is( ':checked' ) )
|
51 |
-
$( '#cn_see_more_opt' ).slideDown( 'fast' );
|
52 |
-
else
|
53 |
-
$( '#cn_see_more_opt' ).slideUp( 'fast' );
|
54 |
-
} );
|
55 |
-
|
56 |
-
// on scroll option
|
57 |
-
$( '#cn_on_scroll' ).on( 'change', function() {
|
58 |
-
if ( $( this ).is( ':checked' ) )
|
59 |
-
$( '#cn_on_scroll_offset' ).slideDown( 'fast' );
|
60 |
-
else
|
61 |
-
$( '#cn_on_scroll_offset' ).slideUp( 'fast' );
|
62 |
-
} );
|
63 |
-
|
64 |
-
// privacy policy link
|
65 |
-
$( '#cn_see_more_link-custom, #cn_see_more_link-page' ).on( 'change', function() {
|
66 |
-
if ( $( '#cn_see_more_link-custom:checked' ).val() === 'custom' ) {
|
67 |
-
$( '#cn_see_more_opt_page' ).slideUp( 'fast', function() {
|
68 |
-
$( '#cn_see_more_opt_link' ).slideDown( 'fast' );
|
69 |
-
} );
|
70 |
-
} else if ( $( '#cn_see_more_link-page:checked' ).val() === 'page' ) {
|
71 |
-
$( '#cn_see_more_opt_link' ).slideUp( 'fast', function() {
|
72 |
-
$( '#cn_see_more_opt_page' ).slideDown( 'fast' );
|
73 |
-
} );
|
74 |
-
}
|
75 |
-
} );
|
76 |
-
|
77 |
-
$( '#cn_refuse_code_fields' ).find( 'a' ).on( 'click', function( e ) {
|
78 |
-
e.preventDefault();
|
79 |
-
|
80 |
-
$( '#cn_refuse_code_fields' ).find( 'a' ).removeClass( 'nav-tab-active' );
|
81 |
-
$( '.refuse-code-tab' ).removeClass( 'active' );
|
82 |
-
|
83 |
-
var id = $( this ).attr( 'id' ).replace( '-tab', '' );
|
84 |
-
|
85 |
-
$( '#' + id ).addClass( 'active' );
|
86 |
-
$( this ).addClass( 'nav-tab-active' );
|
87 |
-
} );
|
88 |
-
} );
|
89 |
-
|
90 |
-
$( document ).on( 'click', 'input#reset_cookie_notice_options', function() {
|
91 |
-
return confirm( cnArgs.resetToDefaults );
|
92 |
-
} );
|
93 |
-
|
94 |
-
} )( jQuery );
|
1 |
+
(function($){$(function(){$('.cn_color').wpColorPicker();$('#cn_app_purge_cache a').on('click',function(e){e.preventDefault();var el=this;$(el).parent().addClass('loading').append('<span class="spinner is-active" style="float: none;"></span>');$.ajax({url:cnArgs.ajaxUrl,type:'POST',dataType:'json',data:{action:'cn_purge_cache',nonce:cnArgs.nonce}}).done(function(result){console.log(result)}).always(function(result){$(el).parent().find('.spinner').remove()})});$('#cn_refuse_opt').on('change',function(){if($(this).is(':checked'))
|
2 |
+
$('#cn_refuse_opt_container').slideDown('fast');else $('#cn_refuse_opt_container').slideUp('fast')});$('#cn_revoke_cookies').on('change',function(){if($(this).is(':checked'))
|
3 |
+
$('#cn_revoke_opt_container').slideDown('fast');else $('#cn_revoke_opt_container').slideUp('fast')});$('#cn_see_more').on('change',function(){if($(this).is(':checked'))
|
4 |
+
$('#cn_see_more_opt').slideDown('fast');else $('#cn_see_more_opt').slideUp('fast')});$('#cn_on_scroll').on('change',function(){if($(this).is(':checked'))
|
5 |
+
$('#cn_on_scroll_offset').slideDown('fast');else $('#cn_on_scroll_offset').slideUp('fast')});$('#cn_see_more_link-custom, #cn_see_more_link-page').on('change',function(){if($('#cn_see_more_link-custom:checked').val()==='custom'){$('#cn_see_more_opt_page').slideUp('fast',function(){$('#cn_see_more_opt_link').slideDown('fast')})}else if($('#cn_see_more_link-page:checked').val()==='page'){$('#cn_see_more_opt_link').slideUp('fast',function(){$('#cn_see_more_opt_page').slideDown('fast')})}});$('#cn_refuse_code_fields').find('a').on('click',function(e){e.preventDefault();$('#cn_refuse_code_fields').find('a').removeClass('nav-tab-active');$('.refuse-code-tab').removeClass('active');var id=$(this).attr('id').replace('-tab','');$('#'+id).addClass('active');$(this).addClass('nav-tab-active')})});$(document).on('click','input#reset_cookie_notice_options',function(){return confirm(cnArgs.resetToDefaults)})})(jQuery)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/front.js
CHANGED
@@ -419,7 +419,7 @@
|
|
419 |
// Chrome double click event fix
|
420 |
e.stopPropagation();
|
421 |
|
422 |
-
_this.setStatus(
|
423 |
} );
|
424 |
}
|
425 |
|
419 |
// Chrome double click event fix
|
420 |
e.stopPropagation();
|
421 |
|
422 |
+
_this.setStatus( 'reject' );
|
423 |
} );
|
424 |
}
|
425 |
|
js/front.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}
|
1 |
+
!function(){if("function"==typeof window.CustomEvent)return!1;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=window.Event.prototype,window.CustomEvent=e}(),function(){var e=function(e){return new RegExp("(^| )"+e+"( |$)")},t=function(e,t,n){for(var i=0;i<e.length;i++)t.call(n,e[i])};function n(e){this.element=e}n.prototype={add:function(){t(arguments,function(e){this.contains(e)||(this.element.className+=this.element.className.length>0?" "+e:e)},this)},remove:function(){t(arguments,function(t){this.element.className=this.element.className.replace(e(t),"")},this)},toggle:function(e){return this.contains(e)?(this.remove(e),!1):(this.add(e),!0)},contains:function(t){return e(t).test(this.element.className)},replace:function(e,t){this.remove(e),this.add(t)}},"classList"in Element.prototype||Object.defineProperty(Element.prototype,"classList",{get:function(){return new n(this)}}),window.DOMTokenList&&null==DOMTokenList.prototype.replace&&(DOMTokenList.prototype.replace=n.prototype.replace)}(),function(e,t,n){var i=new function(){this.cookiesAccepted=null,this.noticeContainer=null,this.setStatus=function(n){var i=this;"1"===cnArgs.onScroll&&e.removeEventListener("scroll",this.handleScroll);var o=new Date,s=new Date;"accept"===n?(n="true",s.setTime(parseInt(o.getTime())+1e3*parseInt(cnArgs.cookieTime))):(n="false",s.setTime(parseInt(o.getTime())+1e3*parseInt(cnArgs.cookieTimeRejected))),t.cookie=cnArgs.cookieName+"="+n+";expires="+s.toUTCString()+";"+(cnArgs.cookieDomain?"domain="+cnArgs.cookieDomain+";":"")+(cnArgs.cookiePath?"path="+cnArgs.cookiePath+";":"")+("1"===cnArgs.secure?"secure;":""),this.cookiesAccepted="true"===n;var c=new CustomEvent("setCookieNotice",{detail:{value:n,time:o,expires:s,data:cnArgs}});if(t.dispatchEvent(c),this.setBodyClass(["cookies-set","true"===n?"cookies-accepted":"cookies-refused"]),this.hideCookieNotice(),"automatic"===cnArgs.revokeCookiesOpt&&(this.noticeContainer.addEventListener("animationend",function e(){i.noticeContainer.removeEventListener("animationend",e),i.showRevokeNotice()}),this.noticeContainer.addEventListener("webkitAnimationEnd",function e(){i.noticeContainer.removeEventListener("webkitAnimationEnd",e),i.showRevokeNotice()})),"1"===cnArgs.redirection&&("true"===n&&null===this.cookiesAccepted||n!==this.cookiesAccepted&&null!==this.cookiesAccepted)){var a=e.location.protocol+"//",r=e.location.host+"/"+e.location.pathname;"1"===cnArgs.cache?(a=a+r.replace("//","/")+(""===e.location.search?"?":e.location.search+"&")+"cn-reloaded=1"+e.location.hash,e.location.href=a):(a=a+r.replace("//","/")+e.location.search+e.location.hash,e.location.reload(!0))}else;},this.getStatus=function(e){var n=("; "+t.cookie).split("; cookie_notice_accepted=");if(2===n.length){var i=n.pop().split(";").shift();return e?"true"===i:i}return null},this.showCookieNotice=function(){var e=this,n=new CustomEvent("showCookieNotice",{detail:{data:cnArgs}});t.dispatchEvent(n),this.noticeContainer.classList.remove("cookie-notice-hidden"),this.noticeContainer.classList.add("cn-animated"),this.noticeContainer.classList.add("cookie-notice-visible"),this.noticeContainer.addEventListener("animationend",function t(){e.noticeContainer.removeEventListener("animationend",t),e.noticeContainer.classList.remove("cn-animated")}),this.noticeContainer.addEventListener("webkitAnimationEnd",function t(){e.noticeContainer.removeEventListener("webkitAnimationEnd",t),e.noticeContainer.classList.remove("cn-animated")})},this.hideCookieNotice=function(){var e=this,n=new CustomEvent("hideCookieNotice",{detail:{data:cnArgs}});t.dispatchEvent(n),this.noticeContainer.classList.add("cn-animated"),this.noticeContainer.classList.remove("cookie-notice-visible"),this.noticeContainer.addEventListener("animationend",function t(){e.noticeContainer.removeEventListener("animationend",t),e.noticeContainer.classList.remove("cn-animated"),e.noticeContainer.classList.add("cookie-notice-hidden")}),this.noticeContainer.addEventListener("webkitAnimationEnd",function t(){e.noticeContainer.removeEventListener("webkitAnimationEnd",t),e.noticeContainer.classList.remove("cn-animated"),e.noticeContainer.classList.add("cookie-notice-hidden")})},this.showRevokeNotice=function(){var e=this,n=new CustomEvent("showRevokeNotice",{detail:{data:cnArgs}});t.dispatchEvent(n),this.noticeContainer.classList.remove("cookie-revoke-hidden"),this.noticeContainer.classList.add("cn-animated"),this.noticeContainer.classList.add("cookie-revoke-visible"),this.noticeContainer.addEventListener("animationend",function t(){e.noticeContainer.removeEventListener("animationend",t),e.noticeContainer.classList.remove("cn-animated")}),this.noticeContainer.addEventListener("webkitAnimationEnd",function t(){e.noticeContainer.removeEventListener("webkitAnimationEnd",t),e.noticeContainer.classList.remove("cn-animated")})},this.hideRevokeNotice=function(){var e=this,n=new CustomEvent("hideRevokeNotice",{detail:{data:cnArgs}});t.dispatchEvent(n),this.noticeContainer.classList.add("cn-animated"),this.noticeContainer.classList.remove("cookie-revoke-visible"),this.noticeContainer.addEventListener("animationend",function t(){e.noticeContainer.removeEventListener("animationend",t),e.noticeContainer.classList.remove("cn-animated"),e.noticeContainer.classList.add("cookie-revoke-hidden")}),this.noticeContainer.addEventListener("webkitAnimationEnd",function t(){e.noticeContainer.removeEventListener("webkitAnimationEnd",t),e.noticeContainer.classList.remove("cn-animated"),e.noticeContainer.classList.add("cookie-revoke-hidden")})},this.setBodyClass=function(e){t.body.classList.remove("cookies-revoke"),t.body.classList.remove("cookies-accepted"),t.body.classList.remove("cookies-refused"),t.body.classList.remove("cookies-set"),t.body.classList.remove("cookies-not-set");for(var n=0;n<e.length;n++)t.body.classList.add(e[n])},this.handleScroll=function(){(e.pageYOffset||(t.documentElement||t.body.parentNode||t.body).scrollTop)>parseInt(cnArgs.onScrollOffset)&&this.setStatus("accept")},this.getClosest=function(e,n){for(Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;--n>=0&&t.item(n)!==this;);return n>-1});e&&e!==t;e=e.parentNode)if(e.matches(n))return e;return null},this.init=function(){var n=this;this.cookiesAccepted=this.getStatus(!0),this.noticeContainer=t.getElementById("cookie-notice");var i=t.getElementsByClassName("cn-set-cookie"),o=t.getElementsByClassName("cn-revoke-cookie"),s=t.getElementById("cn-close-notice");this.noticeContainer.classList.add("cn-effect-"+cnArgs.hideEffect),null===this.cookiesAccepted?("1"===cnArgs.onScroll&&e.addEventListener("scroll",function(e){n.handleScroll()}),"1"===cnArgs.onClick&&e.addEventListener("click",function(e){null===n.getClosest(e.target,"#cookie-notice")&&n.setStatus("accept")},!0),this.setBodyClass(["cookies-not-set"]),this.showCookieNotice()):(this.setBodyClass(["cookies-set",!0===this.cookiesAccepted?"cookies-accepted":"cookies-refused"]),"1"===cnArgs.revokeCookies&&"automatic"===cnArgs.revokeCookiesOpt&&this.showRevokeNotice());for(var c=0;c<i.length;c++)i[c].addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),n.setStatus(this.dataset.cookieSet)});"null"!==s&&s.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),n.setStatus("reject")});for(c=0;c<o.length;c++)o[c].addEventListener("click",function(e){e.preventDefault(),n.noticeContainer.classList.contains("cookie-revoke-visible")?(n.hideRevokeNotice(),n.noticeContainer.addEventListener("animationend",function e(){n.noticeContainer.removeEventListener("animationend",e),n.showCookieNotice()}),n.noticeContainer.addEventListener("webkitAnimationEnd",function e(){n.noticeContainer.removeEventListener("webkitAnimationEnd",e),n.showCookieNotice()})):n.noticeContainer.classList.contains("cookie-notice-hidden")&&n.noticeContainer.classList.contains("cookie-revoke-hidden")&&n.showCookieNotice()})}};e.addEventListener("load",function(){i.init()},!1)}(window,document);
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: humanityco
|
|
3 |
Tags: gdpr, ccpa, cookies, consent, compliance
|
4 |
Requires at least: 4.3
|
5 |
Requires PHP: 5.3
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 2.0.
|
8 |
License: MIT License
|
9 |
License URI: http://opensource.org/licenses/MIT
|
10 |
|
@@ -58,6 +58,12 @@ No questions yet.
|
|
58 |
|
59 |
== Changelog ==
|
60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
= 2.0.3 =
|
62 |
* Fix: Cookies accepted function issue when Compliance activated
|
63 |
|
@@ -309,5 +315,8 @@ Initial release
|
|
309 |
|
310 |
== Upgrade Notice ==
|
311 |
|
312 |
-
= 2.0.
|
313 |
-
* Fix:
|
|
|
|
|
|
3 |
Tags: gdpr, ccpa, cookies, consent, compliance
|
4 |
Requires at least: 4.3
|
5 |
Requires PHP: 5.3
|
6 |
+
Tested up to: 5.7.1
|
7 |
+
Stable tag: 2.0.4
|
8 |
License: MIT License
|
9 |
License URI: http://opensource.org/licenses/MIT
|
10 |
|
58 |
|
59 |
== Changelog ==
|
60 |
|
61 |
+
= 2.0.4 =
|
62 |
+
* Fix: Undefined constant HOURS_IN_SECONDS
|
63 |
+
* Fix: Button style none adding CSS classes "cn-set-cookie cn-button"
|
64 |
+
* Tweak: Switched the behavior of close icon from accept to reject
|
65 |
+
* Tweak: Minified frontend and admin js files
|
66 |
+
|
67 |
= 2.0.3 =
|
68 |
* Fix: Cookies accepted function issue when Compliance activated
|
69 |
|
315 |
|
316 |
== Upgrade Notice ==
|
317 |
|
318 |
+
= 2.0.4 =
|
319 |
+
* Fix: Undefined constant HOURS_IN_SECONDS
|
320 |
+
* Fix: Button style none adding CSS classes "cn-set-cookie cn-button"
|
321 |
+
* Tweak: Switched the behavior of close icon from accept to reject
|
322 |
+
* Tweak: Minified frontend and admin js files
|