PluginProbe ʕ •ᴥ•ʔ
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode / trunk
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode vtrunk
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 / network-settings-page.js
cookiebot / assets / js / backend Last commit date
gutenberg 3 weeks ago account-static.js 11 months ago account.js 11 months ago amplitude.js 1 year ago consent-mapping.js 1 year ago cookiebot-admin-script.js 6 months ago dashboard.js 1 year ago jquery.tipTip.js 3 years ago multiple-page.js 3 years ago network-settings-page.js 5 months ago ppg-page.js 4 months ago prior-consent-settings.js 3 years ago settings-page.js 5 months ago support-page.js 1 year ago
network-settings-page.js
132 lines
1 jQuery( document ).ready( function ( $ ) {
2 let cookieBlockingMode = cookiebotNetworkSettings.cbm
3 $( 'input[type=radio][name=cookiebot-cookie-blocking-mode]' ).on( 'change', function () {
4 if ( this.value === 'auto' && cookieBlockingMode !== this.value ) {
5 $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 0.4 )
6 $( '#declaration-tag').addClass('disabled__item');
7 $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', true )
8 }
9 if ( this.value === 'manual' && cookieBlockingMode !== this.value ) {
10 $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 1 )
11 $( '#declaration-tag, #cookie-popup').removeClass('disabled__item');
12 $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', false )
13 }
14 cookieBlockingMode = this.value
15 } )
16 if ( cookieBlockingMode === 'auto' ) {
17 $( '#cookiebot-setting-async, #cookiebot-setting-hide-popup' ).css( 'opacity', 0.4 )
18 $( 'input[type=radio][name=cookiebot-script-tag-uc-attribute], input[name=cookiebot-nooutput]' ).prop( 'disabled', true )
19 }
20
21 jQuery('.cb-submit__msg').on('click',function(){
22 jQuery(this).addClass('hidden');
23 });
24
25 const initialValues = jQuery('form').serialize();
26 const events = {
27 change: 'input:not([type=text]), select',
28 input: 'input[type="text"], textarea'
29 };
30
31 Object.entries(events).forEach(entry => {
32 const [eventName, elements] = entry;
33 jQuery(document).on(eventName,elements,{initialValues: initialValues},function(event){
34 checkValues(event.data.initialValues)
35 });
36 });
37
38 ruleset_id();
39 remove_account();
40 } )
41
42 function check_id_frame(){
43 const cbFrameReg = /[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/;
44 return cbFrameReg.test(jQuery( '#cookiebot-cbid' ).val())
45 }
46
47 function ruleset_id(){
48 const cbidField = jQuery( '#cookiebot-cbid' );
49 const cbidCheck = jQuery( '.cookiebot-cbid-check' );
50 let fieldTimer;
51 let fieldInterval = 3000;
52
53 cbidField.on('keyup', function () {
54 clearTimeout(fieldTimer);
55 cbidField.addClass('check-progress');
56 cbidCheck.removeClass('check-pass').addClass('check-progress');
57 fieldTimer = setTimeout(show_ruleset_selector, fieldInterval);
58 });
59
60 cbidField.on('keydown', function () {
61 clearTimeout(fieldTimer);
62 });
63 }
64 function show_ruleset_selector() {
65 const cbidField = jQuery( '#cookiebot-cbid' );
66 const cbidCheck = jQuery( '.cookiebot-cbid-check' );
67 const cbidRulesetSelector = jQuery('#cookiebot-ruleset-id-selector');
68 const cbidSubmit = jQuery('.cookiebot-cbid-container p.submit #submit');
69 const cbidError = jQuery('.cookiebot-cbid-error');
70
71 cbidCheck.removeClass('check-progress');
72 cbidField.removeClass('check-progress');
73
74 if(!cbidField.val()){
75 cbidCheck.removeClass('check-pass');
76 cbidRulesetSelector.addClass('hidden');
77 cbidSubmit.addClass('disabled');
78 cbidError.addClass('hidden');
79 return;
80 }
81
82 // Validate that the field has exactly 9, 14 or 36 characters
83 const fieldLength = cbidField.val().length;
84 if(fieldLength !== 9 && fieldLength !== 14 && fieldLength !== 36){
85 cbidCheck.removeClass('check-pass');
86 cbidRulesetSelector.addClass('hidden');
87 cbidSubmit.addClass('disabled');
88 cbidError.removeClass('hidden');
89 return;
90 }
91
92 // Valid input - hide error message
93 cbidError.addClass('hidden');
94
95 !check_id_frame() ? cbidRulesetSelector.removeClass('hidden') : cbidRulesetSelector.addClass('hidden');
96
97 cbidSubmit.removeClass('disabled');
98 }
99
100 function remove_account(){
101 const removeCta = jQuery('#cookiebot-cbid-reset-dialog');
102 const cbidAlert = jQuery('.cb-cbid-alert__msg');
103 const confirmCta = jQuery('#cookiebot-cbid-reset');
104 const cancelCta = jQuery('#cookiebot-cbid-cancel');
105 removeCta.on('click', function(){
106 cbidAlert.removeClass('hidden');
107 removeCta.addClass('disabled');
108 });
109 confirmCta.on('click', function(){
110 jQuery('#cookiebot-cbid').val('').removeClass('cbid-active');
111
112 // If the account was disconnected set blocking mode to 'auto' and 'Hide cookie popup' to false.
113 jQuery('input[type=radio][name=cookiebot-cookie-blocking-mode][value=auto]').prop('checked', true);
114 jQuery('input[name=cookiebot-nooutput]').prop( 'checked', false )
115
116 jQuery('.cb-settings__header p.submit #submit').click();
117 });
118 cancelCta.on('click', function(){
119 cbidAlert.addClass('hidden');
120 removeCta.removeClass('disabled');
121 });
122 }
123
124 function checkValues(initialValues){
125 let submitBtn = jQuery('p.submit #submit');
126 let newValues = jQuery('form').serialize();
127 if(newValues !== initialValues) {
128 submitBtn.addClass('enabled');
129 }else{
130 submitBtn.removeClass('enabled');
131 }
132 }