upskill-event-manager/assets/js/advanced-hooks.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
9.4 KiB
JavaScript

(i=>{AstraAdvancedHooks={init:function(){AstraAdvancedHooks.bind(),AstraAdvancedHooks.php_snippet_area(),AstraAdvancedHooks.action_description(),AstraAdvancedHooks.bind_tooltip(),AstraAdvancedHooks.initLayoutSettings(),AstraAdvancedHooks.timeDurationEnabled(),astraCustomHookVars.is_complete_package&&document.body.classList.contains("block-editor-page")&&wp.data.subscribe(function(){setTimeout(function(){AstraAdvancedHooks.code_editor_switcher()},1)})},timeDurationEnabled:function(){var d=i("#ast-advanced-time-duration-start-dt"),s=i("#ast-advanced-time-duration-end-dt"),e=i("#ast-advanced-time-duration-enabled");i(".ast-advanced-time-duration-enabled").toggle(e.is(":checked")),e.change(function(){i(".ast-advanced-time-duration-enabled").toggle(this.checked),this.checked||(d.val(""),s.val(""))}),d.datetimepicker({timeFormat:"HH:mm:ss",onClose:function(e,t){var a;""!==s.val()?(a=d.datetimepicker("getDate"),s.datetimepicker("getDate")<a&&s.datetimepicker("setDate",a)):s.val(e)},onSelect:function(e){s.datetimepicker("option","minDate",d.datetimepicker("getDate"))}}),s.datetimepicker({timeFormat:"HH:mm:ss",onClose:function(e,t){var a,o;""!==d.val()?(a=d.datetimepicker("getDate"),(o=s.datetimepicker("getDate"))<a&&d.datetimepicker("setDate",o)):d.val(e)},onSelect:function(e){d.datetimepicker("option","maxDate",s.datetimepicker("getDate"))}})},code_editor_switcher:function(){var e,t;i(".edit-post-header-toolbar .ast-advanced-hook-enable-php-wrapper").length||(e=i("#editor"),t=i(i("#astra-editor-button-switch-mode").html()),e.find(".edit-post-header-toolbar").append(t))},bind:function(){i("li#toplevel_page_"+astraCustomHookVars.home_slug+", li#toplevel_page_"+astraCustomHookVars.home_slug+" > a").removeClass("wp-not-current-submenu").addClass("wp-has-current-submenu"),i("li#toplevel_page_"+astraCustomHookVars.home_slug+' a[href="edit.php?post_type=astra-advanced-hook"]').parent().addClass("current"),i("li#menu-appearance.wp-has-current-submenu, li#menu-appearance.wp-has-current-submenu > a").removeClass("wp-has-current-submenu"),i('input[name="ast-advanced-hook-header[sticky]"]').on("change",AstraAdvancedHooks.stickyHeaderChanged),i('input[name="ast-advanced-hook-footer[sticky]"]').on("change",AstraAdvancedHooks.stickyFooterChanged),i('select[name="ast-advanced-hook-layout"]').on("change",AstraAdvancedHooks.layoutChanged),i('select[name="ast-advanced-hook-content[location]"]').on("change",AstraAdvancedHooks.contentLocationChanged)},bind_tooltip:function(){i(".ast-advanced-hook-heading-help").tooltip({content:function(){return i(this).prop("title")},tooltipClass:"ast-advanced-hook-ui-tooltip",position:{my:"center top",at:"center bottom+10"},hide:{duration:200},show:{duration:200}})},php_snippet_area:function(){var e=window.location.href,a=i(".ast-advanced-hook-enable-php-btn").children(".ast-advanced-hook-with-php");-1<e.indexOf("&code_editor")?(a.val("enabled"),i("body").addClass("astra-php-snippt-enabled")):-1<e.indexOf("&wordpress_editor")&&(a.val(""),i("body").removeClass("astra-php-snippt-enabled")),i(document).on("click",".ast-advanced-hook-enable-php-btn",function(e){e.preventDefault();var e=i(this).data("editor-type"),t=encodeURI(window.location.href);-1<t.indexOf("&code_editor")||"code_editor"==e?(a.val("enabled"),i("body").addClass("astra-php-snippt-enabled"),t=t.replace("&code_editor",""),window.location.replace(t+"&wordpress_editor")):-1<t.indexOf("&wordpress_editor")||"wordpress_editor"==e?(a.val(""),i("body").removeClass("astra-php-snippt-enabled"),t=t.replace("&wordpress_editor",""),window.location.replace(t+"&code_editor")):i("body").hasClass("block-editor-page")?window.location=t+"&code_editor":window.location=t+"&wordpress_editor"})},action_description:function(){i("#ast-advanced-hook-action").on("change",function(e){var t=i(this).next(".ast-advanced-hook-action-desc"),a=i(this).find("option:selected").attr("data-desc");"custom_hook"===i("#ast-advanced-hook-action").val()?i(".ast-custom-action-wrap").show():i(".ast-custom-action-wrap").hide(),void 0!==a&&""!=a?(t.removeClass("ast-no-desc"),t.text(a)):(t.addClass("ast-no-desc"),t.text(""))})},initLayoutSettings:function(){var e=i("#ast-advanced-hook-layout").val(),t=i("#ast-advanced-hook-action").val(),a=i('input[name="ast-advanced-hook-header[sticky]"]'),o=i('input[name="ast-advanced-hook-footer[sticky]"]'),d=i("#ast-advanced-hook-content-location").val();i(".ast-layout-content-after-blocks, .ast-layout-content-before-heading, .ast-layout-content-location-required, .ast-inside-content-notice").hide(),"header"==e?(i(".ast-layout-hooks-required").hide(),i(".ast-layout-header-required").show(),i(".ast-layout-required").show(),i(".ast-layout-footer-required").hide(),i(".ast-404-layout-required").hide()):"hooks"==e?(i(".ast-layout-header-required").hide(),i(".ast-layout-hooks-required").show(),i(".ast-layout-required").show(),i(".ast-layout-footer-required").hide(),i(".ast-404-layout-required").hide(),"custom_hook"===t?i(".ast-custom-action-wrap").show():i(".ast-custom-action-wrap").hide()):"footer"==e?(i(".ast-layout-header-required").hide(),i(".ast-layout-hooks-required").hide(),i(".ast-layout-footer-required").show(),i(".ast-layout-required").show(),i(".ast-404-layout-required").hide()):"404-page"==e?(i(".ast-404-layout-required").show(),i(".ast-target-rules-user").show(),i(".ast-layout-hooks-required").hide(),i(".ast-layout-header-required").hide(),i(".ast-layout-footer-required").hide(),i(".ast-target-rules-display").hide(),i(".ast-target-rules-exclude").hide()):"content"==e?(i(".ast-layout-content-required").show(),i(".ast-target-rules-user").show(),i(".ast-target-rules-display").show(),i(".ast-layout-content-location-required").show(),i(".ast-layout-hooks-required").hide(),i(".ast-layout-header-required").hide(),i(".ast-layout-footer-required").hide(),i(".ast-404-layout-required").hide(),i(".ast-inside-content-notice").show(),("after_blocks"===d?(i(".ast-layout-content-after-blocks").show(),i(".ast-inside-content-blocks-notice")):(i(".ast-layout-content-before-heading").show(),i(".ast-inside-content-heading-notice"))).show()):(i(".ast-layout-content-required").hide(),i(".ast-layout-footer-required").hide(),i(".ast-layout-header-required").hide(),i(".ast-layout-hooks-required").hide(),i(".ast-layout-required").hide(),i(".ast-404-layout-required").hide()),a.is(":checked")&&"header"==e?i(".ast-layout-header-sticky-required").show():i(".ast-layout-header-sticky-required").hide(),o.is(":checked")&&"footer"==e?i(".ast-layout-footer-sticky-required").show():i(".ast-layout-footer-sticky-required").hide()},stickyHeaderChanged:function(){i(this).is(":checked")?i(".ast-layout-header-sticky-required").show():i(".ast-layout-header-sticky-required").hide()},stickyFooterChanged:function(){i(this).is(":checked")?i(".ast-layout-footer-sticky-required").show():i(".ast-layout-footer-sticky-required").hide()},layoutChanged:function(){var e=i(this).val(),t=i("#ast-advanced-hook-content-location").val(),a=i('input[name="ast-advanced-hook-header[sticky]"]'),o=i('input[name="ast-advanced-hook-footer[sticky]"]');i(".ast-layout-content-after-blocks").hide(),i(".ast-layout-content-before-heading").hide(),i(".ast-layout-content-location-required").hide(),i(".ast-inside-content-notice").hide(),"header"==e?(i(".ast-layout-hooks-required").hide(),i(".ast-layout-footer-required").hide(),i(".ast-layout-header-required").show(),i(".ast-layout-required").show(),i(".ast-layout-content-required").hide(),i(".ast-404-layout-required").hide()):"hooks"==e?(i(".ast-layout-header-required").hide(),i(".ast-layout-footer-required").hide(),i(".ast-layout-hooks-required").show(),i(".ast-layout-required").show(),i(".ast-layout-content-required").hide(),i(".ast-404-layout-required").hide()):"footer"==e?(i(".ast-layout-header-required").hide(),i(".ast-layout-hooks-required").hide(),i(".ast-layout-footer-required").show(),i(".ast-layout-required").show(),i(".ast-layout-content-required").hide(),i(".ast-404-layout-required").hide()):"404-page"==e?(i(".ast-404-layout-required").show(),i(".ast-target-rules-user").show(),i(".ast-layout-hooks-required").hide(),i(".ast-layout-header-required").hide(),i(".ast-layout-footer-required").hide(),i(".ast-layout-content-required").hide(),i(".ast-target-rules-display").hide(),i(".ast-target-rules-exclude").hide()):"content"==e?(i(".ast-layout-content-required").show(),i(".ast-target-rules-user").show(),i(".ast-target-rules-display").show(),i(".ast-layout-hooks-required").hide(),i(".ast-layout-header-required").hide(),i(".ast-layout-footer-required").hide(),i(".ast-404-layout-required").hide(),i(".ast-layout-content-location-required").show(),i(".ast-inside-content-notice").show(),i("after_blocks"===t?".ast-layout-content-after-blocks":".ast-layout-content-before-heading").show()):(i(".ast-layout-content-required").hide(),i(".ast-layout-header-required").hide(),i(".ast-layout-footer-required").hide(),i(".ast-layout-hooks-required").hide(),i(".ast-layout-required").hide(),i(".ast-404-layout-required").hide(),i(".ast-layout-content-required").hide()),a.is(":checked")&&"header"==e?i(".ast-layout-header-sticky-required").show():i(".ast-layout-header-sticky-required").hide(),o.is(":checked")&&"footer"==e?i(".ast-layout-footer-sticky-required").show():i(".ast-layout-footer-sticky-required").hide()},contentLocationChanged:function(){"before_headings"==i(this).val()?(i(".ast-layout-content-after-blocks").hide(),i(".ast-layout-content-before-heading").show()):(i(".ast-layout-content-after-blocks").show(),i(".ast-layout-content-before-heading").hide())}},i(function(){AstraAdvancedHooks.init()})})(jQuery);