1(function ($) { 2 'use strict'; 3 $(function () { 4 mc_display_usertime(); 5 $(document).on('click', ".my-calendar-header a.mcajax, .my-calendar-footer a.mcajax", function (e) { 6 e.preventDefault(); 7 var calendar = $( this ).closest( '.mc-main' ); 8 var ref = calendar.attr('id'); 9 var link = $(this).attr('href'); 10 let url; 11 try { 12 url = new URL(link); 13 url.searchParams.delete('embed'); 14 15 window.history.pushState({}, '', url ); 16 } catch(_) { 17 url = false; 18 } 19 20 var height = calendar.height(); 21 $('#' + ref).html('<div class=\"mc-loading\"></div><div class=\"loading\" style=\"height:' + height + 'px\"><span class="screen-reader-text">Loading...</span></div>'); 22 $( '#' + ref ).load(link + ' #' + ref + ' > *', function ( response, status, xhr ) { 23 24 if ( status == 'error' ) { 25 $( '#' + ref ).html( xhr.status + " " + xhr.statusText ); 26 } 27 // functions to execute when new view loads. 28 // List view. 29 if ( typeof( mclist ) !== "undefined" && mclist.list == 'true' ) { 30 $('li.mc-events').children().not('.event-date').hide(); 31 $('li.current-day').children().show(); 32 } 33 // Grid view. 34 if ( typeof( mcgrid ) !== "undefined" && mcgrid.grid == 'true' ) { 35 $('.calendar-event').children().not('.event-title').hide(); 36 } 37 // Mini view. 38 if ( typeof( mcmini ) !== "undefined" && mcmini.mini == 'true' ) { 39 $('.mini .has-events').children().not('.trigger, .mc-date, .event-date').hide(); 40 } 41 // All views. 42 $( '#' + ref ).attr('tabindex', '-1').trigger( 'focus' ); 43 mc_display_usertime(); 44 // Your Custom ajax load changes if needed. 45 }); 46 }); 47 }); 48 49 function mc_display_usertime() { 50 var utime = $( '.mc-user-time' ); 51 utime.each(function() { 52 var time = $( this ).text(); 53 var label = $( this ).attr( 'data-label' ); 54 var utime = '<span class="mc-local-time-time">' + new Date( time ).toLocaleTimeString().replace( ':00 ', ' ' ) + '</span>'; 55 var udate = '<span class="mc-local-time-date">' + new Date( time ).toLocaleDateString() + '</span>'; 56 $( this ).html( '<span class="mc-local-time-label">' + label + '</span>' + ' ' + udate + '<span class="sep">, </span>' + utime ).attr( 'data-time', time ); 57 }); 58 } 59}(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.