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