1(function ($, Drupal, once) { 2 'use strict'; 3 4 Drupal.behaviors.NoneHcp = { 5 attach: function (context, settings) { 6 const cookieName = 'hcp-status'; 7 $(once('none-hcp', 'body')).each(function() { 8 let HcpModal = $('#hcp-modal'); 9 // If 10 if (!getHcpStatus() && HcpModal.length > 0) { 11 let hcp_container = $('.hcp_popup--is-hcp', HcpModal); 12 let none_hcp_container = $('.hcp_popup--none-hcp', HcpModal); 13 $('body').addClass('none-hcp'); 14 HcpModal.attr('hidden', null); 15 $(once('hcp-accept', '.hcp-yes', HcpModal[0])).click(function() { 16 setHcpStatus(true); 17 $('body').removeClass('none-hcp'); 18 document.getElementById('hcp-modal').hidden = true; 19 }); 20 $(once('hcp-no', '.hcp-no', HcpModal[0])).click(function() { 21 hcp_container.hide(); 22 none_hcp_container.show(); 23 }); 24 $(once('hcp-back', '.hcp-back', HcpModal[0])).click(function() { 25 none_hcp_container.hide(); 26 hcp_container.show(); 27 }); 28 } 29 30 }); 31 32 function getHcpStatus() { 33 return Cookies.get(cookieName); 34 } 35 36 function setHcpStatus(status) { 37 Cookies.set(cookieName, status, { expires: 60 }); 38 } 39 40 } 41 }; 42 43}) (jQuery, Drupal, once);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.