PageSourceSearch

https://christlichesradio.de/wp-content/themes/cmms-theme-blm_radiosender/assets/dist/1.3/Form.js

js christlichesradio.de collected 2026-10-08 09:55:31 UTC 11,492 bytes, 1 lines download raw bytes

1import{_ as b,a as g,$ as p,e as _,L as y,m as D,f as k}from"./app.js";import"./swiper.js";class m{constructor(){this.dict={}}append(e,i){this.dict[e]=i}remove(e){delete this.dict[e]}safe(){const e=new FormData;for(let i in this.dict)this.dict.hasOwnProperty(i)&&e.append(i,this.dict[i]);return e}}class F{constructor(e,i="",o="Schließen"){const s=document.createElement("div");s.classList.add("if-validation"),s.innerHTML='<div class="if-validation-blocker"></div>\n            <div class="if-validation-wrapper">\n                <div class="if-validation-popup">\n                    <div class="if-validation-content">'.concat(e,"</div>\n                    ").concat(i.length?i:'<div class="if-validation-button">'.concat(o,"</div>"),"\n                </div>\n            </div>");const a=s.querySelector(".if-validation-button");a&&a.addEventListener("click",n=>{n.preventDefault(),this.close()}),document.body.appendChild(s),document.body.style.overflow="hidden",this.el=s}getEl(){return this.el}close(){try{this.el.parentNode.removeChild(this.el)}catch(e){console.debug(e,"[FormPopup] Error closing:")}document.body.style.overflow="",this.el=null}}const P={name:"SoylentForm",components:{SoylentLink:g},data:function(){return{formEnabled:!0,formDeadlineReached:!1,formLoginRequired:!1,form:null,mandatory:null,files:null,fileMaxSize:null,target:null,postTarget:null,popupVisible:!1,popupType:"validation",popupText:"",uploadPercentage:0,submitHandler:null,formDataUnsafe:{},isLockedByPrefill:!1}},props:["element"],computed:{...k("sso",["auth"]),profilePageUrl(){return"profile_page"in window.soylent_settings?window.soylent_settings.profile_page:"/"}},methods:{...D("sso",["setRedirectPath"]),initForm:function(){const t=this.$refs.formContainer.firstChild;if(this.element.data.restricted===!0){this.formEnabled=!1,this.setRedirectPath(window.location.pathname);return}else if(t.nodeValue===" [Form] Deadline reached "){this.formEnabled=!1,this.formDeadlineReached=!0;return}this.form=t,this.mandatory=p(".if-mandatory",t),this.files=p('input[type="file"]',t),this.fileMaxSize=t.getAttribute("data-file_max_size"),this.target=String(document.location.href).split("?")[0],this.postTarget=t.getAttribute("data-target"),this.errorMessages={nonce:this.getFeedbackMessage("nonce","Ein Fehler ist beim Absenden des Formulars aufgetreten, bitte lade die Seite neu und versuche es erneut."),captcha:this.getFeedbackMessage("captcha","Das Captcha konnte nicht verifiziert werden.")};let e=document.getElementsByClassName("if-date");for(let i of e)i.type="date";p("select.-with-input",this.form).forEach(i=>{const o=i.getAttribute("name"),s=document.createElement("input");s.setAttribute("type","text"),s.setAttribute("placeholder",i.getAttribute("data-input_placeholder")),i.parentNode.insertBefore(s,i.nextSibling),i.addEventListener("change",()=>
1{i.value==="__input"?(s.style.display="inherit",s.setAttribute("name",o),i.setAttribute("name",null)):(s.style.display="none",s.setAttribute("name",null),i.setAttribute("name",o))});const a=document.createEvent("HTMLEvents");a.initEvent("change",!0,!0),i.dispatchEvent(a)}),t.addEventListener("submit",this.submitForm),this.element.data.form_prefill_source&&(this.lockForPrefill(t),_.get(this.element.data.form_prefill_source).then(i=>{if(i.data&&i.data.prefill){for(let o in i.data.prefill)if(i.data.prefill[o]){let s;s=document.getElementById("ifm_".concat(o)),s||(s=document.getElementById("if_".concat(o))),s&&(s.value=i.data.prefill[o])}this.releasePrefillLock()}}).catch(i=>{this.prefillErrorPopup(),i.response||console.debug(i)})),this.$refs.formContainer.querySelectorAll("a").forEach(i=>{new y(i,this.$baseUrl,this.$router)})},lockForPrefill:function(t){const e=t.querySelector('[type="submit"]');e.disabled=this.isLockedByPrefill,this.isLockedByPrefill=!0,this.setPopup("Formulardaten werden geladen","prefill")},releasePrefillLock:function(){this.isLockedByPrefill=!1,this.setPopup("")},prefillErrorPopup:function(){this.isLockedByPrefill=!0,this.setPopup("Die Formulardaten konnten nicht geladen werden. Bitte versuchen Sie die Seite erneut zu laden","validation")},submitForm:function(t){if(t.preventDefault(),this.isLockedByPrefill)return!1;if(this.mandatory.length&&!this.validateMandatory()||this.files.length&&!this.validateFileSizes())return;const e=new XMLHttpRequest;this.resetFormDataUnsafe();let i=!1,o=a=>{const n="Die Daten sind noch nicht erfolgreich übermittelt worden. Soll die Übertragung wirklich abgebrochen werden?";return(a||window.event).returnValue=n,n};p("input, select, textarea",this.form).forEach(a=>{const n=a.getAttribute("name");if(!(typeof n>"u"))switch(a.type){case"file":a.files.length&&this.appendFormDataUnsafe(n,a.files[0]);break;case"radio":case"checkbox":a.checked&&this.appendFormDataUnsafe(n,a.value);break;default:this.appendFormDataUnsafe(n,a.value);break}}),this.appendFormDataUnsafe("if_xhr",1);const s=this.form.getAttribute("data-submit_event");if(s){window.IDVLContactFormPopup||(window.IDVLContactFormPopup=F),window.IDVLContactFormDataUnsafe||(window.IDVLContactFormDataUnsafe=m),this.submitHandler===null&&this.form.classList.contains("form-quantyoo-promotion")&&(this.submitHandler=new window.QuantyooPromotionFormHandler(this.form)),this.form.dispatchEvent(new CustomEvent(s,{detail:{form_data:this.castFormDataUnsafeObject()}}));return}e.onerror=()=>{window.removeEventListener("beforeunload",o),this.setPopup("Ein Fehler ist aufgetreten, die Daten konnten nicht übermittelt werden.")},e.onload=()=>{let a=String(e.responseText);if(a==="1"){window.removeEventListener("beforeunload",o),this.formTransmitted();return}try{a=JSON.parse(a)}catch(n){}if(a.url){window.removeEventListener("beforeunload",o);return}if(this.setPopup(""),a.error_message)this.setPopup(a.error_message);else if(a.error){let n=a.error;this.errorMessages[n]?n=this.errorMessages[n]:n="Ein Fehler ist aufgetreten, die Daten konnten nicht übermittelt werden<br><br>Fehlercode: ".concat(n),this.setPopup(n)}},e.upload.onprogress=a=>{let n=100/a.total*a.loaded;this.uploadPercentage=n,n===100&&!i&&(i=!0,this.$refs.uploadProgress.remove(),this.$refs.uploadProgressHeadline.innerHTML="Die Daten werden verarbeitet")},e.onabort=()=>{this.setPopup(""),window.removeEventListener("beforeunload",o)},window.addEventListener("beforeunload",o),e.open("POST",this.target),e.send(this.getFormDataSafe()),this.setPopup(null,"upload"),this.$nextTick(()=>{this.$refs.abortUpload.addEventListener("click",a=>{e.abort();try{this.setPopup("")}catch(n){}})})},validateMandatory(){let t={valid:!0,errorMessage:this.getFeedbackMessage("validation","Bitte überprüfe Deine Angaben, alle Felder mit * müssen ausgefüllt werden.")};return this.mandatory.forEach(e=>{if(!t.valid)return;const i=e;let o=e.getAttribute("name");if(i.nodeName.toLowerCase()!=="label"){switch(i.type){case"checkbox":e.checked!==!0&&(t.valid=!1);break;case"radio":$("input[name="+o+"]:checked")!==null&&(t.valid=!1);break;default:e.value.length||(t.valid=!1);break}window.cmms_apply_filters&&cmms_apply_filters("cmms_contact_form_editor_validate_mandatory",e,t)}}),t.valid?!0:(this.setPopup(t.errorMessage),!1)},validateFileSizes(){let t=!0;return window.File&&window.FileReader&&window.FileList&&window.Blob&&this.files.forEac
1h(e=>{t&&e.files.length&&e.files[0].size>this.fileMaxSize&&(this.setPopup("Die Datei <strong>".concat(e.files[0].name,"</strong> überschreitet die erlaubte Dateigröße")),t=!1)}),t},setPopup(t,e="validation"){this.popupText=t,this.popupType=e,this.popupVisible=this.popupText!==""},resetFormDataUnsafe(){this.formDataUnsafe={}},appendFormDataUnsafe(t,e){this.formDataUnsafe[t]=e},getFormDataSafe(){const t=new FormData;for(let e in this.formDataUnsafe)this.formDataUnsafe.hasOwnProperty(e)&&t.append(e,this.formDataUnsafe[e]);return t},formTransmitted(){window.IDVLContactFormDataUnsafe||(window.IDVLContactFormDataUnsafe=m),window.dispatchEvent(new CustomEvent("formTransmitted",{detail:{form:this.form,form_data:this.castFormDataUnsafeObject()}})),this.popupVisible=!1,this.formEnabled=!1,this.element.data.landing_page&&this.$router.push("/".concat(this.element.data.landing_page))},castFormDataUnsafeObject(){const t=new window.IDVLContactFormDataUnsafe;return Object.keys(this.formDataUnsafe).forEach(e=>{t.append(e,this.formDataUnsafe[e])}),t},getFeedbackMessage(t,e){return"feedback_messages"in this.element.data&&this.element.data.feedback_messages[t]?this.element.data.feedback_messages[t]:e}},mounted(){this.initForm()},watch:{popupVisible:function(t,e){t?document.body.style.overflow="hidden":document.body.style.overflow=""}}},r=window.Vue.createElementVNode,u=window.Vue.vShow,d=window.Vue.withDirectives,E=window.Vue.normalizeStyle,L=window.Vue.withKeys,V=window.Vue.resolveDirective,l=window.Vue.openBlock,f=window.Vue.createElementBlock,c=window.Vue.createCommentVNode,h=window.Vue.normalizeClass,T=window.Vue.toDisplayString,U=window.Vue.resolveComponent,C=window.Vue.withCtx,M=window.Vue.createBlock,S={class:"if-validation-wrapper"},B={class:"if-validation-popup",tabindex:"0"},A=["innerHTML"],H=["innerHTML"],z={class:"if-validation-content"},x={class:"if-upload-progress",ref:"uploadProgress"},I={class:"if-upload-progress-headline",ref:"uploadProgressHeadline"},N={class:"if-validation-custom_button if-upload-abort",ref:"abortUpload"},O=["innerHTML"],R={key:3},q={key:4,class:"sso-auth__card --with-icon --form"},j={class:"sso-auth__card__headline"};function K(t,e,i,o,s,a){const n=U("soylent-link"),v=V("focustrap");return l(),f("div",null,[t.popupVisible&&t.formEnabled?d((l(),f("div",{key:0,class:"if-validation",onKeyup:e[1]||(e[1]=L(w=>a.setPopup(""),["esc"]))},[e[2]||(e[2]=r("div",{class:"if-validation-blocker"},null,-1)),r("div",S,[r("div",B,[d(r("div",{class:"if-validation-content",innerHTML:t.popupText},null,8,A),[[u,t.isLockedByPrefill&&t.popupType==="prefill"]]),d(r("div",{class:"if-validation-content",innerHTML:t.popupText},null,8,H),[[u,t.popupType==="validation"]]),d(r("div",z,[r("div",x,[r("div",{class:"if-upload-progress-bar",style:E({width:t.uploadPercentage+"%"})},null,4)],512),r("div",I,"Die Daten werden übertragen ",512)],512),[[u,t.popupType==="upload"]]),d(r("div",N," Übertragung abbrechen ",512),[[u,t.popupType==="upload"]]),d(r("button",{onClick:e[0]||(e[0]=w=>a.setPopup("")),class:"if-validation-button theme__submit"}," Schließen ",512),[[u,t.popupType==="validation"]])])])],32)),[[v]]):c("",!0),t.formEnabled?(l(),f("div",{key:1,ref:"formContainer",class:h(["element",i.element.type,i.element.subtype]),innerHTML:i.element.data.html},null,10,O)):c("",!0),!t.formEnabled&&!t.formDeadlineReached&&!i.element.data.restricted?(l(),f("div",{key:2,ref:"formContainer",class:h(["element",i.element.type,i.element.subtype])},[...e[3]||(e[3]=[r("p",null,"Vielen Dank! Die Daten wurden übermittelt.",-1)])],2)):c("",!0),t.formDeadlineReached?(l(),f("div",R,[...e[4]||(e[4]=[r("p",null,"Das Formular ist leider nicht mehr verfügbar.",-1)])])):i.element.data.restricted?(l(),f("div",q,[e[6]||(e[6]=r("span",{class:"iconSet sso-auth__card__icon"},null,-1)),r("h3",j,T(i.element.data.restriction_notice),1),!t.auth&&i.element.data.restriction_type==="sso"?(l(),M(n,{key:0,url:a.profilePageUrl,class:"sso-auth__card__button"},{default:C(()=>[...e[5]||(e[5]=[r("span",{class:"sso-auth__card__button__label"},[r("span",{class:"sso-auth__card__button__text"},"Anmelden")],-1)])]),_:1},8,["url"])):c("",!0)])):c("",!0)])}const Q=b(P,[["render",K]]);export{Q as default};

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.