File Editor
Directories:
.. (Back)
admin
packages
Files:
addons-page.js
bootstrap-multiselect.js
bootstrap.min.js
form-templates.js
formidable.js
formidable.min.js
formidable_admin.js
formidable_admin_global.js
formidable_blocks.js
formidable_dashboard.js
formidable_overlay.js
formidable_styles.js
onboarding-wizard.js
plugin-search.js
popper.min.js
Create New File
Create
Edit File: formidable_dashboard.js
!function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,n(r.key),r)}}function n(t){var n=function(t){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(n)?n:n+""}var i=function(){return e=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.elements=t,this.type=n,this.prepareElements()},n=[{key:"fadeIn",value:function(){var e=this;this.applyStyleToElements((function(t){t.classList.add("frm-fadein-up"),t.addEventListener("animationend",(function(){e.resetOpacity(),t.classList.remove("frm-fadein-up")}),{once:!0})}))}},{key:"cascadeFadeIn",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.03;setTimeout((function(){e.applyStyleToElements((function(e,n){e.classList.remove("frm-animate"),e.style.transitionDelay=(n+1)*t+"s"}))}),200)}},{key:"prepareElements",value:function(){var e=this;this.applyStyleToElements((function(t){"default"===e.type&&(t.style.opacity="0.0"),"cascade"===e.type&&t.classList.add("frm-init-cascade-animation"),"cascade-3d"===e.type&&t.classList.add("frm-init-fadein-3d"),t.classList.add("frm-animate")}))}},{key:"resetOpacity",value:function(){this.applyStyleToElements((function(e){return e.style.opacity="1.0"}))}},{key:"applyStyleToElements",value:function(e){this.elements instanceof Element?e(this.elements,0):0<this.elements.length&&this.elements.forEach((function(t,n){return e(t,n)}))}}],n&&t(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();Promise.resolve(),window.frmDom.util.onClickPreventDefault;var r=(new URL(window.location.href).searchParams,window.frmGlobal);function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,s(i.key),i)}}function s(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}r.url,r.nonce;var l=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),void 0!==t&&(this.wrapper=t instanceof Element?t:document.querySelector(t),null!==this.wrapper&&(this.flexboxSlidesGap="16px",this.navs=this.wrapper.querySelectorAll(".frm-tabs-navs ul > li"),this.slideTrackLine=this.wrapper.querySelector(".frm-tabs-active-underline"),this.slideTrack=this.wrapper.querySelector(".frm-tabs-slide-track"),this.slides=this.wrapper.querySelectorAll(".frm-tabs-slide-track > div"),this.init()))},(t=[{key:"init",value:function(){var e=this;null!==this.wrapper&&this.navs.length&&null!==this.trackLine&&null!==this.slideTrack&&this.slides.length&&(this.initDefaultSlideTrackerWidth(),this.navs.forEach((function(t,n){t.addEventListener("click",(function(t){return e.onNavClick(t,n)}))})))}},{key:"onNavClick",value:function(e,t){this.removeActiveClassnameFromNavs(),e.target.classList.add("frm-active"),this.initSlideTrackUnderline(e.target,t),this.changeSlide(t)}},{key:"initDefaultSlideTrackerWidth",value:function(){this.slideTrackLine.dataset.initialWidth&&(this.slideTrackLine.style.width="".concat(this.slideTrackLine.dataset.initialWidth,"px"))}},{key:"initSlideTrackUnderline",value:function(e,t){this.slideTrackLine.classList.remove("frm-first","frm-last");var n=void 0!==e?e:this.navs.filter((function(e){return e.classList.contains("frm-active")}));this.slideTrackLine.style.transform="translateX(".concat(n.offsetLeft,"px)"),this.slideTrackLine.style.width=n.clientWidth+"px",this.navs.length!==t+1?0===t&&this.slideTrackLine.classList.add("frm-first"):this.slideTrackLine.classList.add("frm-last")}},{key:"changeSlide",value:function(e){this.removeActiveClassnameFromSlides();var t=0==e?"0px":"calc( ( ".concat(100*e,"% + ").concat(parseInt(this.flexboxSlidesGap,10)*e,"px ) * -1 )");this.slideTrack.style.transform="translateX(".concat(t,")"),e in this.slides&&this.slides[e].classList.add("frm-active")}},{key:"removeActiveClassnameFromSlides",value:function(){this.slides.forEach((function(e){return e.classList.remove("frm-active")}))}},{key:"removeActiveClassnameFromNavs",value:function(){this.navs.forEach((function(e){return e.classList.remove("frm-active")}))}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}function u(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function f(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var m=function(){return e=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),!t instanceof Element||!t.dataset.counter||(this.template=t.dataset.type||"default",this.element=t,this.value=parseInt(t.dataset.counter,10),this.activeCounter=0,this.locale=t.dataset.locale?t.dataset.locale.replace("_","-"):"en-US",this.timeoutInterval=50,this.timeToFinish=void 0!==n&&void 0!==n.timetoFinish?n.timetoFinish:1400,this.valueStep=this.value/Math.ceil(this.timeToFinish/this.timeoutInterval),0!==this.value&&this.animate())},(t=[{key:"formatNumber",value:function(e){return"currency"===this.template?e.toLocaleString(this.locale,{minimumFractionDigits:2}):e}},{key:"animate",value:function(){Math.round(this.activeCounter)<this.value?(this.activeCounter+=this.valueStep,this.element.innerText=this.formatNumber(Math.round(this.activeCounter)),setTimeout(this.animate.bind(this),this.timeoutInterval)):this.element.innerText=this.formatNumber(this.value)}}])&&u(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function h(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,y(i.key),i)}}function y(e){var t=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(t)?t:t+""}var v=new(function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.options={ajax:{action:"dashboard_ajax_action",dashboardActions:{welcomeBanner:"welcome-banner-has-closed",checkEmailIfSubscribed:"email-has-subscribed",saveSubscribedEmail:"save-subscribed-email"}}},this.widgetsAnimate=new i(document.querySelectorAll(".frm-dashboard-widget"),"cascade")},(t=[{key:"init",value:function(){this.initInbox(),this.initCounters(),this.initCloseWelcomeBanner(),this.widgetsAnimate.cascadeFadeIn()}},{key:"initInbox",value:function(){var e=this;new l(".frm-inbox-wrapper");var t=document.querySelector("#frm_leave_email");document.querySelector("#frm-add-my-email-address").addEventListener("click",(function(){e.saveSubscribedEmail(t.value).then()}))}},{key:"initCounters",value:function(){document.querySelectorAll(".frm-counter").forEach((function(e){return new m(e)}))}},{key:"initCloseWelcomeBanner",value:function(){var e=this,t=document.querySelector(".frm-dashboard-banner-close"),n=document.querySelector(".frm-dashboard-banner");t&&n&&t.addEventListener("click",(function(){e.closeWelcomeBannerSaveCookieRequest().then((function(e){!0===e.success&&n.remove()}))}))}},{key:"saveSubscribedEmail",value:function(e){return fetch(window.ajaxurl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({action:this.options.ajax.action,dashboard_action:this.options.ajax.dashboardActions.saveSubscribedEmail,email:e})}).then((function(e){return e.json()}))}},{key:"closeWelcomeBannerSaveCookieRequest",value:function(){return fetch(window.ajaxurl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({action:this.options.ajax.action,dashboard_action:this.options.ajax.dashboardActions.welcomeBanner,banner_has_closed:1})}).then((function(e){return e.json()}))}}])&&h(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}());document.addEventListener("DOMContentLoaded",(function(){v.init()}))}();
Save Changes
Rename File
Rename