1jQuery(document).ready( function($) { 2 $('.wpfp-link').on('click', 'live', function() { 3 dhis = $(this); 4 wpfp_do_js( dhis, 1 ); 5 // for favorite post listing page 6 if (dhis.hasClass('remove-parent')) { 7 dhis.parent("li").fadeOut(); 8 } 9 return false; 10 }); 11}); 12 13function wpfp_do_js( dhis, doAjax ) { 14 loadingImg = dhis.prev(); 15 loadingImg.show(); 16 //beforeImg = dhis.prev().prev(); 17 //beforeImg.hide(); 18 parentClass = dhis.parent().attr('class'); 19 changeImg = dhis.parent(); 20 url = document.location.href.split('#')[0]; 21 params = dhis.attr('href').replace('?', '') + '&ajax=1'; 22 if ( doAjax ) { 23 jQuery.get(url, params, function(data) { 24 //dhis.parent().html(data); 25 if(typeof wpfp_after_ajax == 'function') { 26 wpfp_after_ajax( dhis ); // use this like a wp action. 27 } 28 loadingImg.hide(); 29 //console.log(parentClass); 30 if (parentClass.indexOf('wpfp-remove') != -1) { 31 changeImg.removeClass('wpfp-remove'); 32 changeImg.addClass('wpfp-keep'); 33 dhis.attr('href',dhis.attr('href').replace(/wpfpaction=remove/g,'wpfpaction=add')); 34 } else if (parentClass.indexOf('wpfp-keep') != -1) { 35 changeImg.removeClass('wpfp-keep'); 36 changeImg.addClass('wpfp-remove'); 37 dhis.attr('href',dhis.attr('href').replace(/wpfpaction=add/g,'wpfpaction=remove')); 38 } 39 } 40 ); 41 } 42}
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.