summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2018-06-08 10:09:24 -0400
committerAnthony G. Basile <blueness@gentoo.org>2018-06-08 10:09:24 -0400
commita6b006c0f1ef757f23375f7906193370337d8bd7 (patch)
tree4467c6423b2c54e6ef8c3e79241a833fb17833a5 /plugins/jetpack/modules/widgets/eu-cookie-law/eu-cookie-law.js
parentUpdate akismet 4.0.7 (diff)
downloadblogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.tar.gz
blogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.tar.bz2
blogs-gentoo-a6b006c0f1ef757f23375f7906193370337d8bd7.zip
Update jetpack 6.2
Diffstat (limited to 'plugins/jetpack/modules/widgets/eu-cookie-law/eu-cookie-law.js')
-rw-r--r--plugins/jetpack/modules/widgets/eu-cookie-law/eu-cookie-law.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/plugins/jetpack/modules/widgets/eu-cookie-law/eu-cookie-law.js b/plugins/jetpack/modules/widgets/eu-cookie-law/eu-cookie-law.js
index 18ed69c5..b7f8c7db 100644
--- a/plugins/jetpack/modules/widgets/eu-cookie-law/eu-cookie-law.js
+++ b/plugins/jetpack/modules/widgets/eu-cookie-law/eu-cookie-law.js
@@ -4,7 +4,16 @@
initialScrollPosition,
scrollFunction;
- if ( '' !== cookieValue ) {
+ if ( overlay.hasClass( 'top' ) ) {
+ $( '.widget_eu_cookie_law_widget' ).addClass( 'top' );
+ }
+
+ if ( overlay.hasClass( 'ads-active' ) ) {
+ var adsCookieValue = document.cookie.replace( /(?:(?:^|.*;\s*)personalized-ads-consent\s*\=\s*([^;]*).*$)|^.*$/, '$1' );
+ if ( '' !== cookieValue && '' !== adsCookieValue ) {
+ overlay.remove();
+ }
+ } else if ( '' !== cookieValue ) {
overlay.remove();
}
@@ -40,9 +49,12 @@
}
var expireTime = new Date();
- expireTime.setTime( expireTime.getTime() + 2592000000 ); // 30 days
+ expireTime.setTime( expireTime.getTime() + ( overlay.data( 'consent-expiration' ) * 24 * 60 * 60 * 1000 ) );
document.cookie = 'eucookielaw=' + expireTime.getTime() + ';path=/;expires=' + expireTime.toGMTString();
+ if ( overlay.hasClass( 'ads-active' ) && overlay.hasClass( 'hide-on-button' ) ) {
+ document.cookie = 'personalized-ads-consent=' + expireTime.getTime() + ';path=/;expires=' + expireTime.toGMTString();
+ }
overlay.fadeOut( 400, function() {
overlay.remove();