1( function ( $ ) { 2 3 const tclist = { 4 5 get_formatted_date: function( dateFormat ) { 6 7 let formattedDate = 'mm/dd/yy'; 8 9 switch( dateFormat ) { 10 11 case 'Y-m-d': 12 formattedDate = 'yy-mm-dd'; 13 break; 14 15 case 'm/d/Y': 16 formattedDate = 'mm/dd/yy'; 17 break; 18 19 case 'd/m/Y': 20 formattedDate = 'dd/mm/yy'; 21 break; 22 23 case 'jS F Y': 24 formattedDate = 'd MM yy'; 25 break; 26 27 case 'F j, Y': 28 formattedDate = 'MM d, yy' 29 break; 30 } 31 32 return formattedDate; 33 } 34 }; 35 36 $( document ).ready( function () { 37 38 $( '.tc-multiple-select' ).multiselect(); 39 40 setTimeout( function () { 41 42 let height = $( '#tc_start_date' ).outerHeight(), 43 fontSize = $( '#tc_start_date' ).css( 'font-size' ), 44 fontFamily = $( '#tc_start_date' ).css( 'font-family' ), 45 fontWeight = $( '#tc_start_date' ).css( 'font-weight' ), 46 color = $( '#tc_start_date' ).css( 'color' ), 47 borderColor = $( '#tc_start_date' ).css( 'border-color' ), 48 paddingTobBottom = $( '#tc_start_date' ).css( 'padding-top' ); 49 50 $( '#tc_category_ids ~ .ms-options-wrap, .tclist-filter-button' ).css( 'height', height + 'px' ); 51 52 $( '#tc_category_ids ~ .ms-options-wrap button' ).css( { 53 'border-color': borderColor, 54 'padding-top': paddingTobBottom, 55 'padding-bottom': paddingTobBottom, 56 'min-height': '' 57 } ); 58 59 $( '#tc_category_ids ~ .ms-options-wrap .ms-options' ).css( { 60 'border-color': borderColor, 61 'min-height': '' 62 }); 63 64 $( '#tc_category_ids ~ .ms-options-wrap span' ).css( { 65 'font-size': fontSize, 66 'font-weight': fontWeight, 67 'font-family': fontFamily, 68 'color': color 69 } ) 70 71 $( '#tc_category_ids ~ .ms-options-wrap .ms-options label' ).css( { 72 'font-size': fontSize, 73 'font-weight': fontWeight, 74 'font-family': fontFamily, 75 'color': color 76 }); 77 78 $( '#filter_events' ).css( { 79 'font-size': fontSize, 80 'padding-top': paddingTobBottom, 81 'padding-bottom': paddingTobBottom 82 }); 83 84 $( '.tclist-filters' ).addClass( 'visible' ); 85 86 }, 500 ) 87 88 var tc_show_past_events = $( '#tc_show_past_events' ).val(), 89 dateToday = ( 'true' == tc_show_past_events || 1 == tc_show_past_events ) ? '' : new Date(); // Check to see if to show past dates in the calendar 90 91 $( '.tc-event-datepicker' ).datepicker({ 92 dateFormat: tclist.get_formatted_date( tc_values.date_format ), 93 minDate: dateToday, 94 beforeShow: function (input, inst) { 95 $( '#ui-datepicker-div' ).addClass( 'tc-tickera-calendar' ); 96 } 97 }); 98 99 /** 100 * Get events depending on the values passed 101 */ 102 function tc_filter_events() { 103 104 $( '.tc-event-listing-container' ).each( function() { 105 106 var event_container = $( this ), 107 display_filter_events = event_container.find( '.tc-display-filter-events' ), 108 events_list = display_filter_events.find( '.tclist-events' ), 109 loader = event_container.find( '.tc-listing-loader' ), 110 pagination_number = event_container.find( '#tc_pagination_number' ); 111 112 events_list.removeClass( 'loaded' ); 113 loader.show(); 114 events_list.empty(); 115
116 var tc_selected_category_value = event_container.find( '#tc_category_ids' ).val(), 117 tc_categories = [], 118 tc_categories = event_container.find( '#tc_event_categories' ).val(), 119 tc_start_date = event_container.find( '#tc_start_date' ).val(), 120 tc_end_date = event_container.find( '#tc_end_date' ).val(), 121 tc_column_number = event_container.find( '#tc_number_of_columns' ).val(), 122 tc_show_excerpt = event_container.find( '#tc_show_excerpt' ).val(), 123 tc_show_number_of_posts = event_container.find( '#tc_show_number_of_posts' ).val(), 124 tc_pagination_number = pagination_number.val(), 125 tc_show_default_featured_image = event_container.find( '#tc_show_default_featured_image' ).val(), 126 tc_show_past_events = event_container.find( '#tc_show_past_events' ).val(), 127 tc_order_events_by = event_container.find( '#tc_order_events_by' ).val(); 128 129 $.ajax({ 130 type: 'post', 131 dataType: 'text', 132 url: tc_values.ajaxurl, 133 data: { 134 action: 'tc_filter_events', 135 tc_categories: tc_categories, 136 tc_start_date: tc_start_date, 137 tc_end_date: tc_end_date, 138 tc_column_number: tc_column_number, 139 tc_show_excerpt: tc_show_excerpt, 140 tc_show_number_of_posts: tc_show_number_of_posts, 141 tc_pagination_number: tc_pagination_number, 142 tc_show_default_featured_image: tc_show_default_featured_image, 143 tc_selected_category_values: tc_selected_category_value, 144 tc_show_past_events: tc_show_past_events, 145 tc_order_events_by: tc_order_events_by, 146 className: tc_values.tc_ef_class_name 147 }, 148 149 success: function ( response ) { 150 151 let offset = 0.001; // Keeping the container on the same row. 152 153 events_list.html( response ); 154 let event = events_list.find( '.tc-single-event' ), 155 eventWidth = events_list.find( '.tc-single-event' ).outerWidth() - offset; 156 157 event.css( 'min-width', eventWidth + 'px' ); 158 loader.hide(); 159 events_list.addClass( 'loaded' ); 160 161 event_container.find( '.tc-events-wrap .pagination a' ).click( function ( e ) { 162 163 e.preventDefault(); 164 165 if ( $( this ).hasClass( 'prev' ) ) { 166 var get_page_num = $( this ).closest( 'ul.page-numbers' ).find( '.page-numbers.current' ).parent().prev().text(); 167 168 } else if ( $( this ).hasClass( 'next' ) ) { 169 var get_page_num = $( this ).closest( 'ul.page-numbers' ).find( '.page-numbers.current' ).parent().next().text(); 170 171 } else { 172 var get_page_num = $( this ).text(); 173 } 174 175 pagination_number.val( get_page_num ); 176 tc_filter_events(); 177 }); 178 } 179 }); 180 }); 181 } 182 183 tc_filter_events(); 184 185 /** 186 * Filter the Events 187 */ 188 $( '#filter_events' ).click( function ( e ) { 189 e.preventDefault(); 190 tc_filter_events(); 191 }); 192 }); 193})( 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.