PageSourceSearch

https://hcpro.com/app/themes/hcpro/assets/js/custom.js

js hcpro.com collected 2026-10-03 23:05:21 UTC 7,007 bytes, 223 lines download raw bytes

1jQuery(document).ready(function() {
2    AOS.init();
3
4    
5    jQuery(".filter-check-aj input[type='checkbox']").click(function(){
6        jQuery(".filter-check-aj input[type='checkbox']").prop('checked', false);
7        jQuery(this).prop('checked', true);
8        var  var_cat_1  = jQuery(".filter-check-aj input[type='checkbox']:checked").val();
9        var  var_cat_2 = jQuery(".filter-check-post input[type='checkbox']:checked").val();
10        jQuery("#pagination_current").val('1');
11        ajax_resource(var_cat_1, var_cat_2, 1);
12    });
13
14    jQuery(".filter-check-post input[type='checkbox']").click(function(){
15        jQuery(".filter-check-post input[type='checkbox']").prop('checked', false);
16        jQuery(this).prop('checked', true);
17        var  var_cat_1  = jQuery(".filter-check-aj input[type='checkbox']:checked").val();
18        var  var_cat_2 = jQuery(".filter-check-post input[type='checkbox']:checked").val();
19        jQuery("#pagination_current").val('1');
20        ajax_resource(var_cat_1, var_cat_2, 1);
21    });
22
23    jQuery(".load-ajax-btn a").click(function(){
24        var  var_cat_1  = jQuery(".filter-check-aj input[type='checkbox']:checked").val();
25        var  var_cat_2 = jQuery(".filter-check-post input[type='checkbox']:checked").val();
26        var  var_page = Number(jQuery("#pagination_current").val()) + 1;
27        jQuery("#pagination_current").val(var_page);
28        ajax_resource_add(var_cat_1, var_cat_2, var_page);
29    });
30    
31
32    function ajax_resource(category_res,  type_resource, paged_current){
33        jQuery.ajax({
34            type: "post",
35            url: blog.ajaxurl,
36            data: {
37                action: "resource_by_ajax",
38                category_res: category_res,
39                type_resource: type_resource,
40                paged_current: paged_current
41            },
42
43            error: function (response) {
44            },
45
46            success: function (response) {
47                jQuery('.results-filtered').html(response);
48                var  current_p =  Number(jQuery("#pagination_next_empty").val());
49                if(paged_current >= current_p){
50                    jQuery(".load-ajax-btn").hide();
51                }else{
52                    jQuery(".load-ajax-btn").show();
53                }
54            }
55        });
56    }
57    function ajax_resource_add(category_res,  type_resource, paged_current){
58        jQuery.ajax({
59            type: "post",
60            url: blog.ajaxurl,
61            data: {
62                action: "resource_by_ajax",
63                category_res: category_res,
64                type_resource: type_resource,
65                paged_current: paged_current
66            },
67
68            error: function (response) {
69            },
70
71            success: function (response) {
72                
73                jQuery('.results-filtered').append(response);
74
75                jQuery('.results-filtered')
76               var  current_p =  Number(jQuery("#pagination_next_empty").val());
77                if(paged_current >= current_p){
78                    jQuery(".load-ajax-btn").hide();
79                }else{
80                    jQuery(".load-ajax-btn").show();
81                }
82            }
83        });
84    }
85
86  
87    jQuery(document).on('click', '.menu-toggle', function(e) {
88        e.preventDefault();
89        jQuery('.mega-dropdown').toggleClass( 'menu-open' );
90        jQuery('.mega-dropdown').toggle( 500 );
91        jQuery(this).toggleClass( 'menu-icon-active' );
92
93    });
94
95    jQuery(document).on('click', '.site-header .search', function(e) {
96        e.preventDefault();
97        jQuery('.header-search').toggleClass( 'search-open' );
98        jQuery('.header-search').toggle( 500 );
99        jQuery(this).toggleClass( 'menu-open' );
100
101    });
102
103    jQuery("#primary-menu > li > a").click(function(){
104        if(jQuery(this).parent().hasClass('show-submenu')){
105            jQuery(this).parent().removeClass('show-submenu');
106        }else{
107            jQuery(this).parent().addClass('show-submenu')
108        }
109
110
111    });
112
113    /** Home page */
114    if( jQuery('.hero-home').length > 0 ) {
115        jQuery('.hero-home .hero-img').addClass('animate-arrow');
116    }
117     
118    
119
120    /**  slider Testimonials  **/
121    $('.testimonial-slider').slick({
122        dots: true,
123        arrows: false,
124        autoplay: true,
125        autoplaySpeed: 3500,
126    });
127
128    /****  load more  *****/
129    var page = 2;
130    jQuery( function($) {
131        jQuery( 'body' ).on( 'click', '.loadmore', function() {
132            var data = {
133                'action': 'load_posts_by_ajax',
134                'page': page,
135                'security': blog.security
136            };
137            jQuery.post( blog.ajaxurl, data, function( response ) {
138                if( $.trim(response) != '' ) {
139                    jQuery( '.blog-posts' ).append( response );
140                    page++;
141                } else {
142                    jQuery( '.loadmore' ).hide();
143                    jQuery( ".no-more-post" ).html( "No More Post Available" );
144                }
145            });
146        });
147    });
148
149    /*** resouces-page ***/
150    jQuery(".filter > h3").click(function(){
151        var parentCollapse = jQuery(this).parent();
152        parentCollapse.toggleClass('expanded');
153    });
154});
155
156/** Sticky header */
157(function($) {
158    const siteHeader = $('#masthead');
159    const adminBar = $('#wpadminbar');
160    const adminBarHeight = adminBar.height() || 0;
161    const adminBarPosition = adminBar.css('position') || 'fixed';
162
163    $(window).on('scroll', function() {
164        let scrollTop = $(this).scrollTop();
165
166        if (adminBarPosition == 'fixed') {
167            return;
168        }
169
170        if (scrollTop <= adminBarHeight) {
171            siteHeader.css({
172                top: (adminBarHeight - scrollTop) + 'px'
173            });
174        } else {
175            siteHeader.css({
176                top: 0
177            });
178        }
179    });
180})(jQuery);
181
182/** Consultation form */
183(function($) {
184    const body = $('body');
185    const overlay = $('#consultation-form-overlay');
186    const adminBar = $('#wpadminbar');
187
188    $('[data-toggle="consultation-form"]').on('click', function(e) {
189        e.preventDefault();
190
191        overlay.fadeIn().css({
192            display: 'flex',
193            top: adminBar.height() || 0
194        });
195        body.css('overflow', 'hidden');
196    });
197
198    $('.consultation-form-close').on('click', function() {
199        overlay.fadeOut();
200        body.css('overflow', 'auto');
201    });
202})(jQuery);
203
204(function($) {
205    const body = $('body');
206    const overlay = $('#consultation-form-overlay-home');
207    const adminBar = $('#wpadminbar');
208
209    $('[data-toggle="consultation-form-home"]').on('click', function(e) {
210        e.preventDefault();
211
212        overlay.fadeIn().css({
213            display: 'flex',
214            top: adminBar.height() || 0
215        });
216        body.css('overflow', 'hidden');
217    });
218
219    $('.consultation-form-close').on('click', function() {
220        overlay.fadeOut();
221        body.css('overflow', 'auto');
222    });
223})(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.