PageSourceSearch

https://www.bonusfinder.com/wp-content/cache/min/1/wp-content/them…/js/social_share.js?ver=1790938179

js bonusfinder.com collected 2026-10-03 21:31:31 UTC 5,862 bytes, 25 lines download raw bytes

1class SocialShare{constructor(){this.socialShareOpenInit();this.socialShareCloseInit();this.copyToClipboardInit();this.shareLinksInit()}
2socialShareCloseInit=()=>{if(document.querySelector('#close_share_container_buttons')){const close_share_container_buttons=document.querySelector('#close_share_container_buttons')
3if(document.querySelector('.share_container_button')&&document.querySelector('.share_container ')){const share_container=document.querySelector('.share_container');const share_container_button=document.querySelector('.share_container_button');close_share_container_buttons.addEventListener('click',()=>{this.pushDataLayerEvent('share_menu_close');share_container.classList.remove('opened');share_container_button.dataset.opened='0';share_container_button.classList.remove('no_visible');if(document.querySelector('.share_container_buttons')){const share_container_buttons=document.querySelector('.share_container_buttons');share_container_buttons.classList.add('no_visible')}
4share_container_button.focus();share_container_button.setAttribute('aria-expanded',"false");this.setTabIndexHelper('-1')
5share_container_button.focus();if(document.querySelector('.share_container_buttons_list_copied')){const share_container_buttons_list_copied=document.querySelector('.share_container_buttons_list_copied')
6if(!share_container_buttons_list_copied.classList.contains('hidden')){share_container_buttons_list_copied.classList.add('hidden')}}})
7document.addEventListener('keydown',(e)=>{if(e.key==='Escape'&&share_container.classList.contains('opened')){close_share_container_buttons.click()}})}}}
8socialShareOpenInit=()=>{if(document.querySelector('.share_container_button')&&document.querySelector('.share_container ')){const share_container=document.querySelector('.share_container');const share_container_button=document.querySelector('.share_container_button');share_container_button.addEventListener('click',()=>{if(share_container_button.dataset.opened==='0'){share_container.classList.add('opened');share_container_button.dataset.opened='1';share_container_button.classList.add('no_visible');if(document.querySelector('.share_container_buttons')){const share_container_buttons=document.querySelector('.share_container_buttons');share_container_buttons.classList.remove('no_visible')}
9if(document.querySelector('.share_container_buttons_close')){document.querySelector('.share_container_buttons_close').focus()}
10share_container_button.setAttribute('aria-expanded',"true");this.setTabIndexHelper('0')
11this.pushDataLayerEvent('share_menu_open')}})}};setTabIndexHelper=(value)=>{if(document.querySelector('.share_container_buttons_close')&&document.querySelector('.share_container_buttons_list .copy')&&document.querySelector('.share_container_buttons_list .email')&&document.querySelector('.share_container_buttons_list .facebook')&&document.querySelector('.share_container_buttons_list .x')){}
12const close=document.querySelector('.share_container_buttons_close');const copy=document.querySelector('.share_container_buttons_list .copy');const email=document.querySelector('.share_container_buttons_list .email');const facebook=document.querySelector('.share_container_buttons_list .facebook');const x=document.querySelector('.share_container_buttons_list .x');const shareItems=[close,copy,email,facebook,x];shareItems.forEach(el=>{if(el){el.setAttribute('tabindex',value)}});if(document.querySelector('.share_container_button')){const share_container_button=document.querySelector('.share_container_button')
13share_container_button.setAttribute('tabindex',value==="0"?"-1":"0")}}
14copyToClipboardInit=()=>{if(document.querySelector('.share_container_buttons_list .copy')){const copy=document.querySelector('.share_container_buttons_list .copy')
15copy.addEventListener('click',()=>{const text=copy.dataset.text
16this.copyToClipboard(text).then(()=>{this.pushDataLayerEvent('share','copy_link');if(document.querySelector('.share_container_buttons_list_copied')){const share_container_buttons_list_copied=document.querySelector('.share_container_buttons_list_copied')
17share_container_buttons_list_copied.classList.remove('hidden')
18setTimeout(()=>{share_container_buttons_list_copied.classList.add('hidden')},5000)}})})}}
19copyToClipboard=(text)=>{if(navigator.clipboard&&window.isSecureContext){return navigator.clipboard.writeText(text).catch(err=>{console.error('Failed to copy text: ',err)})}else{const textArea=document.createElement("textarea");textArea.value=text;textArea.style.position="fixed";textArea.style.top=0;textArea.style.left=0;textArea.style.width='2em';textArea.style.height='2em';textArea.style.padding=0;textArea.style.border='none';textArea.style.outline='none';textArea.style.boxShadow='none';textArea.style.background='transparent';document.body.appendChild(textArea);textArea.focus();textArea.select();try{document.execCommand('copy');console.log('Text copied to clipboard (fallback)')}catch(err){console.error('Fallback: Oops, unable to copy',err)}
20document.body.removeChild(textArea);return Promise.resolve()}}
21shareLinksInit=()=>{const shareLinks={'.share_container_buttons_list .email':'email','.share_container_buttons_list .facebook':'facebook','.share_container_buttons_list .x':'x'};
21Object.entries(shareLinks).forEach(([selector,method])=>{const link=document.querySelector(selector);if(link){link.addEventListener('click',()=>{this.pushDataLayerEvent('share',method)})}})}
22pushDataLayerEvent=(eventName,method=null)=>{const shareContainer=document.querySelector('.share_container');if(!shareContainer){return}
23const contentType=shareContainer.dataset.contentType||'';const contentId=shareContainer.dataset.contentId||'';const eventData={event:eventName,content_type:contentType,content_id:contentId};if(method){eventData.method=method}
24window.dataLayer=window.dataLayer||[];window.dataLayer.push(eventData)}}
25new SocialShare()

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.