PageSourceSearch

https://www.emperorhotel.com.hk/wp-content/themes/pro-theme-crysta…/assets/js/dynamic_calendar.js?ver=1.0.1

js emperorhotel.com.hk collected 2026-09-30 21:02:30 UTC 1,942 bytes, 48 lines download raw bytes

1(function ($) {
2    function open_dynamic_calendar() {
3        var btns = jQuery('.dynamic_calendar_open,.mobile_dynamic_calendar_open');
4        var calendar_wrapper = jQuery('#dyncal_wrapper');
5        var calendar_box = jQuery('#dyncal_box');
6        if (btns.length === 0 || calendar_wrapper.length === 0) return;
7        var mClass = ('visible');
8        var htmlClass = ('no_scroll');
9        var html = jQuery('html');
10        btns.on('click',function () {
11            if (!calendar_wrapper.hasClass(mClass)) {
12                calendar_wrapper.addClass(mClass);
13                html.addClass(htmlClass);
14                $('body > *:not(#booking-form-1)').attr('inert', '');
15                setTimeout(function (){
16                    calendar_wrapper.find('.close_calendar').trigger('focus');
17                },100)
18
19
20                $('.fbw-calendar--config').keyup(function (e) {
21                    var key = e.which || e.keyCode;
22                    if (key === 27) {
23                        calendar_wrapper.find('.close_calendar').trigger('click');
24                    }
25                });
26                //instantiate mutation observer for a11y
27                $(window).trigger('dynamic_calendar_visible');
28            }
29        });
30
31        $('.close_calendar').click(function () {
32            if (calendar_wrapper.hasClass(mClass)) {
33                calendar_wrapper.removeClass(mClass);
34                html.removeClass(htmlClass);
35
36                $('body > *:not(#booking-form-1)').removeAttr('inert');
37                $('.dynamic_calendar_open .first_book_now:visible').focus();
38                $('.dynamic_calendar_open .second_book_now:visible').focus();
39                //disconnect mutation observer for a11y
40                $(window).trigger('dynamic_calendar_hidden');
41            }
42        });
43    };
44// dynamic calendar
45    open_dynamic_calendar();
46
47})(jQuery);
48

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.