upskill-event-manager/assets/js/uagb-countdown.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.8 KiB
JavaScript

UAGBCountdown={elements:{},countdownInterval:{},cookie_slug:uagb_countdown_data.site_name_slug,cache:{},editorInit(e,t={},o){if(!t.timeModified){const n=new Date;n.setMilliseconds(n.getMilliseconds()+6048e5),t.endDateTime=n}this.elements[e]=this.getElement(e),this.countdownInterval[e]=setInterval(()=>{this.updateCountdown(e,t,o)},1e3)},createCookie(e,t,o,n){let i="";if(o){const s=new Date;"minutes"===n?s.setTime(s.getTime()+60*o*1e3):"hours"===n?s.setTime(s.getTime()+60*o*60*1e3):s.setTime(s.getTime()+24*o*60*60*1e3),i="; expires="+s.toGMTString()}document.cookie=this.cookie_slug+"-"+e+"="+t+i+"; path=/"},getCookie(e){const t="; "+document.cookie,o=t.split("; "+this.cookie_slug+"-"+e+"=");return 2===o.length?o.pop().split(";").shift():""},init(t,o={}){if(this.elements[t]=this.getElement(t),window?.UAGBCountdownTimeSignal||(window.UAGBCountdownTimeSignal={}),window.UAGBCountdownTimeSignal[t]=!1,void 0!==this.elements[t]){if("evergreen"===o?.timerType){var e=""!==o?.campaignID&&null!==o?.campaignID?o.campaignID:o.block_id;if(this.cache.cookie=this.getCookie(e),""!==this.cache.cookie){const s=new Date;var n=Math.floor(this.cache.cookie-s.getTime()),n=s.getTime()+n;const r=new Date(n);o.endDateTime=r.toISOString().replace(/\.\d{3}Z$/,"Z")}else{o.endDateTime=this.getEvergreenEndDate(o.evergreenDays,o.evergreenHrs,o.evergreenMinutes);const a=new Date;a.setTime(a.getTime()+24*Math.floor(o.evergreenDays)*60*60*1e3),a.setTime(a.getTime()+60*Math.floor(o.evergreenHrs)*60*1e3),a.setTime(a.getTime()+60*Math.floor(o.evergreenMinutes)*1e3),this.cache.evergreen=a.getTime()+100;n=""!==o?.resetDays&&0<o.resetDays?o.resetDays:30;this.createCookie(e,this.cache.evergreen,n,"days")}}const i=document.querySelectorAll(t);for(let e=0;e<i.length;e++)this.updateCountdown(t,o,i[e]),this.countdownInterval[t]=setInterval(()=>{this.updateCountdown(t,o,i[e])},1e3)}},changeEndTime(e,t={},o){clearInterval(this.countdownInterval[e]),void 0!==this.elements[e]&&(this.updateCountdown(e,t,o),this.countdownInterval[e]=setInterval(()=>{this.updateCountdown(e,t,o)},1e3))},getElement(e){let t=document.querySelector(e);const o=document.querySelector('iframe[name="editor-canvas"]');return t=o&&o.contentDocument?o.contentDocument.querySelector(e):t},updateCountdown(r,a,c=null){if(c){let e,t,o;const h=c.querySelector(".wp-block-uagb-countdown__time-seconds");a?.showDays&&(e=c.querySelector(".wp-block-uagb-countdown__time-days")),a?.showHours&&(t=c.querySelector(".wp-block-uagb-countdown__time-hours")),a?.showMinutes&&(o=c.querySelector(".wp-block-uagb-countdown__time-minutes"));var l=new Date,l=new Date(a.endDateTime)-l,d=l<0,u=Math.floor(l/1e3/60/60/24);let n=Math.floor(l/1e3/60/60)%24,i=Math.floor(l/1e3/60)%60,s=Math.floor(l/1e3)%60;a?.showDays||(n+=24*u),a?.showHours||(i+=60*n),a?.showMinutes||(s+=60*i),a?.showDays&&e&&(e.innerHTML=d?0:u),a?.showHours&&t&&(t.innerHTML=d?0:n),a?.showMinutes&&o&&(o.innerHTML=d?0:i),h&&(h.innerHTML=d?0:s),d&&(clearInterval(this.countdownInterval[r]),"redirect"!==a?.timerEndAction&&"hide"!==a?.timerEndAction||!a?.isFrontend||(window.UAGBCountdownTimeSignal[r]=!0));l="spectraPageReloaded_"+r,u="true"===this.getCookie(l),r=""!==a?.resetDays&&0<a.resetDays?a.resetDays:30;if(a?.isFrontend&&(u&&!d&&"false"!==this.getCookie(l)&&this.createCookie(l,"false",0,"days"),!u&&d&&"content"===a?.timerEndAction&&a?.reloadOnExpire&&a?.autoReload&&(location.reload(),this.createCookie(l,"true",r,"days")),d&&"content"===a?.timerEndAction&&!a?.reloadOnExpire&&!a?.autoReload)){const m=["days","hours","minutes","seconds"],g=m.map(e=>c.querySelector(".wp-block-uagb-countdown__box-"+e)),w=c.querySelector(".uagb-block-countdown-innerblocks-"+a.block_id);w.style.display="block",g.forEach(e=>{e&&(e.style.display="none")})}}},getEvergreenEndDate(e,t,o){const n=new Date,i=new Date(n.getTime()+60*(24*e*60+60*t+o)*1e3);return i.toISOString().replace(/\.\d{3}Z$/,"Z")}};