PageSourceSearch

https://shareshareu.com/wp-content/plugins/wp-jobsearch/js/job-functions.js?ver=1.5.7

js shareshareu.com collected 2026-10-04 15:07:26 UTC 36,023 bytes, 828 lines download raw bytes

1var jobFilterAjax;
2
3function jobsearch_job_content_load(counter, view_type, animate_to) {
4    //"use strict";
5
6    counter = counter || '';
7    animate_to = animate_to || '';
8    var view_type = view_type || '';
9    // move to top when search filter apply
10
11    var job_arg = jQuery("#job_arg" + counter).html();
12    var this_frm = jQuery("#jobsearch_job_frm_" + counter);
13
14
15    var split_map = jQuery(".wp-dp-split-map-wrap").size();
16    if (split_map > 0) {
17        view_type = 'split_map';
18    }
19
20    var ads_list_count = jQuery("#ads_list_count_" + counter).val();
21    var ads_list_flag = jQuery("#ads_list_flag_" + counter).val();
22    var list_flag_count = jQuery("#ads_list_flag_count_" + counter).val();
23    var current_page_id = jQuery("#current_page_id").val();
24    var loader_con = jQuery("#jobsearch-loader-" + counter);
25
26    //
27    if (jQuery("#jobsearch_job_frm_" + counter).length > 0) {
28
29        var data_vals = jQuery(jQuery("#jobsearch_job_frm_" + counter)[0].elements).not(":input[name='alerts-email'], :input[name='alert-frequency'], :input[name^='loc_count_qargs_']").serialize();
30
31        if (jQuery('form[name="jobsearch-top-map-form"]').length > 0) {
32            data_vals += "&" + jQuery('form[name="jobsearch-top-map-form"]').serialize();
33        }
34        data_vals = data_vals.replace(/[^&]+=\.?(?:&|$)/g, ''); // remove extra and empty variables
35        data_vals = data_vals.replace('undefined', ''); // remove extra and empty variables
36        data_vals = data_vals + '&ajax_filter=true';
37        data_vals = stripUrlParams(data_vals);
38
39        jQuery('#Job-content-' + counter + ' .job').addClass('slide-loader');
40        jQuery('#jobsearch-data-job-content-' + counter + ' .all-results').addClass('slide-loader');
41
42
43        if (typeof (jobFilterAjax) != 'undefined') {
44            jobFilterAjax.abort();
45        }
46        loader_con.html('<div class="jobsearch-listing-loader"><div class="spinner"><div class="bounce1"></div><div class="bounce2"></div><div class="bounce3"></div></div></div>');
47        var jobFilterAjax = jQuery.ajax({
48            type: 'POST',
49            dataType: 'HTML',
50            url: jobsearch_plugin_vars.ajax_url,
51            data: data_vals + '&action=jobsearch_jobs_content&view_type=' + view_type + '&job_arg=' + job_arg,
52            success: function (response) {
53                jQuery('body').removeClass('wp-dp-changing-view');
54                jQuery('#Job-content-' + counter).html(response);
55                // Replace double & from string.
56                data_vals = data_vals.replace("&&", "&");
57                var current_url = location.protocol + "//" + location.host + location.pathname + "?" + data_vals; //window.location.href;
58                current_url = current_url.replace('&=undefined', ''); // remove extra and empty variables
59                window.history.pushState(null, null, decodeURIComponent(current_url));
60                //jQuery(".chosen-select").chosen();
61                //jQuery('#jobsearch-data-job-content-' + counter + ' .all-results').removeClass('slide-loader');
62                //jobsearch_hide_loader();
63                // add class when image loaded
64                jQuery(".job-medium .img-holder img, .job-grid .img-holder img").one("load", function () {
65                    jQuery(this).parents(".img-holder").addClass("image-loaded");
66                }).each(function () {
67                    if (this.complete)
68                        jQuery(this).load();
69                });
70                if (jQuery(".job-medium.modern").length > 0) {
71                    var imageUrlFind = jQuery(".job-medium.modern .img-holder").css("background-image").match(/url\(["']?([^()]*)["']?\)/).pop();
72                    if (imageUrlFind) {
73                        jQuery(".job-medium.modern .img-holder").addClass("image-loaded");
74                    }
75                }
76
77                jQuery('.wp-dp-job-content').find('.selectize-select').selectize({
78                    //allowEmptyOption: true,
79                });
80                jQuery('.wp-dp-job-content').find('.sort-records-per-page').selectize({
81                    allowEmptyOption: true,
82                });
83                loader_con.html('');
84                // add class when image loaded
85            }
86        });
87    }
88}
89
90function jobsearch_job_content_load_without_filters(counter, page_var, page_num, ajax_filter, view_type) {
91    "use strict";
92    counter = counter || '';
93    var job_arg = jQuery("#job_arg" + counter).html();
94    var data_vals = page_var + '=' + page_num;
95    jQuery('#jobsearch-data-job-content-' + counter + ' .all-results').addClass('slide-loader');
96    if (typeof (jobFilterAjax) != 'undefined') {
97        jobFilterAjax.abort();
98    }
99    jobFilterAjax = jQuery.ajax({
100        type: 'POST',
101        dataType: 'HTML',
102        url: jobsearch_plugin_vars.ajax_url,
103        data: data_vals + '&action=jobsearch_jobs_content&view_type=' + view_type + '&job_arg=' + job_arg,
104        success: function (response) {
105            jQuery('#Job-content-' + counter).html(response);
106            // Replace double & from string.
107            data_vals = data_vals.replace("&&", "&");
108            var current_url = location.protocol + "//" + location.host + location.pathname + "?" + data_vals; //window.location.href;
109            window.history.pushState(null, null, decodeURIComponent(current_url));
110            jQuery('#jobsearch-data-job-content-' + counter + ' .all-results').removeClass('slide-loader');
111        }
112    });
113}
114
115function stripUrlParams(args) {
116    "use strict";
117    var parts = args.split("&");
118    var comps = {};
119    for (var i = parts.length - 1; i >= 0; i--) {
120        var spl = parts[i].split("=");
121        // Overwrite only if existing is empty.
122        if (typeof comps[spl[0]] == "undefined" || (typeof comps[spl[0]] != "undefined" && comps[spl[0]] == '')) {
123            comps[spl[0]] = spl[1];
124        }
125    }
126    parts = [];
127    for (var a in comps) {
128        parts.push(a + "=" + comps[a]);
129    }
130
131    return parts.join('&');
132}
133
134function jobsearch_job_filters_content(counter, page_var, page_num, tab) {
135    "use strict";
136    counter = counter || '';
137    var job_arg = jQuery("#job_arg" + counter).html();
138    var this_frm = jQuery("#jobsearch_job_frm_" + counter);
139
140    var ads_list_count = jQuery("#ads_list_count_" + counter).val();
141    var ads_list_flag = jQuery("#ads_list_flag_" + counter).val();
142    var list_flag_count = jQuery("#ads_list_flag_count_" + counter).val();
143    var data_vals = 'tab=' + tab + '&' + page_var + '=' + page_num + '&ajax_filter=true';
144    jQuery('#jobsearch-data-job-content-' + counter + ' .all-results').addClass('slide-loader');
145    if (typeof (jobFilterAjax) != 'undefined') {
146        jobFilterAjax.abort();
147    }
148    jobFilterAjax = jQuery.ajax({
149        type: 'POST',
150        dataType: 'HTML',
151        url: jobsearch_plugin_vars.ajax_url,
152        data: data_vals + '&action=jobsearch_jobs_filters_content&job_arg=' + job_arg,
153        success: function (response) {
154            console.log(response);
155            jQuery('#job-tab-content-' + counter).html(response);
156            jQuery("#job-tab-content-" + counter + ' .row').mixItUp({
157                selectors: {
158                    target: ".portfolio",
159                }
160            });
161            //replace double & from string
162            data_vals = data_vals.replace("&&", "&");
163            var current_url = location.protocol + "//" + location.host + location.pathname + "?" + data_vals; //window.location.href;
164            window.history.pushState(null, null, decodeURIComponent(current_url));
165            jQuery(".chosen-select").chosen();
166            jQuery('#jobsearch-data-job-content-' + counter + ' .all-results').removeClass('slide-loader');
167            // add class when image loaded
168            jQuery(".job-medium .img-holder img, .job-grid .img-holder img").one("load", function () {
169                jQuery(this).parents(".img-holder").addClass("image-loaded");
170            }).each(function () {
171                if (this.complete)
172                    $(this).load();
173            });
174            // add class when image loaded
175        }
176    });
177
178}
179
180function jobsearch_job_by_categories_filters_content(counter, page_var, page_num, tab) {
181    "use strict";
182    counter = counter || '';
183    var job_arg = jQuery("#job_arg" + counter).html();
184    var this_frm = jQuery("#jobsearch_job_frm_" + counter);
185
186    var ads_list_count = jQuery("#ads_list_count_" + counter).val();
187    var ads_list_flag = jQuery("#ads_list_flag_" + counter).val();
188    var list_flag_count = jQuery("#ads_list_flag_count_" + counter).val();
189    var data_vals = 'tab=' + tab + '&' + page_var + '=' + page_num + '&ajax_filter=true';
190    jQuery('#jobsearch-data-job-content-' + counter + ' .all-results').addClass('slide-loader');
191    if (typeof (jobFilterAjax) != 'undefined') {
192        jobFilterAjax.abort();
193    }
194    jobFilterAjax = jQuery.ajax({
195        type: 'POST',
196        dataType: 'HTML',
197        url: jobsearch_plugin_vars.ajax_url,
198        data: data_vals + '&action=jobsearch_job_by_categories_filters_content&job_arg=' + job_arg,
199        success: function (response) {
200            jQuery('#job-tab-content-' + counter).html(response);
201            jQuery("#job-tab-content-" + counter + ' .row').mixItUp({
202                selectors: {
203                    target: ".portfolio",
204                }
205            });
206            //replace double & from string
207            data_vals = data_vals.replace("&&", "&");
208            var current_url = location.protocol + "//" + location.host + location.pathname + "?" + data_vals; //window.location.href;
209            window.history.pushState(null, null, decodeURIComponent(current_url));
210            jQuery(".chosen-select").chosen();
211            jQuery('#jobsearch-data-job-content-' + counter + ' .all-results').removeClass('slide-loader');
212            // add class when image loaded
213            jQuery(".job-medium .img-holder img, .job-grid .img-holder img").one("load", function () {
214                jQuery(this).parents(".img-holder").addClass("image-loaded");
215            }).each(function () {
216                if (this.complete)
217                    $(this).load();
218            });
219            // add class when image loaded
220        }
221    });
222
223}
224
225function convertHTML(html) {
226    "use strict";
227    var newHtml = $.trim(html),
228        $html = $(newHtml),
229        $empty = $();
230
231    $html.each(function (index, value) {
232        if (value.nodeType === 1) {
233            $empty = $empty.add(this);
234        }
235    });
236
237    return $empty;
238}
239
240function jobsearch_job_type_search_fields(thisObj, counter, price_switch, view_type) {
241    var view_type = view_type || '';
242    "use strict";
243    jQuery.ajax({
244        type: 'POST',
245        dataType: 'json',
246        url: jobsearch_plugin_vars.ajax_url,
247        data: '&action=jobsearch_job_type_search_fields&job_short_counter=' + counter + '&job_type_slug=' + thisObj.value + '&price_switch=' + price_switch + '&view_type=' + view_type,
248        success: function (response) {
249            jQuery('#job_type_fields_' + counter).html('');
250            jQuery('#job_type_fields_' + counter).html(response.html);
251        }
252    });
253
254    var checkID = thisObj.getAttribute('id');
255
256    var cat_name = $('#' + checkID).next('label').html();
257
258    $('.map-search-keyword-type-holder .dropdown-types-btn').html(cat_name);
259
260    var dropdownHolder = $('.map-search-keyword-type-holder');
261    var dropdownCon = dropdownHolder.find('ul.dropdown-types');
262    dropdownCon.slideUp();
263}
264
265function jobsearch_job_type_cate_fields(thisObj, counter, cats_switch, view, color) {
266    "use strict";
267    if (typeof view === 'undefined') {
268        view = 'default';
269    }
270    if (typeof color === 'undefined') {
271        color = 'none';
272    }
273    var cate_loader = '<b class="spinner-label">' + jobsearch_job_functions_string.job_type + '</b><span class="cate-spinning"><i class="fancy-spinner"></i></span>';
274    jQuery('#job_type_cate_fields_' + counter).html(cate_loader);
275    jQuery.ajax({
276        type: 'POST',
277        dataType: 'json',
278        url: jobsearch_plugin_vars.ajax_url,
279        data: '&action=jobsearch_job_type_cate_fields&job_short_counter=' + counter + '&job_type_slug=' + thisObj.value + '&view=' + view + '&color=' + color + '&cats_switch=' + cats_switch,
280        success: function (response) {
281            jQuery('#job_type_cate_fields_' + counter).html('');
282            jQuery('#job_type_cate_fields_' + counter).html(response.html);
283        }
284    });
285}
286
287function jobsearch_job_type_split_map_search_fields(thisObj, counter) {
288
289    var view_type = view_type || '';
290    "use strict";
291    jQuery.ajax({
292        type: 'POST',
293        dataType: 'json',
294        url: jobsearch_plugin_vars.ajax_url,
295        data: '&action=jobsearch_job_type_split_map_search_fields&job_short_counter=' + counter + '&job_type_slug=' + thisObj.value,
296        success: function (response) {
297            jQuery('#job_type_fields_' + counter).html('');
298            jQuery('#job_type_fields_' + counter).html(response.html);
299        }
300    }).done(function () {
301        jobsearch_job_type_split_map_cate_fields(thisObj.value, counter);
302    });
303
304    var checkID = thisObj.getAttribute('id');
305    var cat_name = $('#' + checkID).next('label').html();
306    $('.map-search-keyword-type-holder .dropdown-types-btn').html(cat_name);
307
308    var dropdownHolder = $('.map-search-keyword-type-holder');
309    var dropdownCon = dropdownHolder.find('ul.dropdown-types');
310    dropdownCon.slideUp();
311}
312
313function jobsearch_job_type_split_map_cate_fields(thisObj, counter, cats_switch, view, color) {
314    "use strict";
315    if (typeof view === 'undefined') {
316        view = 'default';
317    }
318    if (typeof color === 'undefined') {
319        color = 'none';
320    }
321    var cate_loader = '<b class="spinner-label">' + jobsearch_job_functions_string.job_type + '</b><span class="cate-spinning"><i class="fancy-spinner"></i></span>';
322    jQuery('#job_type_cate_fields_' + counter).html(cate_loader);
323    jQuery.ajax({
324        type: 'POST',
325        dataType: 'json',
326        url: jobsearch_plugin_vars.ajax_url,
327        data: '&action=jobsearch_job_type_split_map_cate_fields&job_short_counter=' + counter + '&job_type_slug=' + thisObj.value + '&view=' + view + '&color=' + color,
328        success: function (response) {
329            jQuery('#job_type_cate_fields_' + counter).html('');
330            jQuery('#job_type_cate_fields_' + counter).html(response.html);
331        }
332    }).done(function () {
333        jobsearch_split_map_change_cords(counter);
334    });
335}
336
337function jobsearch_split_map_change_cords(counter, hide_overlay) {
338    "use strict";
339    var hide_overlay = hide_overlay || '';
340    if (hide_overlay === 'true') {
341        //jQuery(".main-search.split-map .field-holder.more-filters-btn").toggleClass('open');
342        //jQuery("div.split-map-overlay").remove();
343        //jQuery('#job_type_fields_'+ counter ).toggle('slow');
344        //jQuery(".main-search.split-map .adv_filter_toggle").val('false');
345    }
346    var top_map = jQuery('.wp-dp-ontop-gmap');
347    var loader_div = jQuery('.wp-dp-splitmap-advance-filter_' + counter);
348    var loader_html = '<div class="split-map-loader"><span><i class="fancy-spinner"></i></span></div>';
349    if (loader_div.length !== 0) {
350        loader_div.html(loader_html);
351    }
352    if (top_map.length !== 0) {
353        var ajax_url = jobsearch_plugin_vars.ajax_url;
354        var data_vals = 'ajax_filter=true&map=top_map&action=jobsearch_top_map_search&' + jQuery(jQuery("#jobsearch_job_frm_" + counter)[0].elements).not(":input[name='alerts-email'], :input[name='alert-frequency']").serialize();
355        if (jQuery('form[name="wp-dp-top-map-form"]').length > 0) {
356            data_vals += "&" + jQuery('form[name="wp-dp-top-map-form"]').serialize() + '&atts=' + jQuery('#atts').html();
357        }
358        data_vals = stripUrlParams(data_vals);
359        var loading_top_map = $.ajax({
360            url: ajax_url,
361            method: "POST",
362            data: data_vals,
363            dataType: "json"
364        }).done(function (response) {
365            if (typeof response.html !== 'undefined') {
366                jQuery('.top-map-action-scr').html(response.html);
367            }
368            jobsearch_job_split_map_content(counter, '', '', hide_overlay);
369        }).fail(function () {
370        });
371    }
372}
373
374function removeURLParameter(url, parameter) {
375    //prefer to use l.search if you have a location/link object
376    var urlparts = url.split('?');
377    if (urlparts.length >= 2) {
378
379        var prefix = encodeURIComponent(parameter) + '=';
380        var pars = urlparts[1].split(/[&;]/g);
381
382        //reverse iteration as may be destructive
383        for (var i = pars.length; i-- > 0;) {
384            //idiom for string.startsWith
385            if (pars[i].lastIndexOf(prefix, 0) !== -1) {
386                pars.splice(i, 1);
387            }
388        }
389
390        url = urlparts[0] + '?' + pars.join('&');
391        return url;
392    } else {
393        return url;
394    }
395}
396
397function jobsearch_job_split_map_content(counter, view_type, animate_to, hide_overlay) {
398    //"use strict";
399
400    counter = counter || '';
401    var hide_overlay = hide_overlay || '';
402    animate_to = animate_to || '';
403    var view_type = view_type || '';
404    var loader_div = jQuery('.wp-dp-splitmap-advance-filter_' + counter);
405    var loader_html = '<div class="split-map-loader"><span><i class="fancy-spinner"></i></span></div>';
406    // move to top when search filter apply
407
408    if (animate_to != 'false') {
409        jQuery('html, body').animate({
410            scrollTop: jQuery("#wp-dp-job-content-" + counter).offset().top - 120
411        }, 700);
412    }
413    var job_arg = jQuery("#job_arg" + counter).html();
414    var this_frm = jQuery("#jobsearch_job_frm_" + counter);
415
416
417    var split_map = jQuery(".wp-dp-split-map-wrap").size();
418    if (split_map > 0) {
419        view_type = 'split_map';
420    }
421
422    var ads_list_count = jQuery("#ads_list_count_" + counter).val();
423    var ads_list_flag = jQuery("#ads_list_flag_" + counter).val();
424    var list_flag_count = jQuery("#ads_list_flag_count_" + counter).val();
425
426    if (jQuery("#jobsearch_job_frm_" + counter).length > 0) {
427        var data_vals = jQuery(jQuery("#jobsearch_job_frm_" + counter)[0].elements).not(":input[name='alerts-email'], :input[name='alert-frequency']").serialize();
428        var data_vals = 'ajax_filter=true&map=top_map&action=jobsearch_top_map_search&' + jQuery(jQuery("#jobsearch_job_frm_" + counter)[0].elements).not(":input[name='alerts-email'], :input[name='alert-frequency']").serialize();
429        if (jQuery('form[name="wp-dp-top-map-form"]').length > 0) {
430            data_vals += "&" + jQuery('form[name="wp-dp-top-map-form"]').serialize();
431        }
432        data_vals = data_vals.replace(/[^&]+=\.?(?:&|$)/g, ''); // remove extra and empty variables
433        data_vals = data_vals.replace('undefined', ''); // remove extra and empty variables
434        data_vals = data_vals + '&ajax_filter=true';
435        data_vals = stripUrlParams(data_vals);
436        if (!jQuery('body').hasClass('wp-dp-changing-view')) {
437            // top map
438            //top_map_change_cords(counter);
439        }
440
441        if (hide_overlay === 'true') {
442            data_vals = removeURLParameter(data_vals, 'adv_filter_toggle');
443            data_vals = data_vals.replace('adv_filter_toggle=true', 'adv_filter_toggle=false');
444        }
445
446        jQuery('#Job-content-' + counter + ' .job').addClass('slide-loader');
447        jQuery('#jobsearch-data-job-content-' + counter + ' .all-results').addClass('slide-loader');
448        //if (typeof (jobFilterAjax) !== 'undefined') {
449        //    jobFilterAjax.abort();
450        //}
451
452        var jobFilterAjax = jQuery.ajax({
453            type: 'POST',
454            dataType: 'HTML',
455            url: jobsearch_plugin_vars.ajax_url,
456            data: data_vals + '&action=jobsearch_jobs_content&view_type=' + view_type + '&job_arg=' + job_arg,
457            success: function (response) {
458                jQuery('body').removeClass('wp-dp-changing-view');
459                jQuery('#Job-content-' + counter).html(response);
460
461                if (hide_overlay === 'false' && hide_overlay !== '') {
462                    jQuery('#wp-jobsearch-job-' + counter).hide();
463                    jQuery('.no-job-match-error').hide();
464                    jQuery('.page-nation').hide();
465                }
466                if (hide_overlay === 'true' && hide_overlay !== '') {
467                    //jQuery(".main-search.split-map .field-holder.more-filters-btn").toggleClass('open');
468                    jQuery("div.split-map-overlay").remove();
469                    //jQuery('#job_type_fields_'+ counter ).toggle('slow');
470                }
471
472                // Replace double & from string.
473                data_vals = data_vals.replace("&&", "&");
474                var current_url = location.protocol + "//" + location.host + location.pathname + "?" + data_vals; //window.location.href;
475                current_url = current_url.replace('&=undefined', ''); // remove extra and empty variables
476                window.history.pushState(null, null, decodeURIComponent(current_url));
477                jQuery(".chosen-select").chosen();
478                jQuery('#jobsearch-data-job-content-' + counter + ' .all-results').removeClass('slide-loader');
479                jobsearch_hide_loader();
480                // add class when image loaded
481                jQuery(".job-medium .img-holder img, .job-grid .img-holder img").one("load", function () {
482                    jQuery(this).parents(".img-holder").addClass("image-loaded");
483                }).each(function () {
484                    if (this.complete)
485                        jQuery(this).load();
486                });
487                if (jQuery(".job-medium.modern").length > 0) {
488                    var imageUrlFind = jQuery(".job-medium.modern .img-holder").css("background-image").match(/url\(["']?([^()]*)["']?\)/).pop();
489                    if (imageUrlFind) {
490                        jQuery(".job-medium.modern .img-holder").addClass("image-loaded");
491                    }
492                }
493
494                // add class when image loaded
495
496                if (loader_div.length !== 0) {
497                    loader_div.html('');
498                }
499            }
500        });
501    }
502}
503
504function jobsearch_empty_loc_polygon(counter) {
505    if (jQuery("#jobsearch_job_frm_" + counter + " input[name=loc_polygon_path]").length) {
506        jQuery("#jobsearch_job_frm_" + counter + " input[name=loc_polygon_path]").val('');
507    }
508}
509
510function jobsearch_job_view_switch(view, counter, job_short_counter, view_type) {
511    "use strict";
512    var view_type = view_type || '';
513    jQuery.ajax({
514        type: 'POST',
515        dataType: 'HTML',
516        url: jobsearch_plugin_vars.ajax_url,
517        data: '&action=jobsearch_job_view_switch&view=' + view + '&job_short_counter=' + job_short_counter,
518        success: function () {
519            jQuery('[data-toggle="popover"]').popover();
520            jQuery('body').addClass('wp-dp-changing-view');
521            jobsearch_job_content(counter, view_type);
522        }
523    });
524}
525
526function jobsearch_job_pagenation_ajax(page_var, page_num, counter, ajax_filter, view_type) {
527    "use strict";
528    var view_type = view_type || '';
529    jQuery('html, body').animate({
530        scrollTop: jQuery("#wp-dp-job-content-" + counter).offset().top - 120
531    }, 1000);
532    jQuery('#' + page_var + '-' + counter).val(page_num);
533    jobsearch_job_content_load(counter, view_type);
534    //alert("aaaaaaaa");
535//    if (ajax_filter == 'false') {
536//        if (view_type == "split_map") {
537//            jobsearch_job_content_load(counter, view_type);
538//        } else {
539//            jobsearch_job_content_load_without_filters(counter, page_var, page_num, ajax_filter, view_type);
540//        }
541//    } else {
542//        jobsearch_job_content_load(counter, view_type);
543//    }
544}
545
546function jobsearch_job_filters_pagenation_ajax(page_var, page_num, counter, tab) {
547    "use strict";
548    jQuery('#' + page_var + '-' + counter).val(page_num);
549    jobsearch_job_filters_content(counter, page_var, page_num, tab);
550}
551
552function jobsearch_job_by_category_filters_pagenation_ajax(page_var, page_num, counter, tab) {
553    "use strict";
554    jQuery('#' + page_var + '-' + counter).val(page_num);
555    jobsearch_job_by_categories_filters_content(counter, page_var, page_num, tab);
556}
557
558function jobsearch_advanced_search_field(counter, tab, element) {
559    "use strict";
560    if (tab == 'simple') {
561        jQuery('#job_type_fields_' + counter).slideUp();
562        jQuery('#nav-tabs-' + counter + ' li').removeClass('active');
563        jQuery(element).parent().addClass('active');
564    } else if (tab == 'advance') {
565        jQuery('#job_type_fields_' + counter).slideDown();
566        jQuery('#nav-tabs-' + counter + ' li').removeClass('active');
567        jQuery(element).parent().addClass('active');
568    } else {
569        jQuery('#job_type_fields_' + counter).slideToggle();
570
571        if (jQuery(".main-search.split-map .field-holder.more-filters-btn").length > 0) {
572            jQuery('.main-search.split-map .field-holder.more-filters-btn').toggleClass('open');
573            if (jQuery('.main-search.split-map .field-holder.more-filters-btn').hasClass('open')) {
574                var NewContent = '<div class="split-map-overlay"></div>';
575                jQuery(".wp-dp-top-map-holder").after(NewContent);
576                jQuery('#wp-jobsearch-job-' + counter).hide();
577                jQuery('.page-nation').hide();
578                jQuery('.no-job-match-error').hide();
579            } else {
580                jQuery("div.split-map-overlay").remove();
581                jQuery('#wp-jobsearch-job-' + counter).show();
582                jQuery('.page-nation').show();
583                jQuery('.no-job-match-error').show();
584            }
585        }
586    }
587}
588
589if (jQuery(".main-search.split-map .field-holder.more-filters-btn").length > 0) {
590    function jobsearch_split_map_close_search(counter) {
591        jQuery(".main-search.split-map .field-holder.more-filters-btn").toggleClass('open');
592        jQuery("div.split-map-overlay").remove();
593        jQuery('#job_type_fields_' + counter).toggle('slow');
594        jQuery('#wp-jobsearch-job-' + counter).show();
595        jQuery('.page-nation').show();
596        jQuery('.no-job-match-error').show();
597    }
598}
599
600function jobsearch_search_features(element, counter) {
601    "use strict";
602    jQuery('#job_type_fields_' + counter + ' .features-field-expand').slideToggle();
603    var expand_class = jQuery('#job_type_fields_' + counter + ' .features-list .advance-trigger').find('i').attr('class');
604    if (expand_class == 'icon-plus') {
605        console.log(expand_class);
606        jQuery('#job_type_fields_' + counter + ' .features-list .advance-trigger').find('i').removeClass(expand_class).addClass('icon-minus')
607    } else {
608        jQuery('#job_type_fields_' + counter + ' .features-list .advance-trigger').find('i').removeClass(expand_class).addClass('icon-plus')
609    }
610}
611
612
613jQuery(document).on('click', '.dev-job-list-enquiry-own-job', function (e) {
614    e.stopImmediatePropagation();
615    var msg_obj = {msg: jobsearch_plugin_vars.own_job_error, type: 'error'};
616    jobsearch_show_response(msg_obj);
617});
618
619
620/*
621 * Enquiries Block
622 */
623
624jQuery(document).ready(function () {
625    if (jQuery('#enquires-sidebar-panel').length > 0) {
626        enquiry_sidebar_arrow();
627    }
628});
629
630//
631if (jQuery('.jobsearch-advance-search-holdr').length > 0) {
632    var top_srch_holder = jQuery('.jobsearch-advance-search-holdr');
633    var srch_form_id = top_srch_holder.parent('form').attr('id');
634    jQuery(document).on('submit', 'form#' + srch_form_id, function () {
635        top_srch_holder.find('.adv-search-options').find('input, select').each(function () {
636            var this_form_itm = $(this);
637            if (typeof this_form_itm.attr('name') !== 'undefined' && typeof this_form_itm.attr('type') !== 'undefined' && (this_form_itm.attr('type') == 'checkbox' || this_form_itm.attr('type') == 'radio')) {
638                if (this_form_itm.is(':checked')) {
639                    jQuery('form#' + srch_form_id).append('<input type="hidden" name="' + this_form_itm.attr('name') + '" value="' + this_form_itm.val() + '">');
640                }
641            } else if (typeof this_form_itm.attr('name') !== 'undefined' && typeof this_form_itm.attr('type') === 'undefined') { // for select field
642                jQuery('form#' + srch_form_id).append('<input type="hidden" name="' + this_form_itm.attr('name') + '" value="' + this_form_itm.val() + '">');
643            }
644        });
645    });
646}
647jQuery(document).on('click', '.adv-srch-toggle-btn', function () {
648    jQuery(this).parents('.jobsearch-advance-search-holdr').find('.adv-search-options').slideToggle();
649    var slider_input_con = jQuery(this).parents('.jobsearch-advance-search-holdr').find('.adv-search-options').find('.filter-slider-range');
650    var def_radius_val = slider_input_con.find('#loc-def-radiusval').val();
651    slider_input_con.find('input[name=loc_radius]').val(def_radius_val);
652});
653
654function enquiry_sidebar_arrow() {
655    jQuery('.fixed-sidebar-panel.left .sidebar-panel-btn').click(function (e) {
656        e.preventDefault();
657        if (jQuery('#enquires-sidebar-panel').hasClass('sidebar-panel-open')) {
658            jQuery('#enquires-sidebar-panel').removeClass('sidebar-panel-open');
659        } else {
660            jQuery('#enquires-sidebar-panel').addClass('sidebar-panel-open');
661        }
662    });
663    jQuery('#enquires-sidebar-panel .sidebar-panel-title .sidebar-panel-btn-close').click(function (e) {
664        jQuery('#enquires-sidebar-panel').removeClass('sidebar-panel-open');
665    });
666}
667
668/*
669 * Enquiry Reset all Multiple select
670 */
671
672jQuery(document).on('click', '.send-message-submit-btn', function () {
673    var thisObj = jQuery(this);
674
675    var rand_id = thisObj.data('randid');
676    var action = thisObj.data('action');
677    var form_id = jQuery("#jobsearch_send_message_form" + rand_id);
678    var meessage_box = jQuery(".message-box-" + rand_id);
679    var serializeForm = form_id.serialize();
680
681    var get_terr_val = jobsearch_accept_terms_cond_pop(form_id);
682    if (get_terr_val != 'yes') {
683        return false;
684    }
685    thisObj.attr("disabled", true);
686
687    meessage_box.html('<div class="split-map-loader"><span><i class="fa fa-spin fa fa-refresh"></i></span></div>');
688    meessage_box.show();
689
690    jQuery.ajax({
691        type: 'POST',
692        dataType: 'JSON',
693        url: jobsearch_plugin_vars.ajax_url,
694        data: 'action=' + action + '&' + serializeForm,
695        success: function (response) {
696            //
697            meessage_box.css({'color': '#ffffff'});
698            meessage_box.html(response.html);
699            if (response.error == '1') {
700                meessage_box.css({'background-color': '#ff0000'});
701            } else {
702                meessage_box.css({'background-color': '#32cd32'});
703                form_id[0].reset();
704            }
705        }
706
707    });
708    thisObj.removeAttr("disabled");
709    return false;
710});
711
712//***************************
713// FilterAble Function
714//***************************
715
716jQuery(window).on('load', function () {
717
718    if (jQuery('.careerfy-animated-filter-list,.careerfy-product-grid').length > 0) {
719
720        var $grid = $('.careerfy-animated-filter-list,.careerfy-product-grid').isotope({
721            itemSelector: '.element-item',
722            layoutMode: 'fitRows'
723        });
724        // filter functions
725        var filterFns = {
726            // show if number is greater than 50
727            numberGreaterThan50: function () {
728                var number = $(this).find('.number').text();
729                return parseInt(number, 10) > 50;
730            },
731            // show if name ends with -ium
732            ium: function () {
733                var name = $(this).find('.name').text();
734                return name.match(/ium$/);
735            }
736        };
737        // bind filter button click
738        $('.filters-button-group,.filters-button-group-two').on('click', 'a', function () {
739            var filterValue = $(this).attr('data-filter');
740            console.info(filterValue);
741            // use filterFn if matches value
742            filterValue = filterFns[filterValue] || filterValue;
743            $grid.isotope({filter: filterValue});
744        });
745        // change is-checked class on buttons
746        $('.filters-button-group,.filters-button-group-two').each(function (i, buttonGroup) {
747            var $buttonGroup = $(buttonGroup);
748            $buttonGroup.on('click', 'a', function () {
749                $buttonGroup.find('.is-checked').removeClass('is-checked');
750                $(this).addClass('is-checked');
751            });
752        });
753    }
754
755});
756
757jQuery(document).on('click', '#jobsearch-jobadvserach-submit', function (ev) {
758    ev.preventDefault();
759    var _thisForm = jQuery(this).parents('form');
760    var formToSubmit = setInterval(function () {
761        var lubricForm = _thisForm.find('input,select,textarea');
762
763        jQuery.each(lubricForm, function () {
764            var thisFieldObj = jQuery(this);
765            if (typeof thisFieldObj.attr('name') !== 'undefined') {
766                console.info(thisFieldObj);
767                var thisFieldName = thisFieldObj.attr('name');
768                if (thisFieldObj.val() == ''
769                    || thisFieldName.indexOf("alert-") != -1
770                    || thisFieldName.indexOf("loc_count_qargs") != -1
771                    || thisFieldName.indexOf("alerts-") != -1) {
772                    thisFieldObj.removeAttr('name');
773                }
774            }
775        });
776        _thisForm.submit();
777        clearInterval(formToSubmit);
778    }, 1000);
779});
780
781jQuery(document).on('click', '.jobsearch-quick-apply-btn-close', function (e) {
782    var _selector = jQuery(".jobsearch-quick-apply-box"), _selector_inner = jQuery('.jobsearch-quick-apply-box-inner');
783    _selector.removeAttr('style').delay(100).hide(500);
784    _selector_inner.remove()
785
786});
787
788jQuery(document).on('click', '.jobsearch-quick-apply-show', function () {
789
790    var _selector = jQuery(".jobsearch-quick-apply-box"), _loader = jQuery("#jobsearch-loader"),
791        _event_class = jQuery(".jobsearch-pst-title"), job_id = jQuery(this).attr('data-job-id');
792
793    _event_class.removeClass('jobsearch-quick-apply-show');
794
795    _selector.show();
796    if (jobsearch_plugin_vars.is_rtl == true) {
797        _selector.animate({
798            left: '-15px'
799        });
800    } else {
801        _selector.animate({
802            right: "-15px"
803        });
804    }
805
806
807    setTimeout(function () {
808        _loader.html('<div class="careerfy-loading-section"><div class="line-scale-pulse-out"><div></div><div></div><div></div><div></div><div></div></div></div>');
809    }, 300)
810
811    var request = jQuery.ajax({
812        url: jobsearch_plugin_vars.ajax_url,
813        method: "POST",
814        data: 'action=jobsearch_quick_job_popup&job_id=' + job_id,
815        dataType: 'HTML',
816    });
817
818    request.done(function (response) {
819        _loader.html('');
820        _event_class.addClass('jobsearch-quick-apply-show');
821        _selector.append(response);
822    });
823    request.fail(function (jqXHR, textStatus) {
824        //msg_con.html(jobsearch_job_application.error_msg);
825        //msg_loader.html('');
826    });
827
828});

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.