PageSourceSearch

https://salons.nl/wp-content/plugins/listingpro-plugin/assets/js/child-term.js?ver=7.1.3

js salons.nl collected 2026-10-08 21:43:31 UTC 23,330 bytes, 488 lines download raw bytes

1jQuery(window).on('load', function() {
2    if (jQuery('div[id="tags-by-cat"]').length > 1) {
3        jQuery('.featuresDataContainerOuterSubmit').first().remove();
4    }
5    // if (!jQuery('#lp-submit-form').hasClass("lpeditlistingform")) {
6    if (jQuery('#inputCategory').val()) {
7        $haveFeature = jQuery('#inputCategory').find(':selected').data('doajax');
8        if ($haveFeature) {
9            $catid = jQuery('#inputCategory').val();
10            $listingid = '';
11            if (jQuery("input[name='lp_post']").length) {
12                $listingid = jQuery("input[name='lp_post']").val();
13            }
14            jQuery('.lp-nested').hide();
15            jQuery('#inputCategory').attr("disabled", !0);
16            jQuery('#tags-by-cat').html(' ');
17            jQuery('label.featuresBycat').remove();
18            jQuery('form#lp-submit-form  div.pre-load:first').addClass('loader');
19            jQuery('#features-by-cat').html(' ');
20            jQuery(".chosen-select").prop('disabled', !0).trigger('chosen:updated');
21
22            jQuery.ajax({
23                type: 'POST',
24                dataType: 'json',
25                url: ajax_term_object.ajaxurl,
26                data: {
27                    'action': 'ajax_term',
28                    'term_id': $catid,
29                    'listing_id': $listingid,
30                },
31                success: function(data) {
32                    jQuery('#inputCategory').removeAttr("disabled");
33                    if (data) {
34                        if (data.hasfeatues == !0) {
35
36                            jQuery('.featuresDataContainerOuterSubmit').show();
37                            jQuery('.labelforfeatures.lp-nested').show();
38                            jQuery('#tags-by-cat').show()
39                        }
40                        if (data.hasfields == !0) {
41                            jQuery('#features-by-cat').show()
42                        }
43                        jQuery('form#lp-submit-form div.pre-load').removeClass('loader');
44                        jQuery(".chosen-select").prop('disabled', !1).trigger('chosen:updated');
45                        if (data.tags != null) {
46                            jQuery('.lpfeatures_fields').prepend('<label for="inputTags" class="featuresBycat">' + data.featuretitle + '</label>');
47                            jQuery.each(data.tags, function(i, v) {
48                                var lpchecked = '';
49                                if (data.lpselectedtags != null) {
50                                    jQuery.each(data.lpselectedtags, function(lk, ls) {
51                                        if (i.trim() === lk) {
52                                            lpchecked = 'checked'
53                                        }
54                                    });
55                                }
56                                jQuery('#tags-by-cat').append('<div class="col-md-2 col-sm-4 col-xs-6"><div class="checkbox pad-bottom-10"><input id="check_' + v + '" type="checkbox" name="lp_form_fields_inn[lp_feature][]" value="' + i + '" ' + lpchecked + '><label for="check_' + v + '">' + v + '</label></div></div>')
57                            })
58                        }
59                        if (jQuery('#lp-form-builder-is-enabled').length) {
60                            var catsVal = jQuery('form#lp-submit-form #inputCategory').val();
61                            if (typeof catsVal === 'object') {
62                                jQuery.each(catsVal, function(k, v) {
63                                    var targetFieldsClass = '.lp-form-builder-field-' + v;
64                                    jQuery('.lp-form-builder-field').fadeOut(500, function() {
65                                        if (jQuery(targetFieldsClass).length) {
66                                            jQuery(targetFieldsClass).fadeIn();
67                                        }
68                                    });
69                                })
70                            } else {
71                                var targetFieldsClass = '.lp-form-builder-field-' + jQuery('form#lp-submit-form #inputCategory').val();
72                                jQuery('.lp-form-builder-field').fadeOut(500, function() {
73                                    if (jQuery(targetFieldsClass).length) {
74                                        jQuery(targetFieldsClass).fadeIn();
75                                    }
76                                });
77                            }
78                        } else {
79                            jQuery('#features-by-cat').append(data.fields);
80                        }
81                    }
82                }
83            });
84        } else {
85            jQuery('.lpfeatures_fields').hide();
86            if (jQuery('.featuresDataContainerOuterSubmit').data('exclusive') == 'no') {
87                jQuery('.featuresDataContainerOuterSubmit').hide();
88            } else if (jQuery('.featuresDataContainerOuterSubmit').data('exclusive') == 'yes') {
89                jQuery('.featuresDataContainerOuterSubmit').fadeIn();
90            }
91            if (jQuery('#lp-form-builder-is-enabled').length) {
92                jQuery('.featuresDataContainerOuterSubmit').hide();
93                jQuery('.lp-form-builder-field').fadeOut();
94            }
95        }
96
97    }
98    // }
99});
100
101jQuery(document).ready(function($) {
102    jQuery("#inputCategory").change(function() {
103
104        $this = jQuery(this);
105        // jQuery('.featuresDataContainerOuterSubmit').hide();
106
107        if (jQuery('.lpfeatures_fields').is(':empty') && jQuery('#tags-by-cat').is(':empty') && jQuery('#features-by-cat').is(':empty')) { jQuery('.lpfeatures_fields').parents('.white-section').first().hide(); }
108
109        jQuery('#tags-by-cat, #features-by-cat').hide();
110
111        if ($this.find(':selected').length > 1) {
112            jQuery($this.find(':selected')).each(function() {
113                if (jQuery(this).data('doajax') != '' || jQuery(this).data('doajax') != false) {
114                    $haveFeature = jQuery(this).data('doajax');
115                }
116            });
117        } else {
118            $haveFeature = $this.find(':selected').data('doajax');
119        }
120
121        if ($haveFeature) {
122            jQuery('.lpfeatures_fields').show();
123            var lpchecked = '';
124            jQuery('.featuresDataContainerOuterSubmit').show();
125            jQuery('.lp-nested').hide();
126            jQuery('#inputCategory').attr("disabled", !0);
127            jQuery('#tags-by-cat').html(' ');
128            jQuery('label.featuresBycat').remove();
129            jQuery('form#lp-submit-form  div.pre-load:first').addClass('loader');
130            jQuery('#features-by-cat').html(' ');
131            jQuery(".chosen-select").prop('disabled', !0).trigger('chosen:updated');
132            var $catTerms = [];
133            var $cTerms = jQuery('form#lp-submit-form #inputCategory').val();
134            $catTerms.push($cTerms);
135            if (document.getElementById("pre-selected-cat") !== null) {
136                var $preSelected = jQuery('#pre-selected-cat').val();
137                $catTerms.push($preSelected)
138            }
139
140            jQuery.ajax({
141                type: 'POST',
142                dataType: 'json',
143                url: ajax_term_object.ajaxurl,
144                data: {
145                    'action': 'ajax_term',
146                    'term_id': jQuery('form#lp-submit-form #inputCategory').val(),
147                    'listing_id': jQuery('input[name=lp_post]').val(),
148                },
149                success: function(data) {
150                    jQuery('#inputCategory').removeAttr("disabled");
151                    if (data) {
152                        if (data.hasfeatues == !0) {
153                            jQuery('.labelforfeatures.lp-nested').show();
154                            jQuery('#tags-by-cat').show()
155                        }
156                        if (data.hasfields == !0) {
157                            jQuery('#features-by-cat').show()
158                        }
159                        $('form#lp-submit-form div.pre-load').removeClass('loader');
160                        jQuery(".chosen-select").prop('disabled', !1).trigger('chosen:updated');
161                        if (data.tags != null) {
162                            jQuery('.lpfeatures_fields').prepend('<label for="inputTags" class="featuresBycat">' + data.featuretitle + '</label>');
163                            jQuery.each(data.tags, function(i, v) {
164                                var lpchecked = '';
165                                if (data.lpselectedtags != null) {
166                                    jQuery.each(data.lpselectedtags, function(lk, ls) {
167                                        if (i.trim() === lk) {
168                                            lpchecked = 'checked'
169                                        }
170                                    });
171                                }
172                                jQuery('#tags-by-cat').append('<div class="col-md-2 col-sm-4 col-xs-6"><div class="checkbox pad-bottom-10"><input id="check_' + v + '" type="checkbox" name="lp_form_fields_inn[lp_feature][]" value="' + i + '" ' + lpchecked + '><label for="check_' + v + '">' + v + '</label></div></div>')
173                            })
174                        }
175                        if (jQuery('#lp-form-builder-is-enabled').length) {
176                            var catsVal = jQuery('form#lp-submit-form #inputCategory').val();
177                            if (typeof catsVal === 'object') {
178                                jQuery.each(catsVal, function(k, v) {
179                                    var targetFieldsClass = '.lp-form-builder-field-' + v;
180                                    jQuery('.lp-form-builder-field').fadeOut(500, function() {
181                                        if (jQuery(targetFieldsClass).length) {
182                                            jQuery(targetFieldsClass).fadeIn();
183                                        }
184                                    });
185                                })
186                            } else {
187                                var targetFieldsClass = '.lp-form-builder-field-' + jQuery('form#lp-submit-form #inputCategory').val();
188                                jQuery('.lp-form-builder-field').fadeOut(500, function() {
189                                    if (jQuery(targetFieldsClass).length) {
190                                        jQuery(targetFieldsClass).fadeIn();
191                                    }
192                                });
193                            }
194                        } else {
195                            jQuery('#features-by-cat').append(data.fields);
196                        }
197                    }
198                }
199
200            });
201        } else {
202            jQuery('.lpfeatures_fields').hide();
203            if (jQuery('.featuresDataContainerOuterSubmit').data('exclusive') == 'no') {
204                jQuery('.featuresDataContainerOuterSubmit').hide();
205            } else if (jQuery('.featuresDataContainerOuterSubmit').data('exclusive') == 'yes') {
206                jQuery('.featuresDataContainerOuterSubmit').fadeIn();
207            }
208            if (jQuery('#lp-form-builder-is-enabled').length) {
209                jQuery('.featuresDataContainerOuterSubmit').hide();
210                jQuery('.lp-form-builder-field').fadeOut();
211            }
212        }
213    });
214    jQuery(".lp-slected-plan-cat").on('click', function() {
215        jQuery('.lp_show_hide_plans').removeClass('active');
216        jQuery('.lp_show_hide_plans').removeClass('isactive');
217        jQuery('.lp_plan_result_section').html('');
218        jQuery('.lp_hide_general_plans').html('');
219        jQuery('.lpmonthyearswitcher').hide();
220        $this = jQuery(this);
221        $durationType = '';
222        if (jQuery(".lpmonthyearswitcher a.switch-fields").length) {
223            if (jQuery('.lpmonthyearswitcher a.switch-fields').hasClass('active')) {
224                $durationType = 'yearly';
225            } else {
226                $durationType = 'monthly';
227            }
228        }
229        $currentStyle = jQuery('#select_style').data('style');
230        jQuery("body").addClass("listingpro-loading");
231        jQuery('#cats-selected-plans').html('');
232        jQuery.ajax({
233            type: 'POST',
234            dataType: 'json',
235            url: ajax_term_object.ajaxurl,
236            data: {
237                'action': 'listingpro_select_plan_by_cat',
238                'term_id': $this.val(),
239                'currentStyle': $currentStyle,
240                'duration_type': $durationType,
241            },
242            success: function(data) {
243                jQuery("body").removeClass("listingpro-loading");
244                if (data.plans) {
245                    if (data.switcher) {
246                        if (data.switcher == "1") {
247                            jQuery('.lpmonthyearswitcher').show()
248                        }
249                    }
250                    //jQuery('.lp_plan_result_section').html(data.plans);
251                    jQuery('.lp_plan_result_section[data-style=' + $currentStyle + ']').html(data.plans);
252                    jQuery('.lp_plan_result_section').addClass('lp-plan-view-border');
253                    var $hiddenField = '<input type="hidden" name="lp_pre_selected_cats" value="' + $this.val() + '" />';
254                    jQuery($hiddenField).appendTo(".price-plan-button")
255                }
256            }
257        })
258    });
259    jQuery(".lp_show_hide_by_duration").on('click', function() {
260        $this = jQuery(this);
261        $durationType = $this.data('durationtype');
262        $catID = jQuery('.lp-slected-plan-cat:checked').val();
263        jQuery("body").addClass("listingpro-loading");
264        jQuery('#cats-selected-plans').html('');
265        jQuery.ajax({
266            type: 'POST',
267            dataType: 'json',
268            url: ajax_term_object.ajaxurl,
269            data: {
270                'action': 'filter_pricingplan',
271                'term_id': $catID,
272                'duration_type': $durationType,
273            },
274            success: function(data) {
275                jQuery("body").removeClass("listingpro-loading");
276                if (data.plans) {
277                    jQuery('#cats-selected-plans').html(data.plans);
278                    var $hiddenField = '<input type="hidden" name="lp_pre_selected_cats" value="' + $this.val() + '" />';
279                    jQuery($hiddenField).appendTo(".price-plan-button")
280                }
281            }
282        })
283    });
284    jQuery('.lp_plans_switcher_btn').on('click', function() {
285        $this = jQuery(this);
286        jQuery('.lp_cats_on_plan_wrap').css({
287            "visibility": "hidden",
288            "height": "0px",
289            "padding-bottom": "0px"
290        });
291
292        //$currentVal = jQuery('.lpmonthyearswitcher span.active').html();
293        //$duration_type = 'monthly';
294        /* if ($currentVal == "Monthly") {
295         $duration_type = 'monthly'
296         } else if ($currentVal == "Annually") {
297         $duration_type = 'yearly'
298         } */
299
300        $duration_type = '';
301        if (jQuery(".lpmonthyearswitcher a.switch-fields").length) {
302            if (jQuery('.lpmonthyearswitcher a.switch-fields').hasClass('active')) {
303                $duration_type = 'yearly';
304            } else {
305                $duration_type = 'monthly';
306            }
307        }
308
309        jQuery('.lp_plans_switcher_btn').removeClass('isactive');
310        jQuery('.lp_hide_general_plans').html('');
311        jQuery('.lp_hide_general_plans').removeClass('lp-plan-view-border');
312        jQuery('.lp_plan_result_section').html('');
313        $this.toggleClass('isactive');
314        if ($this.hasClass('isactive') && $this.data('val') == 'standard') {
315            $currentStyle = jQuery('#select_style').data('style');
316            jQuery("body").addClass("listingpro-loading");
317            //jQuery('input.lp-slected-plan-cat').prop('checked', !1);
318            jQuery('input.lp-slected-plan-cat').prop('checked', false);
319            jQuery('label.active-category-radio').removeClass('active-category-radio');
320            jQuery.ajax({
321                type: 'POST',
322                dataType: 'json',
323                url: ajax_term_object.ajaxurl,
324                data: {
325                    'action': 'listingpro_select_general_plans',
326                    'currentStyle': $currentStyle,
327                    'duration_type': $duration_type,
328                },
329                success: function(data) {
330                    jQuery("body").removeClass("listingpro-loading");
331                    if (data.plans) {
332                        jQuery('.lpmonthyearswitcher').show();
333                        //jQuery('.lp_plan_result_section').html(data.plans);
334                        jQuery('.lp_plan_result_section[data-style=' + $currentStyle + ']').html(data.plans);
335                        jQuery('.lp_plan_result_section').addClass('lp-plan-view-border');
336                        var $hiddenField = '<input type="hidden" name="lp_pre_selected_cats" value="' + $this.val() + '" />';
337                        jQuery($hiddenField).appendTo(".price-plan-button")
338                    }
339                }
340            })
341        } else {
342            jQuery('.lp_cats_on_plan_wrap').css({
343                "visibility": "visible",
344                "height": "auto",
345                "padding-bottom": "40px"
346            });
347            jQuery('.lp_plan_result_sectiolp_cats_on_plan_wrapn').html('');
348            jQuery('.lp_plan_result_section').removeClass('lp-plan-view-border');
349            jQuery('.lpmonthyearswitcher').hide()
350        }
351    });
352    jQuery('ul.switch_month_year li span').on('click', function() {
353        jQuery("body").addClass("listingpro-loading");
354        $this = jQuery(this);
355        jQuery('ul.switch_month_year li span').removeClass('active_switch');
356        $this.toggleClass('active_switch');
357        $currentVal = $this.html();
358        $duration_type = '';
359        $currentStyle = jQuery('#select_style').data('style');
360        if ($currentVal == "Monthly") {
361            $duration_type = 'monthly'
362        } else if ($currentVal == "Annually") {
363            $duration_type = 'yearly'
364        }
365        $catID = '';
366        $planUsage = '';
367        if (jQuery('label').hasClass('active-category-radio')) {
368            $catID = jQuery('label.active-category-radio').find('input').val()
369        } else {
370            $planUsage = 'default'
371        }
372        jQuery('.lp_hide_general_plans').html('');
373        jQuery('.lp_plan_result_section').html('');
374        jQuery.ajax({
375            type: 'POST',
376            dataType: 'json',
377            url: ajax_term_object.ajaxurl,
378            data: {
379                'action': 'filter_pricingplan',
380                'cat_id': $catID,
381                'duration_type': $duration_type,
382                'currentStyle': $currentStyle,
383                'planUsage': $planUsage,
384            },
385            success: function(data) {
386                jQuery("body").removeClass("listingpro-loading");
387                if (data) {
388                    jQuery('.lp_plan_result_section:first').html(data.plans);
389                    var $hiddenField = '<input type="hidden" name="lp_pre_selected_cats" value="' + $this.val() + '" />';
390                    jQuery($hiddenField).appendTo(".price-plan-button");
391                }
392            }
393        })
394    });
395    jQuery('.lp_button_switcher span').on('click', function() {
396        jQuery('.lp_hide_general_plans').removeClass('lp-plan-view-border');
397        jQuery('.lp_button_switcher span').removeClass('active');
398        jQuery(this).toggleClass('active');
399        jQuery("body").addClass("listingpro-loading");
400        $this = jQuery(this);
401        $currentVal = $this.html();
402        $duration_type = '';
403        $currentStyle = jQuery('#select_style').data('style');
404        if ($currentVal == "Monthly") {
405            $duration_type = 'monthly';
406            jQuery('.switch-fields').removeClass('active')
407        } else if ($currentVal == "Annually") {
408            $duration_type = 'yearly';
409            jQuery('.switch-fields').addClass('active')
410        }
411        $catID = '';
412        $planUsage = '';
413        if (jQuery('label').hasClass('active-category-radio')) {
414            $catID = jQuery('label.active-category-radio').find('input').val()
415        } else {
416            $planUsage = 'default'
417        }
418        jQuery('.lp_hide_general_plans').html('');
419        jQuery('.lp_plan_result_section').html('');
420        jQuery.ajax({
421            type: 'POST',
422            dataType: 'json',
423            url: ajax_term_object.ajaxurl,
424            data: {
425                'action': 'filter_pricingplan',
426                'cat_id': $catID,
427                'duration_type': $duration_type,
428                'currentStyle': $currentStyle,
429                'planUsage': $planUsage,
430            },
431            success: function(data) {
432                jQuery("body").removeClass("listingpro-loading");
433                if (data) {
434                    jQuery('.lp_plan_result_section:first').html(data.plans);
435                    var $hiddenField = '<input type="hidden" name="lp_pre_selected_cats" value="' + $this.val() + '" />';
436                    jQuery($hiddenField).appendTo(".price-plan-button");
437                    jQuery('.lp_plan_result_section').addClass('lp-plan-view-border')
438                }
439            }
440        })
441    });
442    jQuery('.lp_button_switcher a').on('click', function() {
443        jQuery('.lp_hide_general_plans').removeClass('lp-plan-view-border');
444        $duration_type = '';
445        $currentStyle = jQuery('#select_style').data('style');
446        if (jQuery(this).hasClass('active')) {
447            jQuery('.lp-monthly-side').addClass('active');
448            jQuery('.lp-year-side').removeClass('active');
449            $duration_type = 'monthly'
450        } else {
451            $duration_type = 'yearly';
452            jQuery('.lp-year-side').addClass('active');
453            jQuery('.lp-monthly-side').removeClass('active')
454        }
455        jQuery("body").addClass("listingpro-loading");
456        $this = jQuery(this);
457        $catID = '';
458        $planUsage = '';
459        if (jQuery('label').hasClass('active-category-radio')) {
460            $catID = jQuery('label.active-category-radio').find('input').val()
461        } else {
462            $planUsage = 'listingonly'
463        }
464        jQuery('.lp_hide_general_plans').html('');
465        jQuery('.lp_plan_result_section').html('');
466        jQuery.ajax({
467            type: 'POST',
468            dataType: 'json',
469            url: ajax_term_object.ajaxurl,
470            data: {
471                'action': 'filter_pricingplan',
472                'cat_id': $catID,
473                'duration_type': $duration_type,
474                'currentStyle': $currentStyle,
475                'planUsage': $planUsage,
476            },
477            success: function(data) {
478                jQuery("body").removeClass("listingpro-loading");
479                if (data) {
480                    jQuery('.lp_plan_result_section:first').html(data.plans);
481                    var $hiddenField = '<input type="hidden" name="lp_pre_selected_cats" value="' + $this.val() + '" />';
482                    jQuery($hiddenField).appendTo(".price-plan-button");
483                    jQuery('.lp_plan_result_section').addClass('lp-plan-view-border')
484                }
485            }
486        })
487    })
488})

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.