1(function ($) { 2 if ( 'true' === my_calendar.mini ) { 3 $( ".mini .calendar-events" ).hide(); 4 $( document ).on( "click", ".mini .has-events .trigger", function (e) { 5 e.preventDefault(); 6 const current_date = $(this).parents( '.has-events' ).children( '.calendar-events' ); 7 current_date.toggle(); 8 $( '.mini .has-events' ).children( '.trigger' ).removeClass( 'active-toggle' ); 9 $( '.mini .has-events' ).children().not( '.mc-date-container' ).not( current_date ).hide(); 10 $( this ).addClass( 'active-toggle' ); 11 e.stopImmediatePropagation(); 12 }); 13 $( document ).on( "click", ".calendar-events .close", function (e) { 14 e.preventDefault(); 15 $(this).closest( '.mini .has-events' ).children( '.trigger' ).removeClass( 'active-toggle' ); 16 $(this).closest( 'div.calendar-events' ).toggle(); 17 e.stopImmediatePropagation(); 18 }); 19 } 20 21 if ( 'true' === my_calendar.list ) { 22 if ( 'false' === my_calendar.links ) { 23 $('li .list-event' ).hide(); 24 $('li.current-day .list-event').show(); 25 $('li.current-day .event-date .mc-text-button' ).attr( 'aria-expanded', true ); 26 $(document).on( 'click', '.event-date button', function (e) { 27 e.preventDefault(); 28 $( this ).closest( '.mc-events' ).find( '.mc-event' ).toggle(); 29 let visible = $(this).closest( '.mc-events' ).find( '.mc-event' ).is(':visible'); 30 if ( visible ) { 31 $(this).attr('aria-expanded', 'true'); 32 } else { 33 $(this).attr('aria-expanded', 'false'); 34 } 35 e.stopImmediatePropagation(); 36 return false; 37 }); 38 } 39 } 40 41 if ( 'true' === my_calendar.grid || ( 'true' === my_calendar.list && 'true' === my_calendar.links ) ) { 42 let container = ( 'true' === my_calendar.grid ) ? '.calendar-event' : '.list-event'; 43 let wrapper = ( 'true' === my_calendar.links && 'true' === my_calendar.grid ) ? '.mc-events' : container; 44 $( wrapper + ' .single-details' ).hide(); 45 $(document).on('click', wrapper + ' .event-title .open', 46 function (e) { 47 let visible = $(this).parents( '.mc-event' ).children( '.details' ).is(':visible'); 48 let controls = $( this ).attr( 'aria-controls' ); 49 const controlled = $( '#' + controls ); 50 if ( visible ) { 51 $(this).attr( 'aria-expanded', 'false' ); 52 } else { 53 $(this).attr( 'aria-expanded', 'true' ); 54 } 55 e.preventDefault(); 56 let current_date = $(this).parents( '.mc-event' ).children(); 57 58 $(this).closest( '.mc-main' ).toggleClass( 'grid-open' ); 59 controlled.toggle(); 60 61 const focusable = current_date.find( 'a, button:not(.event-title > button), object, :input, iframe, [tabindex]' ); 62 const lastFocus = focusable.last(); 63 const firstFocus = focusable.first(); 64 firstFocus.attr( 'data-action', 'shiftforward' ); 65 lastFocus.attr( 'data-action', 'shiftback' ); 66 67 $( wrapper ).children( '.single-details' ).not( current_date ).hide(); 68 e.stopImmediatePropagation(); 69 return false; 70 } 71 ); 72 73 $(document).on('click', '.calendar-event .close', 74 function (e) { 75 e.preventDefault(); 76 $(this).parents( '.mc-event' ).find( 'a.open' ).attr( 'aria-expanded', 'false' ); 77 $(this).closest( '.mc-main' ).removeClass( 'grid-open' ); 78 $(this).closest('.mc-event').find('.event-title a').trigger( 'focus' ); 79 $(this).closest('div.single-details').toggle(); 80 e.stopImmediatePropagation(); 81 }); 82 83 $(document).on( 'keydown', function(e) { 84 let keycode = ( e.keyCode ? e.keyCode : e.which ); 85 if ( keycode == 27 ) { 86 $( '.mc-main ').removeClass( 'grid-open' ); 87 $( '.calendar-event div.single-details' ).hide(); 88 $( ".mini .calendar-events" ).hide(); 89 } 90 }); 91 92 $(document).on( 93 'keydown', '.mc-event a, .mc-event object, .mc-event :input, .mc-event iframe, .mc-event [tabindex]', 94 function(e) { 95 let keycode = ( e.keyCode ? e.keyCode : e.which ); 96 let action = $( ':focus' ).attr( 'data-action' ); 97 if ( ( !e.shiftKey && keycode == 9 ) && action == 'shiftback' ) { 98 e.preventDefault(); 99 $( '[data-action=shiftforward]' ).trigger( 'focus' ); 100 } 101 if ( ( e.shiftKey && keycode == 9 ) && action == 'shiftforward' ) { 102 e.preventDefault(); 103 $( '[data-action=shiftback]' ).trigger( 'focus' ); 104 } 105 } 106 ); 107 } 108}(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.