upskill-event-manager/assets/js/two-step-modern-checkout.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
3.3 KiB
JavaScript

function twoStepModernCheckout(e){e.preventDefault();var t=document.querySelectorAll(".ast-embed-checkout-form-steps .steps");let o="ast-current";var c="step-one",r="step-two",s=document.querySelector(".ast-two-step-wrap"),l=document.querySelector(".ast-embed-checkout-form-steps .steps.ast-current"),a=e.currentTarget.querySelector("a");l&&l.classList.remove(o),a&&s&&(l=s.querySelector(".woocommerce"),s=a.getAttribute("href"),a=document.querySelector(".ast-embed-checkout-form-steps .step-two"),t.forEach(e=>{e.classList.remove(o)}),"#customer_details"===s&&l?(l.classList.remove(r),l.classList.add(c),e.currentTarget.classList.add(o)):"#ast-order-wrap"===s&&l&&(l.classList.remove(c),l.classList.add(r),a.classList.add(o)))}function validateInputs(e){let s=!0,l=!1;return e.forEach(t=>{var o=t.getAttribute("type"),c=t.closest(".form-row");if(c){var r=c.querySelector(".select2"),r=c&&r?c.querySelector(".select2-selection__rendered").getAttribute("title"):t.value?t.value.trim():"";let e="";c.classList.contains("validate-required")&&("checkbox"===o&&t.checked?!(fieldValueCheckbox=!0)===fieldValueCheckbox&&""===e&&(c.classList.add("woocommerce-invalid"),s=!1,e=t):c.classList.remove("woocommerce-invalid"),"email"===o&&!1===/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(r)||""===r?""===e&&(c.classList.add("woocommerce-invalid"),s=!1,e=t):c.classList.remove("woocommerce-invalid"),""!==e)&&!1===l&&(l=!0,e.focus())}}),s}function validateCheckoutInputs(){var e=document.querySelector(".ast-two-step-wrap form.woocommerce-checkout .woocommerce-billing-fields, .ast-two-step-wrap form.woocommerce-checkout .woocommerce-account-fields"),t=document.querySelector(".woocommerce-billing-fields__customer-info-wrapper"),o=document.querySelector(".ast-two-step-wrap form.woocommerce-checkout .woocommerce-shipping-fields"),c='input[type="text"], input[type="tel"], input[type="email"], input[type="password"], input[type="checkbox"], .select2';let r;if(t){let e;var s=document.querySelector("#ast-customer-login-url"),l=document.querySelector(".ast-create-account-section"),a=t.querySelector("#createaccount");(e=s&&s.classList.contains("active")?t.querySelectorAll("#billing_email, #billing_password"):astraAddon.is_registration_required&&l&&"block"===l.style.display||a&&a.checked?t.querySelectorAll("#billing_email, #account_username, #account_password"):t.querySelectorAll("#billing_email"))&&(r=r?Array.prototype.slice.call(r).concat(Array.prototype.slice.call(e)):e)}return e&&(r=r?Array.prototype.slice.call(r).concat(Array.prototype.slice.call(e.querySelectorAll(c))):e.querySelectorAll(c)),validateInputs(r=o&&(s=o.querySelector('h3#ship-to-different-address input[type="checkbox"]'))&&s.checked?r?Array.prototype.slice.call(r).concat(Array.prototype.slice.call(o.querySelectorAll(c))):o.querySelectorAll(c):r)}document.addEventListener("DOMContentLoaded",function(e){var t,o=document.querySelector("body");!astraAddon.cartflows_version&&o&&o.classList.contains("woocommerce-checkout")&&o.classList.contains("ast-woo-two-step-modern-checkout")&&(o=document.querySelectorAll(".ast-embed-checkout-form-steps .steps"),(t=document.querySelector(".ast-embed-checkout-form-nav-btns"))&&t.addEventListener("click",function(e){validateCheckoutInputs()&&twoStepModernCheckout(e)}),o)&&o.forEach(e=>{e.addEventListener("click",function(e){validateCheckoutInputs()&&twoStepModernCheckout(e)})})});