PluginProbe ʕ •ᴥ•ʔ
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode / 4.2.2
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode v4.2.2
4.7.2 4.7.1 trunk 2.3.0 2.4.0 2.4.1 2.4.2 2.5.0 3.0.0 3.0.1 3.1.0 3.10.0 3.10.1 3.11.1 3.11.2 3.11.3 3.2.0 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.5 3.6.6 3.7.0 3.7.1 3.8.0 3.9.0 4.0.0 4.0.1 4.0.2 4.0.3 4.1.0 4.1.1 4.2.0 4.2.1 4.2.10 4.2.11 4.2.12 4.2.13 4.2.14 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 4.3.0 4.3.1 4.3.10 4.3.11 4.3.12 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.7.1 4.3.8 4.3.9 4.3.9.1 4.4.0 4.4.1 4.4.2 4.5.0 4.5.1 4.5.10 4.5.11 4.5.2 4.5.3 4.5.4 4.5.5 4.5.6 4.5.7 4.5.8 4.5.9 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.6.7 4.7.0
cookiebot / assets / js / backend / settings-page.js
cookiebot / assets / js / backend Last commit date
gutenberg 4 years ago debug-page.js 4 years ago jquery.tipTip.js 4 years ago multiple-page.js 3 years ago network-settings-page.js 3 years ago prior-consent-settings.js 3 years ago settings-page.js 3 years ago support-page.js 3 years ago
settings-page.js
114 lines
1 /**
2 * Load init function when the page is ready
3 *
4 * @since 1.8.0
5 */
6 jQuery( document ).ready( init );
7
8 function init() {
9 language_toggle();
10 advanced_settings_toggle();
11 cookie_blocking_mode();
12 activeSettingsTab();
13 closeSubmitMsg();
14 submitEnable();
15 }
16
17 function language_toggle() {
18 jQuery( '#show_add_language_guide' ).on( 'click', function ( e ) {
19 e.preventDefault()
20 jQuery( '#add_language_guide' ).slideDown()
21 jQuery( this ).hide()
22 } )
23 jQuery( '#hide_add_language_guide' ).on( 'click', function ( e ) {
24 e.preventDefault()
25 jQuery( '#add_language_guide' ).slideUp()
26 jQuery( '#show_add_language_guide' ).show()
27 } )
28
29 jQuery( '#cookiebot-language' ).on( 'change', function () {
30 if ( this.value === '' ) {
31 jQuery( '#info_lang_autodetect' ).show()
32 jQuery( '#info_lang_specified' ).hide()
33 } else {
34 jQuery( '#info_lang_autodetect' ).hide()
35 jQuery( '#info_lang_specified' ).show()
36 }
37 } )
38 }
39
40 function advanced_settings_toggle() {
41 jQuery( '.cookiebot_fieldset_header' ).on( 'click', function ( e ) {
42 e.preventDefault()
43 jQuery( this ).next().slideToggle()
44 jQuery( this ).toggleClass( 'active' )
45 } )
46 }
47
48 function resetConsentMapping() {
49 if ( confirm( 'Are you sure you want to reset to default consent mapping?' ) ) {
50 jQuery( '.consent_mapping_table input[type=checkbox]' ).each( function () {
51 if ( !this.disabled ) {
52 this.checked = ( jQuery( this ).data( 'default-value' ) === '1' )
53 }
54 } )
55 }
56 return false
57 }
58
59 function cookie_blocking_mode() {
60 var cookieBlockingMode = cookiebot_settings.cookieBlockingMode;
61
62 jQuery( 'input[type=radio][name=cookiebot-cookie-blocking-mode]' ).on( 'change', function () {
63 if ( this.value === 'auto' && cookieBlockingMode !== this.value ) {
64 jQuery( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 0.4 );
65 jQuery( '#declaration-tag, #cookie-popup').addClass('disabled__item');
66 jQuery( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', true )
67 }
68 if ( this.value === 'manual' && cookieBlockingMode !== this.value ) {
69 jQuery( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 1 );
70 jQuery( '#declaration-tag, #cookie-popup').removeClass('disabled__item');
71 jQuery( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', false )
72 }
73 cookieBlockingMode = this.value
74 } )
75 if ( cookieBlockingMode === 'auto' ) {
76 jQuery( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 0.4 )
77 jQuery( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', true )
78 }
79 }
80
81 function activeSettingsTab() {
82 jQuery('.cb-settings__tabs__item').on('click', function(){
83 let currentTab = jQuery('.cb-settings__tabs__item.active-item').data('tab');
84 let tab = jQuery(this).data('tab');
85 let tabSelector = '#'+tab;
86 jQuery('.cb-settings__tabs__item.active-item, .cb-settings__tabs__content--item.active-item').removeClass('active-item');
87 jQuery(this).addClass('active-item');
88 jQuery(tabSelector).addClass('active-item');
89
90 window.history.replaceState(null, null, '?page=cookiebot_settings&tab='+tab );
91 let referrer = jQuery('input[name="_wp_http_referer"]');
92 let referrerVal = referrer.val();
93 if(referrerVal.indexOf('tab=')!==-1) {
94 referrerVal = referrerVal.replace(currentTab,tab);
95 }else{
96 referrerVal += '&tab=' + tab;
97 }
98 referrer.val(referrerVal);
99 });
100 }
101
102 function closeSubmitMsg() {
103 jQuery('.cb-submit__msg').on('click',function(){
104 jQuery(this).addClass('hidden');
105 });
106 }
107
108 function submitEnable() {
109 jQuery(':input').change(
110 function(){
111 jQuery('p.submit #submit').addClass('enabled');
112 }
113 );
114 }