upskill-event-manager/assets/js/formidable-abandonment-admin.min.js
Ben Reed cdc5ea85f4 feat: Add comprehensive CSS, JavaScript and theme asset infrastructure
Add massive collection of CSS, JavaScript and theme assets that were previously excluded:

**CSS Files (681 total):**
- HVAC plugin-specific styles (hvac-*.css): 34 files including dashboard, certificates, registration, mobile nav, accessibility fixes, animations, and welcome popup
- Theme framework files (Astra, builder systems, layouts): 200+ files
- Plugin compatibility styles (WooCommerce, WPForms, Elementor, Contact Form 7): 150+ files
- WordPress core and editor styles: 50+ files
- Responsive and RTL language support: 200+ files

**JavaScript Files (400+ total):**
- HVAC plugin functionality (hvac-*.js): 27 files including menu systems, dashboard enhancements, profile sharing, mobile responsive features, accessibility, and animations
- Framework and library files: jQuery plugins, GSAP, AOS, Swiper, Chart.js, Lottie, Isotope
- Plugin compatibility scripts: WPForms, WooCommerce, Elementor, Contact Form 7, LifterLMS
- WordPress core functionality: customizer, admin, block editor compatibility
- Third-party integrations: Stripe, SMTP, analytics, search functionality

**Assets:**
- Certificate background images and logos
- Comprehensive theme styling infrastructure
- Mobile-responsive design systems
- Cross-browser compatibility assets
- Performance-optimized minified versions

**Updated .gitignore:**
- Fixed asset directory whitelisting patterns to properly include CSS/JS/images
- Added proper directory structure recognition (!/assets/css/, !/assets/js/, etc.)
- Maintains security by excluding sensitive files while including essential assets

This commit provides the complete frontend infrastructure needed for:
- Full theme functionality and styling
- Plugin feature implementations
- Mobile responsiveness and accessibility
- Cross-browser compatibility
- Performance optimization
- Developer workflow support
2025-08-11 16:20:31 -03:00

1 line
No EOL
4.9 KiB
JavaScript

(()=>{"use strict";const e={abandoned:"abandoned",create:"abd-edit-link",draft:"abd-draft"},t={lastActionId:0,init(){for(const t in e)if(e.hasOwnProperty(t)){const n=e[t],o=document.getElementById(`${n}-email-action`);o&&o.addEventListener("click",(()=>{this.createAction(t)}))}},async createAction(e){const{div:t}=frmDom,n=this.getNewActionId(),o=document.getElementById("form_id").value,r=new FormData;r.append("action","frm_add_form_action"),r.append("type","email"),r.append("list_id",n),r.append("form_id",o),r.append("abandonment_form_action",e),r.append("nonce",frmGlobal.nonce);let a="";try{a=await fetch(ajaxurl,{method:"POST",body:r})}catch(e){return}const i=await a.text();document.querySelector('.frm-form-setting-tabs li a[href="#email_settings"]').dispatchEvent(new Event("click")),document.querySelectorAll(".frm_form_action_settings.open").forEach((e=>e.classList.remove("open")));const c=t();c.innerHTML=i;const s=c.querySelector(".widget-top"),d=document.getElementById("frm_notification_settings");Array.from(c.children).forEach((e=>d.appendChild(e)));const m=document.getElementById(`frm_form_action_${n}`);m.classList.add("open"),document.getElementById("post-body-content").scroll({top:m.offsetTop+10,left:0,behavior:"smooth"}),document.querySelectorAll(".frm_email_action").forEach((e=>{e.querySelector(".frm_show_upgrade")||(e.classList.remove("frm_inactive_action","frm_already_used"),e.classList.add("frm_active_action"))})),this.showInputIcon(`#frm_form_action_${n}`),jQuery("#frm_form_action_"+n+" .frm_multiselect").hide().each(frmDom.bootstrap.multiselect.init),frmDom.autocomplete.initAutocomplete("page",m),s&&jQuery(s).trigger("frm-action-loaded")},getNewActionId(){const e=document.querySelectorAll(".frm_form_action_settings");let t=this.getNewRowId(e,"frm_form_action_");return document.getElementById(`frm_form_action_${t}`)&&(t+=100),this.lastActionId>=t&&(t=this.lastActionId+1),this.lastActionId=t,t},getNewRowId:(e,t,n=0)=>e.length?parseInt(e[e.length-1].id.replace(t,""),10)+1:n,showInputIcon(e=""){this.maybeAddFieldSelection(e);document.querySelectorAll(`${e} .frm_has_shortcodes:not(.frm-with-right-icon) input,${e} .frm_has_shortcodes:not(.frm-with-right-icon) textarea`).forEach((e=>{const t=document.createElement("span");t.classList.add("frm-with-right-icon"),e.parentNode.insertBefore(t,e),t.appendChild(e),t.insertAdjacentHTML("afterbegin",'<svg class="frmsvg frm-show-box"><use xlink:href="#frm_more_horiz_solid_icon"/></svg>')}))},maybeAddFieldSelection(e){document.querySelectorAll(`${e} :not(.frm_has_shortcodes) .frm_not_email_message, ${e} :not(.frm_has_shortcodes) .frm_not_email_to, ${e} :not(.frm_has_shortcodes) .frm_not_email_subject`).forEach((e=>{e.parentNode.classList.add("frm_has_shortcodes")}))}};function n(e,t,n){document.addEventListener("click",(o=>{const r=document.getElementById(e);if(!r||!o.target.id.match(e)&&!r.contains(o.target))return;o.preventDefault(),async function(e,t){if(!e)return;if(navigator.clipboard)try{await navigator.clipboard.writeText(e.getAttribute(t))}catch(e){console.log(e)}}(document.getElementById(t),n);const a=document.querySelector(".frm-abandonment-copy-success");a&&a.remove();const i=document.createElement("span");i.setAttribute("class","frm-abandonment-copy-success"),i.innerHTML='<svg width="16px" height="16px" class="frmsvg" viewBox="0 0 10 8"><path d="M9.2 1c.2.3.2.7 0 1l-5 5c-.3.2-.6.2-.9 0L.8 4.3a.6.6 0 0 1 .9-.8l2 2 4.6-4.5c.3-.3.6-.3.9 0Z"/></svg>',i.style.margin="0 5px",r.parentNode.insertBefore(i,r.nextSibling),setTimeout((()=>{i.remove()}),6e3)}))}const o={entryID:null,listening:!1,init(){const e=document.getElementById("frm-entry-detail-reset-token");e&&(e.addEventListener("click",(e=>{e.preventDefault(),this.entryID=e.target.getAttribute("data-entry-id")})),this.watchConfirmLink(),n("frm-abandonment-copy-link-btn","frm-abandonment-link-btn","href"))},watchConfirmLink(){wp.hooks.addAction("frmAdmin.beforeOpenConfirmModal","frmAbdnReset",(e=>{if(this.listening||!e.link||!e.link.getAttribute("data-frmreset"))return;const t=document.getElementById("frm-confirmed-click");if(!t)return;const n=e=>{e.target.getAttribute("data-frmreset")&&(e.preventDefault(),this.resetLink(),t.removeEventListener("click",n),this.listening=!1)};t.addEventListener("click",n),this.listening=!0}))},resetLink(){const e=new FormData;e.append("action","frm_abandoned_reset_token"),e.append("nonce",frm_js.nonce),e.append("entry_id",this.entryID),(async e=>{if(!e)return{success:!1,message:"No data to send."};const t=await fetch(frm_js.ajax_url,{method:"POST",credentials:"same-origin",headers:{"Cache-Control":"no-cache"},body:e});return Promise.resolve(t.json())})(e).then((e=>{if(e.success){const t=e.data.token_link;document.getElementById("frm-abandonment-link-btn").href=t,document.querySelector(".frm-abandon-short-token").textContent=e.data.token_label}}))}};var r;r=()=>{t.init(),o.init()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",r):r())})();