PageSourceSearch

https://www.buero-ballinger.de/securewebapps/evercdn/assets/formixjs/v1/scripts/main.min.js

js buero-ballinger.de collected 2026-10-04 18:01:29 UTC 5,061 bytes, 8 lines download raw bytes

1/**
2 * @preserve
3 * handles formix form submits and general form handling
4 * @author Dario Rieke
5 * @lastmod 2025-08-06
6 * @version 1.1.1
7 */class Formix{options={selector:'form[action*="formixapp.com"]',msg:{de:{success:"<p><strong>Vielen Dank!</strong></p><p>Ihre Nachricht wurde erfolgreich an uns \xFCbermittelt. Wir werden Ihr Anliegen schnellstm\xF6glich bearbeiten und uns dann mit Ihnen in Verbindung setzen.</p><p>In dringenden F\xE4llen kontaktieren Sie uns bitte telefonisch.</p>",error:"<p><strong>Fehler!</strong></p><p>Leider gab es bei der Verarbeitung Ihrer Anfrage einen Fehler. Bitte \xFCberpr\xFCfen Sie die folgenden Formularfelder: </p>",requestError:"Das Formular konnte auf Grund eines technischen Fehlers nicht versendet werden. Bitte versuchen Sie es sp\xE4ter erneut oder kontaktieren Sie uns telefonisch.",reply_to:"E-Mail",form:"Captcha",checkboxValidityMessage:"Bitte eine der Optionen ausw\xE4hlen."},en:{success:"<p><strong>Your message has been sent!</strong></p><p>Thank you for your message. We will contact you as soon as possible.</p>",error:"<p>The form could not be sent. Please check the following form fields: </p>",requestError:"The form could not be sent due to technical issues. Please try again later.",reply_to:"Email",form:"Captcha",checkboxValidityMessage:"Please choose one of the options."}},onSend:null,eventName:"submit",onSuccess:null,onRequestError:null,onError:null,onInit:null,prefillFromUrlParameters:!0,notification:window.notification??null};lang;forms;constructor(e={}){this.options={...this.options,...e},document.documentElement.hasAttribute("lang")&&(this.lang=document.documentElement.getAttribute("lang").split("-")[0].toLowerCase()),this.init()}init(){this.forms=document.querySelectorAll(this.options.selector),this.forms.forEach(e=>{e.addEventListener(this.options.eventName,s=>this.onSubmit(s,e)),this.addValidationListeners(e),this.options.prefillFromUrlParameters===!0&&this.prefillFromUrlParameters(e)}),this.options.onInit?.(this),window.dispatchEvent(new CustomEvent("formix.init",{detail:{formix:this}}))}async onSubmit(e,s){if(s.method!=="post")return;e.preventDefault();const n=new FormData(s);if(this.options.onSend?.(this,n),!!window.dispatchEvent(new CustomEvent("formix.send",{cancelable:!0,detail:{form:s,formData:n,submitEvent:e,formix:this}})))try{const i=await fetch(s.action??s.dataset.action,{method:"POST",headers:{Accept:"application/json"},body:n});if(i.ok){if(this.options.onSuccess?.(this,i),!window.dispatchEvent(new CustomEvent("formix.success",{cancelable:!0,detail:{form:s,response:i,submitEvent:e,formix:this}})))return;this.options.notification?.add({id:"formixSuccess",classNames:"success",message:this.getTranslation("success"),saveState:!1})}else{this.options.onError?.(this,i);const t=Object.keys(await i.json()),r=this.getInvalidFieldsMessage(t);if(!window.dispatchEvent(new CustomEvent("formix.error",{cancelable:!0,detail:{form:s,response:i,submitEvent:e,formix:this}})))return;this.options.notification?.add({id:"formixError",classNames:"error",message:r,saveState:!1})}}catch(i){if(this.options.onRequestError?.(this,response),!window.dispatchEvent(new CustomEvent("formix.requestError",{cancelable:!0,detail:{form:s,submitEvent:e,formix:this,error:i}})))return;this.options.notification?.add({id:"formixRequestError",classNames:"error",message:this.getTranslation("requestError"),saveState:!1})}}addValidationListeners(e){e.addEventListener("invalid",i=>e.classList.add("was-validated"),!0);const n=[...e.querySelectorAll('input[type="checkbox"][required], input[type="radio"][required]')].map(i=>i.name);
7[...new Set(n)].forEach(i=>{const t=e.querySelectorAll(`input[name="${i}"]`);t.forEach(r=>{const o=e.querySelector(`label[for="${r.id}"]`);r.removeAttribute("required"),r.setAttribute("data-field-required",!0),r.classList.add("invalid"),o?.classList.add("invalid"),r.setCustomValidity(this.getTranslation("checkboxValidityMessage")),r.addEventListener("change",d=>{const l=[...t].find(a=>a.checked);t.forEach(a=>{const u=e.querySelector(`label[for="${a.id}"]`);l?t.forEach(h=>h.setCustomValidity("")):(t[0].setCustomValidity(this.getTranslation("checkboxValidityMessage")),t[0].reportValidity()),a.toggleAttribute("data-field-required",!l),a.classList.toggle("invalid",!l),u?.classList.toggle("invalid",!l)})})})})}prefillFromUrlParameters(e){const s=new URLSearchParams(window.location.search);"forward"in e.dataset&&(e.method="GET",e.action=e.dataset.forward),s.forEach((n,c)=>{e.querySelectorAll(`.prefill-${c}`).forEach(t=>{switch(t.nodeName.toLowerCase()){case"input":switch(t.getAttribute("type")){case"radio":case"checkbox":t.value===n&&(t.checked=!0);break;default:t.value=n;break}break;case"select":[...t.children].forEach((o,d)=>{o.value===n&&(t.selectedIndex=d)});default:t.value=n;break}})})}getInvalidFieldsMessage(e){const s=e.map(n=>this.getTranslation(n));return`${this.getTranslation("error")} 
8 ${s.join("<br>")}`}getTranslation(e){return this.lang in this.options.msg?this.options.msg[this.lang][e]??e:this.options.msg.en[e]??e}}

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.