1(function($) { 2 $(document).ready(function() { 3 $('#live-search-faux-input').on('click', function() { 4 $('.live-search-modal').fadeIn(500); 5 $('input#live-search-input').focus(); 6 $('#live-search-input').addClass('live-search-to-show'); 7 }); 8 $('input#live-search-input').on('input', function() { 9 if ( this.value.length >= 3 ) { 10 call_ajax(); 11 } else { 12 $('.fb-faq-content').html(''); 13 } 14 }); 15 $('.live-search-reset-btn').on('click', function() { 16 //$('.fb-faq-content').html('').slideUp(); 17 $('#live-search-input').val(''); 18 call_ajax(); 19 }); 20 21 openFaq(); 22 initTargetFilters(); 23 }); 24 25 function openFaq() { 26 $('.fb-faq-title').on('click', function() { 27 var body = $(this).next('.fb-faq-body'); 28 if($(this).hasClass('fb-active')){ 29 $(this).removeClass('fb-active'); 30 body.fadeOut(); 31 } else { 32 $(this).addClass('fb-active'); 33 body.fadeIn(); 34 } 35 }); 36 } 37 38 function call_ajax(){ 39 $.ajax({ 40 url: live_search.ajax_url, // use the globally declared variable 41 type: 'POST', 42 data: { 43 action: 'live_search', // Call the PHP function 44 keyword: $('#live-search-input').val(), 45 term_id: $('#faq-term').val() 46 }, 47 success: function(data) { 48 $('.live-search-reset-btn').fadeIn(500); 49 $('.fb-faq-content').delay(500).slideDown(400).html(data); 50 $('.fb-faq-content').each(function(index) { 51 $(this).delay(500*index).fadeTo(400, 1); 52 }); 53 openFaq(); 54 } 55 }); 56 } 57 58 function initTargetFilters() { 59 $('.fb-faq-target-item').on('click', function() { 60 var target = $(this).data('target'); 61 62 $('.fb-faq-target-item').removeClass('is-active'); 63 $(this).addClass('is-active'); 64 65 $('.fb-faq-target-questions').hide().removeClass('is-active'); 66 $('.fb-faq-target-questions[data-target="' + target + '"]').show().addClass('is-active'); 67 }); 68 } 69})(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.