1jQuery(document).ready(function($) { 2 3 $('body').on( 'click', '.js-ldfc-unfavorite', function(e) { 4 5 e.preventDefault(); 6 7 if( $(this).hasClass('is-loeading') ) { 8 return; 9 } 10 11 var post_id = $(this).data('post_id'); 12 var endpoint = 'ldfc_remove_favorite'; 13 14 $(this).addClass('is-loading'); 15 16 var elm = $('.ldfc-favorite-' + post_id ); 17 18 jQuery.ajax({ 19 url: favcon_ajax_call.adminAjax + '?action=' + endpoint, 20 type: 'post', 21 data: { 22 post_id : post_id 23 }, 24 success: function( data ) { 25 26 if( data.success == true ) { 27 $(elm).slideUp('slow'); 28 } 29 30 $(elm).removeClass('is-loading'); 31 32 } 33 }); 34 35 }); 36 37 $('body').on( 'click', '.js-favcon-favorite', function(e) { 38 39 e.preventDefault(); 40 41 if( $(this).hasClass('is-loeading') ) { 42 return; 43 } 44 45 var post_id = $(this).data('post_id'); 46 47 if( $(this).hasClass('favcon-saved') ) { 48 endpoint = 'ldfc_remove_favorite'; 49 } else { 50 endpoint = 'ldfc_save_favorite' 51 } 52 53 $('.js-favcon-favorite').addClass('is-loading'); 54 55 jQuery.ajax({ 56 url: favcon_ajax_call.adminAjax + '?action=' + endpoint, 57 type: 'post', 58 data: { 59 post_id : post_id 60 }, 61 success: function( data ) { 62 63 if( data.success == true ) { 64 $('.js-favcon-favorite').toggleClass('favcon-saved'); 65 } 66 67 $('.js-favcon-favorite').removeClass('is-loading'); 68 69 } 70 }); 71 72 }); 73 74 console.log('runs'); 75 76 $('.ldfc-favorite-search-input').keyup( function(e) { 77 78 ldfc_live_search( $(this).parents( $(this) ) ); 79 80 }); 81 82 function ldfc_live_search( elm ) { 83 84 var parent = $(elm).parent('.ldfc-search-parent'); 85 86 filter = $(parent).find('.ldfc-favorite-search-input').val().toLowerCase(); 87 elms = $(parent).find('.ldfc-favorite'); 88 89 $(elms).each(function(e) { 90 91 if( $(this).text().toLowerCase().search(filter) > -1 ) { 92 $(this).show(); 93 } else { 94 $(this).hide(); 95 } 96 97 }); 98 99 } 100 101});
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.