← Back
Editing: wpforms.js
(()=>{"use strict";let t,e={};e.n=t=>{let r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch{if("object"==typeof window)return window}}(),e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),e.g.importScripts&&(t=e.g.location+"");let r=e.g.document;if(!t&&r&&(r.currentScript?.tagName.toUpperCase()==="SCRIPT"&&(t=r.currentScript.src),!t)){let e=r.getElementsByTagName("script");if(e.length){let r=e.length-1;for(;r>-1&&(!t||!/^https?:/.test(t));)t=e[r--].src}}if(!t)throw Error("Automatic publicPath is not supported in this browser");e.p=t=t.replace(/^blob:|[?#].*$/g,"").replace(/\/[^/]+$/,"/"),e.p;let n=window.wp.domReady;var i=e.n(n),o={init:function(){this.showCorrectButton(),this.listenTriggerChanges()},showCorrectButton:function(){var t=this.getCurrentTriggerID();this.hideSubmitButtons(),this.showSubmitButton(t)},listenTriggerChanges:function(){for(var t=this,e=this.$getTriggers(),r=0;r<e.length;r++)e[r].addEventListener("change",function(e){let r=e.currentTarget.value;t.deselectAllTriggers({except:r}),t.showCorrectButton()})},getCurrentTriggerID:function(){for(var t=this.$getTriggers(),e=null,r=0,n=t.length;r<n;++r)t[r].checked&&(e=t[r].value);return e},deselectAllTriggers:function(t){for(var e=this.$getTriggers(),r=void 0!==t&&void 0!==t.except,n=0,i=e.length;n<i;++n)e[n].checked=!1,r&&t.except==e[n].value&&(e[n].checked=!0)},hideSubmitButtons:function(){for(var t=this.$getSubmitButtons(),e=0;e<t.length;e++)t[e].style.display="none"},showSubmitButton:function(t){var e=this.$getSubmitButton(t);null!=e&&(e.style.display="block")},$getSubmitButtons:function(){return document.querySelectorAll(".uap-wpf-integration-create-recipe-btn")},$getTriggers:function(){return document.querySelectorAll(".uap-wpf-integration-recipe-trigger-radio")},$getSubmitButton:function(t){return document.querySelector('.uap-wpf-integration-create-recipe-btn[data-id="'+t+'"]')}};i()(()=>{o.init()})})();
Save File
Cancel