Version Description
- Fixed: syntax error in class-ctcc-public.php
Download this release
Release Info
Developer | Catapult_Themes |
Plugin | Cookie Consent |
Version | 2.0.11 |
Comparing to | |
See all releases |
Code changes from version 2.0.10 to 2.0.11
- public/class-ctcc-public.php +76 -83
- readme.txt +4 -2
- uk-cookie-consent.php +1 -1
public/class-ctcc-public.php
CHANGED
@@ -24,7 +24,7 @@ if ( ! class_exists( 'CTCC_Public' ) ) { // Don't initialise if there's already
|
|
24 |
public function enqueue_scripts() {
|
25 |
$ctcc_options_settings = get_option ( 'ctcc_options_settings' );
|
26 |
$options = get_option ( 'ctcc_styles_settings' );
|
27 |
-
if ( $options['enqueue_styles'] ) {
|
28 |
wp_enqueue_style ( 'cookie-consent-style', CTCC_PLUGIN_URL . 'assets/css/style.css', '2.0.0' );
|
29 |
}
|
30 |
wp_enqueue_script ( 'cookie-consent', CTCC_PLUGIN_URL . 'assets/js/uk-cookie-consent-js.js', array ( 'jquery' ), '2.0.0', true );
|
@@ -44,44 +44,42 @@ if ( ! class_exists( 'CTCC_Public' ) ) { // Don't initialise if there's already
|
|
44 |
* @since 2.0.0
|
45 |
*/
|
46 |
public function add_css() {
|
47 |
-
|
48 |
-
$
|
49 |
-
$
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
top: 0;
|
54 |
-
width: 100%;';
|
55 |
// Figure out the bar position
|
56 |
if ( $ctcc_styles_settings['position'] == 'top-bar' ) {
|
57 |
-
$position_css = 'position: fixed;
|
58 |
-
left: 0;
|
59 |
-
top: 0;
|
60 |
width: 100%;';
|
61 |
} else if ( $ctcc_styles_settings['position'] == 'bottom-bar' ) {
|
62 |
-
$position_css = 'position: fixed;
|
63 |
-
left: 0;
|
64 |
-
bottom: 0;
|
65 |
width: 100%;';
|
66 |
} else if ( $ctcc_styles_settings['position'] == 'top-right-block' ) {
|
67 |
-
$position_css = 'position: fixed;
|
68 |
-
right: 20px;
|
69 |
-
top: 6%;
|
70 |
width: 300px;';
|
71 |
} else if ( $ctcc_styles_settings['position'] == 'top-left-block' ) {
|
72 |
-
$position_css = 'position: fixed;
|
73 |
-
left: 20px;
|
74 |
-
top: 6%;
|
75 |
width: 300px;';
|
76 |
} else if ( $ctcc_styles_settings['position'] == 'bottom-left-block' ) {
|
77 |
-
$position_css = 'position: fixed;
|
78 |
-
left: 20px;
|
79 |
-
bottom: 6%;
|
80 |
width: 300px;';
|
81 |
} else if ( $ctcc_styles_settings['position'] == 'bottom-right-block' ) {
|
82 |
-
$position_css = 'position: fixed;
|
83 |
-
right: 20px;
|
84 |
-
bottom: 6%;
|
85 |
width: 300px;';
|
86 |
}
|
87 |
// Get our styles
|
@@ -98,40 +96,36 @@ if ( ! class_exists( 'CTCC_Public' ) ) { // Don't initialise if there's already
|
|
98 |
}
|
99 |
// Build our CSS
|
100 |
$css = '<style id="ctcc-css" type="text/css" media="screen">';
|
101 |
-
$css .= '
|
102 |
-
#catapult-cookie-bar {
|
103 |
-
box-sizing: border-box;
|
104 |
-
max-height: 0;
|
105 |
-
opacity: 0;
|
106 |
-
z-index: 99999;
|
107 |
-
overflow: hidden;
|
108 |
-
color: ' . $text_color . ';
|
109 |
-
' . $position_css . '
|
110 |
-
background-color: ' . $bg_color . ';
|
111 |
-
}
|
112 |
-
#catapult-cookie-bar a {
|
113 |
-
color: ' . $link_color . ';
|
114 |
-
}
|
115 |
-
button#catapultCookie {
|
116 |
-
background:' . $button_bg . ';
|
117 |
-
color: ' . $button_color . ';
|
118 |
-
' . $button_style . '
|
119 |
-
}
|
120 |
-
#catapult-cookie-bar h3 {
|
121 |
-
color: ' . $text_color . ';
|
122 |
-
}
|
123 |
-
.has-cookie-bar #catapult-cookie-bar {
|
124 |
-
opacity: 1;
|
125 |
-
max-height: 999px;
|
126 |
-
min-height: 30px;
|
127 |
}';
|
128 |
-
|
129 |
$css .= '</style>';
|
130 |
-
|
131 |
echo $css;
|
132 |
-
|
133 |
// Add it to the header
|
134 |
-
|
135 |
}
|
136 |
|
137 |
/*
|
@@ -153,34 +147,33 @@ if ( ! class_exists( 'CTCC_Public' ) ) { // Don't initialise if there's already
|
|
153 |
jQuery(document).ready(function($){
|
154 |
<?php if ( isset ( $_GET['cookie'] ) ) { ?>
|
155 |
catapultDeleteCookie('catAccCookies');
|
156 |
-
<?php } ?>
|
157 |
-
if(!catapultReadCookie("catAccCookies")){ // If the cookie has not been set then show the bar
|
158 |
-
$("html").addClass("has-cookie-bar");
|
159 |
-
$("html").addClass("cookie-bar-<?php echo $ctcc_styles_settings['position']; ?>");
|
160 |
-
$("html").addClass("cookie-bar-<?php echo $type; ?>");
|
161 |
-
<?php // Move the HTML down if the bar is at the top
|
162 |
-
if ( $ctcc_styles_settings['position'] == 'top-bar' ) {
|
163 |
-
?>
|
164 |
-
// Wait for the animation on the html to end before recalculating the required top margin
|
165 |
-
$("html").on('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(e) {
|
166 |
-
// code to execute after transition ends
|
167 |
-
var barHeight = $('#catapult-cookie-bar').outerHeight();
|
168 |
-
$("html").css("margin-top",barHeight);
|
169 |
-
$("body.admin-bar").css("margin-top",barHeight-32); // Push the body down if the admin bar is active
|
170 |
-
});
|
171 |
-
<?php } ?>
|
172 |
}
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
setTimeout(ctccCloseNotification, <?php echo $duration; ?>);
|
178 |
-
<?php } ?>
|
179 |
-
<?php if ( ! empty ( $options['first_page'] ) ) {
|
180 |
-
// Add some script if the notification only displays on the first page ?>
|
181 |
-
ctccFirstPage();
|
182 |
<?php } ?>
|
183 |
-
|
|
|
|
|
|
|
|
|
184 |
</script>
|
185 |
|
186 |
<?php }
|
24 |
public function enqueue_scripts() {
|
25 |
$ctcc_options_settings = get_option ( 'ctcc_options_settings' );
|
26 |
$options = get_option ( 'ctcc_styles_settings' );
|
27 |
+
if ( isset ( $options['enqueue_styles'] ) ) {
|
28 |
wp_enqueue_style ( 'cookie-consent-style', CTCC_PLUGIN_URL . 'assets/css/style.css', '2.0.0' );
|
29 |
}
|
30 |
wp_enqueue_script ( 'cookie-consent', CTCC_PLUGIN_URL . 'assets/js/uk-cookie-consent-js.js', array ( 'jquery' ), '2.0.0', true );
|
44 |
* @since 2.0.0
|
45 |
*/
|
46 |
public function add_css() {
|
47 |
+
$options = get_option ( 'ctcc_options_settings' );
|
48 |
+
$ctcc_styles_settings = get_option ( 'ctcc_styles_settings' );
|
49 |
+
$position_css = 'position: fixed;
|
50 |
+
left: 0;
|
51 |
+
top: 0;
|
52 |
+
width: 100%;';
|
|
|
|
|
53 |
// Figure out the bar position
|
54 |
if ( $ctcc_styles_settings['position'] == 'top-bar' ) {
|
55 |
+
$position_css = 'position: fixed;
|
56 |
+
left: 0;
|
57 |
+
top: 0;
|
58 |
width: 100%;';
|
59 |
} else if ( $ctcc_styles_settings['position'] == 'bottom-bar' ) {
|
60 |
+
$position_css = 'position: fixed;
|
61 |
+
left: 0;
|
62 |
+
bottom: 0;
|
63 |
width: 100%;';
|
64 |
} else if ( $ctcc_styles_settings['position'] == 'top-right-block' ) {
|
65 |
+
$position_css = 'position: fixed;
|
66 |
+
right: 20px;
|
67 |
+
top: 6%;
|
68 |
width: 300px;';
|
69 |
} else if ( $ctcc_styles_settings['position'] == 'top-left-block' ) {
|
70 |
+
$position_css = 'position: fixed;
|
71 |
+
left: 20px;
|
72 |
+
top: 6%;
|
73 |
width: 300px;';
|
74 |
} else if ( $ctcc_styles_settings['position'] == 'bottom-left-block' ) {
|
75 |
+
$position_css = 'position: fixed;
|
76 |
+
left: 20px;
|
77 |
+
bottom: 6%;
|
78 |
width: 300px;';
|
79 |
} else if ( $ctcc_styles_settings['position'] == 'bottom-right-block' ) {
|
80 |
+
$position_css = 'position: fixed;
|
81 |
+
right: 20px;
|
82 |
+
bottom: 6%;
|
83 |
width: 300px;';
|
84 |
}
|
85 |
// Get our styles
|
96 |
}
|
97 |
// Build our CSS
|
98 |
$css = '<style id="ctcc-css" type="text/css" media="screen">';
|
99 |
+
$css .= '
|
100 |
+
#catapult-cookie-bar {
|
101 |
+
box-sizing: border-box;
|
102 |
+
max-height: 0;
|
103 |
+
opacity: 0;
|
104 |
+
z-index: 99999;
|
105 |
+
overflow: hidden;
|
106 |
+
color: ' . $text_color . ';
|
107 |
+
' . $position_css . '
|
108 |
+
background-color: ' . $bg_color . ';
|
109 |
+
}
|
110 |
+
#catapult-cookie-bar a {
|
111 |
+
color: ' . $link_color . ';
|
112 |
+
}
|
113 |
+
button#catapultCookie {
|
114 |
+
background:' . $button_bg . ';
|
115 |
+
color: ' . $button_color . ';
|
116 |
+
' . $button_style . '
|
117 |
+
}
|
118 |
+
#catapult-cookie-bar h3 {
|
119 |
+
color: ' . $text_color . ';
|
120 |
+
}
|
121 |
+
.has-cookie-bar #catapult-cookie-bar {
|
122 |
+
opacity: 1;
|
123 |
+
max-height: 999px;
|
124 |
+
min-height: 30px;
|
125 |
}';
|
|
|
126 |
$css .= '</style>';
|
|
|
127 |
echo $css;
|
|
|
128 |
// Add it to the header
|
|
|
129 |
}
|
130 |
|
131 |
/*
|
147 |
jQuery(document).ready(function($){
|
148 |
<?php if ( isset ( $_GET['cookie'] ) ) { ?>
|
149 |
catapultDeleteCookie('catAccCookies');
|
150 |
+
<?php } ?>
|
151 |
+
if(!catapultReadCookie("catAccCookies")){ // If the cookie has not been set then show the bar
|
152 |
+
$("html").addClass("has-cookie-bar");
|
153 |
+
$("html").addClass("cookie-bar-<?php echo $ctcc_styles_settings['position']; ?>");
|
154 |
+
$("html").addClass("cookie-bar-<?php echo $type; ?>");
|
155 |
+
<?php // Move the HTML down if the bar is at the top
|
156 |
+
if ( $ctcc_styles_settings['position'] == 'top-bar' ) {
|
157 |
+
?>
|
158 |
+
// Wait for the animation on the html to end before recalculating the required top margin
|
159 |
+
$("html").on('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(e) {
|
160 |
+
// code to execute after transition ends
|
161 |
+
var barHeight = $('#catapult-cookie-bar').outerHeight();
|
162 |
+
$("html").css("margin-top",barHeight);
|
163 |
+
$("body.admin-bar").css("margin-top",barHeight-32); // Push the body down if the admin bar is active
|
164 |
+
});
|
165 |
+
<?php } ?>
|
166 |
}
|
167 |
+
<?php if ( $options['closure'] == 'timed' ) {
|
168 |
+
// Add some script if it's on a timer
|
169 |
+
$duration = absint($options['duration']) * 1000; ?>
|
170 |
+
setTimeout(ctccCloseNotification, <?php echo $duration; ?>);
|
|
|
|
|
|
|
|
|
|
|
171 |
<?php } ?>
|
172 |
+
<?php if ( ! empty ( $options['first_page'] ) ) {
|
173 |
+
// Add some script if the notification only displays on the first page ?>
|
174 |
+
ctccFirstPage();
|
175 |
+
<?php } ?>
|
176 |
+
});
|
177 |
</script>
|
178 |
|
179 |
<?php }
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: Catapult_Themes, husobj, jraczynski
|
|
3 |
Donate Link: https://paypal.com
|
4 |
Tags: cookie law, cookies, EU, implied consent, uk cookie consent, compliance, eu cookie law, eu privacy directive, privacy, privacy directive, consent, cookie, cookie compliance, cookie law, eu cookie, notice, notification, notify, cookie notice, cookie notification, cookie notify
|
5 |
Requires at least: 4.3
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
The only cookie consent plugin you'll ever need.
|
@@ -54,6 +54,8 @@ You will find more details of the regulations on the [Information Commissioner's
|
|
54 |
4. Customization panel
|
55 |
5. Example settings page
|
56 |
== Changelog ==
|
|
|
|
|
57 |
= 2.0.10 =
|
58 |
* Added: priority on add_js
|
59 |
= 2.0.9 =
|
3 |
Donate Link: https://paypal.com
|
4 |
Tags: cookie law, cookies, EU, implied consent, uk cookie consent, compliance, eu cookie law, eu privacy directive, privacy, privacy directive, consent, cookie, cookie compliance, cookie law, eu cookie, notice, notification, notify, cookie notice, cookie notification, cookie notify
|
5 |
Requires at least: 4.3
|
6 |
+
Tested up to: 4.5.1
|
7 |
+
Stable tag: 2.0.11
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
The only cookie consent plugin you'll ever need.
|
54 |
4. Customization panel
|
55 |
5. Example settings page
|
56 |
== Changelog ==
|
57 |
+
= 2.0.11 =
|
58 |
+
* Fixed: syntax error in class-ctcc-public.php
|
59 |
= 2.0.10 =
|
60 |
* Added: priority on add_js
|
61 |
= 2.0.9 =
|
uk-cookie-consent.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Cookie Consent
|
4 |
Plugin URI: http://catapultthemes.com/cookie-consent/
|
5 |
Description: The only cookie consent plugin you'll ever need.
|
6 |
-
Version: 2.0.
|
7 |
Author: Catapult_Themes
|
8 |
Author URI: http://catapultthemes.com/
|
9 |
Text Domain: uk-cookie-consent
|
3 |
Plugin Name: Cookie Consent
|
4 |
Plugin URI: http://catapultthemes.com/cookie-consent/
|
5 |
Description: The only cookie consent plugin you'll ever need.
|
6 |
+
Version: 2.0.11
|
7 |
Author: Catapult_Themes
|
8 |
Author URI: http://catapultthemes.com/
|
9 |
Text Domain: uk-cookie-consent
|