PageSourceSearch

https://www.cancom.de/wp-content/cache/min/2/wp-content/plugins/gr…/assets/js/frontend.js?ver=1790869033

js cancom.de collected 2026-10-02 07:19:24 UTC 5,231 bytes, 10 lines download raw bytes

1document.addEventListener('DOMContentLoaded',function(){Interactions.init()});var Interactions=new function(){this.firstInteractionComplete=!1;this.completedInteractions=[];this.currentForm=null;this.areSent=!1;this.debug=!1;this.init=function(){if(typeof document.getElementsByClassName("greyd_form")==='undefined'&&document.getElementById("greyd_form")==='undefined'){return}
2this.addEvents()};this.addEvents=function(){if(!Interactions.areSent){document.addEventListener('mousedown',Interactions.checkForFirstInteraction)}};this.checkForFirstInteraction=function(e){Interactions.areSent=!1;const form=e.target.closest(".greyd_form");if(typeof form=="undefined"||!form)return;Interactions.currentForm=form;let targetElement=e.target;let targetElementName=targetElement.tagName.toLowerCase();if(targetElementName=="span"){let el=targetElement.parentNode.querySelector('input');if(typeof el==="undefined"||!el){const label=targetElement.closest('label');if(typeof label!=="undefined"&&label){el=label.querySelector("input[type='checkbox']")}}
3if(typeof el!=="undefined"&&el){targetElement=el;targetElementName=targetElement.tagName.toLowerCase()}}
4if(targetElementName=="div"&&targetElement.classList.contains('select-selected')){let el=targetElement.parentNode.querySelector('select');if(typeof el!=="undefined"&&el){targetElement=el;targetElementName=targetElement.tagName.toLowerCase()}}
5if(targetElementName=="input"||targetElementName=="textarea"||targetElementName=="select"){if(Interactions.debug)console.log("User started interacting");document.removeEventListener('mousedown',Interactions.checkForFirstInteraction);['focusin','focusout','mousedown','keyup','ontouchstart'].forEach(evt=>form.addEventListener(evt,Interactions.trackInteractions,!1));window.addEventListener('beforeunload',(event)=>{Interactions.sendInteractions(form);return undefined})}};this.trackInteractions=function(e){const form=this;if(typeof form=="undefined"||!form)return;const key=e.keyCode||e.charCode;let field={ref:e.target,tagName:e.target.tagName.toLowerCase(),type:e.target.getAttribute("type"),microInteraction:{click:null,char:null,delete:null},};if(field.tagName=="span"){let el=field.ref.parentNode.querySelector('input');if(typeof el=="undefined"||!el){const label=field.ref.closest('label');if(typeof label!=="undefined"&&label){el=label.querySelector("input[type='checkbox']")}}
6if(typeof el!=="undefined"&&el){field.ref=el;field.tagName=field.ref.tagName.toLowerCase()}}
7if(field.tagName=="div"&&field.ref.parentNode.classList.contains('select-items')){let el=field.ref.parentNode.parentNode.querySelector('select');if(typeof el!=="undefined"&&el){field.ref=el;field.tagName=field.ref.tagName.toLowerCase()}}
8if(e.type=="focusin"){if(Interactions.debug)console.log("User beginns interacting with field: "+field.ref.getAttribute("name"))}
9if(field.tagName=="input"||field.tagName=="textarea"){if(e.type=="keyup"&&(key==8||key==46)){if(Interactions.debug)console.log("User deletes Chars in Field: "+field.ref.getAttribute("name"))}else if(e.type=="keyup"){if(Interactions.debug)console.log("User types in Field: "+field.ref.getAttribute("name"))}}else if(field.tagName=="select"){if(Interactions.debug)console.log("User interacts with dropdown: "+field.ref.getAttribute("name"));Interactions.saveInteraction(field.ref)}else if(field.tagName=="button"&&field.ref.getAttribute('type')=="submit"){Interactions.saveInteraction(field.ref);Interactions.sendInteractions(form)}else{if(Interactions.debug)console.log("User clicked in the form, but no form field")}
10if(e.type=="focusout"&&!Interactions.areSent){if(Interactions.debug)console.log("User stops interacting with field: "+field.ref.getAttribute("name"));if(Interactions.debug)console.log("Saving Data");Interactions.saveInteraction(field.ref)}else if(e.type=="focusout"&&Interactions.areSent){if(Interactions.debug)console.log("Interactions sent...")}};this.saveInteraction=function(el){if(Interactions.areSent)return;const interaction={id:el.getAttribute('id'),type:el.getAttribute('type'),name:el.getAttribute('name'),required:el.hasAttribute('required'),timestamp:Date.now(),};
10if(interaction.type=="hidden")return;Interactions.completedInteractions.push(interaction);if(Interactions.debug)console.log("Saved Interaction");if(Interactions.debug)console.log("____________________________________________")};this.sendInteractions=function(form){if(Interactions.areSent)return;const formID=form.getAttribute("data-id");const nonce=form.getAttribute("data-nonce");const uid=form.getAttribute("id");if(Interactions.debug)console.log("Sending Interaction for Form: "+formID+" to backend");const body=new FormData();const data={form_id:formID,uid:uid,interactions:Interactions.getCompletedInteractions()};body.append('action','receive_interactions');body.append('nonce',nonce);body.append('data',JSON.stringify(data));fetch(greyd.forms.tools.getAjaxUrl(),{method:'POST',credentials:'same-origin',body:body,}).then((response)=>response.json()).then((data)=>{if(data){if(Interactions.debug)console.log(data)}}).catch((error)=>{if(Interactions.debug)console.error(error)});Interactions.areSent=!0;return};this.getCompletedInteractions=function(){return Interactions.completedInteractions}}

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.