PluginProbe ʕ •ᴥ•ʔ
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode / 4.2.11
Cookiebot by Usercentrics – Automatic Cookie Banner for GDPR/CCPA & Google Consent Mode v4.2.11
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 / cookiebot-admin-script.js
cookiebot / assets / js / backend Last commit date
gutenberg 3 years ago cookiebot-admin-script.js 3 years ago debug-page.js 3 years ago jquery.tipTip.js 3 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
cookiebot-admin-script.js
79 lines
1 /**
2 * Load init function when the page is ready
3 *
4 * @since 4.2.10
5 */
6 jQuery( document ).ready( cbInit );
7
8 function cbInit() {
9 jQuery( document ).on( 'click', 'tr[data-slug="cookiebot"] .cb-deactivate-action', event => deactivateCookiebot( event ) );
10 jQuery( document ).on( 'click', '#cb-review__close', event => closeSurveyPopup( event ) );
11 jQuery( document ).on( 'submit', '#cb-review__form', event => submitSurveyPopup( event ) );
12 }
13
14 /**
15 * Displays popup form.
16 */
17 function deactivateCookiebot( e ) {
18 e.preventDefault();
19
20 let deactivationLink = e.target.href;
21
22 jQuery( '#cb-review__skip' ).attr( 'href', deactivationLink );
23 jQuery( '.cookiebot-popup-container' ).addClass( 'cb-opened' );
24 }
25
26 /**
27 * Close popup form.
28 */
29
30 function closeSurveyPopup(e) {
31 const popup = jQuery(e.target).closest('.cookiebot-popup-container');
32 popup.removeClass('cb-opened');
33 jQuery('#cb-review__alert').removeClass('show-alert');
34 document.getElementById('cb-review__form').reset();
35 }
36
37 /**
38 * Popup submit
39 */
40 function submitSurveyPopup(e){
41 e.preventDefault();
42 const deactivateLink = jQuery( '#cb-review__skip' ).attr( 'href' );
43 const button = jQuery('#cb-review__submit', '#cb-review__form');
44 if (button.hasClass('disabled')) {
45 return;
46 }
47 const option = jQuery('input[type="radio"]:checked', '#cb-review__form');
48 if(0 === option.length){
49 jQuery('#cb-review__alert').addClass('show-alert');
50 return;
51 }
52 const otherReason = jQuery('#cb-review__other-description');
53 jQuery.ajax({
54 url: cb_ajax.ajax_url,
55 type: 'POST',
56 data: {
57 action: 'cb_submit_survey',
58 reason_id: (0 === option.length) ? null : option.val(),
59 reason_text: (0 === option.length) ? 'none' : option.closest('label').text(),
60 reason_info: (0 !== otherReason.length) ? otherReason.val().trim() : '',
61 survey_nonce: cb_ajax.survey_nonce,
62 survey_check: 'ODUwODA1'
63 },
64 beforeSend: function() {
65 button.addClass('disabled');
66 },
67 complete: function(response) {
68 const code = JSON.parse(response.responseText).code;
69 const msg = JSON.parse(response.responseText).data;
70
71 if(code===400||code===401){
72 jQuery('#cb-review__alert').text(msg).addClass('show-alert');
73 button.removeClass('disabled');
74 }else{
75 window.location.href = deactivateLink;
76 }
77 }
78 });
79 }