PageSourceSearch

https://glasshousebvi.com/wp-content/plugins/wp-booking-system-pre…/assets/js/script-front-end.js?ver=1.0.2

js glasshousebvi.com collected 2026-10-09 00:26:26 UTC 3,936 bytes, 124 lines download raw bytes

1$ = jQuery.noConflict();
2var wpbs_s_date_format = "dd/mm/yy"
3$(document).ready(function () {
4    /**
5     * The datepickers
6     * 
7     */
8    wpbs_s_search_widget_initialize_datepickers();
9
10    $(document).on('click', ".wpbs_s-search-widget-datepicker-submit", function (e) {
11        e.preventDefault();
12
13        var $button = $(this);
14        var $container = $button.parents('.wpbs_s-search-widget');
15        var $form = $container.find('.wpbs_s-search-widget-form');
16
17
18        $form.addClass('wpbs_s-searching');
19        $button.prop('disabled', true);
20
21        $(".wpbs_s-search-widget-results-wrap").empty();
22        $(".wpbs_s-search-widget-error-field").empty();
23
24        var data = {
25            action: 'wpbs_s_search_calendars',
26            start_date: $form.find('.wpbs_s-search-widget-datepicker-start-date').val(),
27            end_date: $form.find('.wpbs_s-search-widget-datepicker-end-date').val(),
28            args: $container.data(),
29            wpbs_s_token: wpbs_s_localized_data.search_form_nonce
30        }
31
32        $.post(wpbs_s_localized_data.ajax_url, data, function (response) {
33            $form.removeClass('wpbs_s-searching');
34            $button.prop('disabled', false);
35
36            $container.replaceWith(response)
37            wpbs_s_search_widget_initialize_datepickers();
38
39            // Add padding to form
40            wpbs_s_search_widget_add_padding();
41            wpbs_s_search_results_widget_add_padding();
42            wpbs_s_search_widget_size();
43            $(".wpbs_s-search-widget").animate({ opacity: 1 }, 200);
44        });
45    });
46
47
48    // Add padding to form
49    wpbs_s_search_widget_add_padding();
50    wpbs_s_search_results_widget_add_padding();
51    wpbs_s_search_widget_size();
52});
53
54
55$(window).on('load',function () {
56    $(".wpbs_s-search-widget").animate({ opacity: 1 }, 200);
57});
58
59
60$(window).bind('load resize', function () {
61    // Add padding to form
62    wpbs_s_search_widget_add_padding();
63    wpbs_s_search_results_widget_add_padding();
64    wpbs_s_search_widget_size();
65});
66
67
68function wpbs_s_search_widget_add_padding() {
69    $(".wpbs_s-search-widget .wpbs_s-search-widget-form").css('padding-right', $(".wpbs_s-search-widget .wpbs_s-search-widget-form .wpbs_s-search-widget-field.wpbs_s-search-widget-field-submit").width());
70};
71
72
73function wpbs_s_search_results_widget_add_padding() {
74    $(".wpbs_s-search-widget-results-wrap .wpbs_s-search-widget-result").each(function () {
75        $result = $(this);
76        $result.css('padding-right', $result.find(".wpbs_s-search-widget-result-button").outerWidth(true) + 40);
77    });
78};
79
80
81function wpbs_s_search_widget_size() {
82    $(".wpbs_s-search-widget").each(function () {
83        $widget = $(this);
84        if ($widget.width() < 500) {
85            $widget.addClass('small');
86        } else {
87            $widget.removeClass('small');
88        };
89    });
90};
91
92
93function wpbs_s_search_widget_initialize_datepickers() {
94
95    if ($('body').hasClass('wp-admin')) return false;
96
97    var start_date = $(".wpbs_s-search-widget-datepicker-start-date").datepicker({
98        changeMonth: true,
99        changeYear: true,
100        dateFormat: wpbs_s_date_format,
101        minDate: 0
102    }).on("change", function () {
103        end_date.datepicker("option", "minDate", wpbs_s_datepicker_get_date(this));
104    })
105
106    var end_date = $(".wpbs_s-search-widget-datepicker-end-date").datepicker({
107        changeMonth: true,
108        changeYear: true,
109        dateFormat: wpbs_s_date_format
110    }).on("change", function () {
111        start_date.datepicker("option", "maxDate", wpbs_s_datepicker_get_date(this));
112    });
113};
114
115function wpbs_s_datepicker_get_date(element) {
116    var date;
117    try {
118        date = $.datepicker.parseDate(wpbs_s_date_format, element.value);
119    } catch (error) {
120        date = null;
121    }
122
123    return date;
124};

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.