1// Simple Download Monitor frontend scripts 2 3jQuery(document).ready(function($) { 4 5 // Populate all nested titles and links 6 $('li.sdm_cat').each(function() { 7 8 var $this = $(this); 9 this_slug = $this.attr('id'); 10 this_id = $this.children('.sdm_cat_title').attr('id'); 11 12 // Run ajax 13 $.post( 14 sdm_ajax_script.ajaxurl, 15 { 16 action: 'sdm_pop_cats', 17 cat_slug: this_slug, 18 parent_id: this_id 19 }, 20 function(response) { 21 22 // Loop array returned from ajax function 23 $.each(response.final_array, function(key, value) { 24 25 // Populate each matched post title and permalink 26 $this.children('.sdm_placeholder').append('<a href="' + value['permalink'] + '"><span class="sdm_post_title" style="cursor:pointer;">' + value['title'] + '</span></a>'); 27 }); 28 29 $this.children('span').append('<span style="margin-left:5px;" class="sdm_arrow">↨</span>'); 30 } 31 ); 32 }); 33 34 // Hide results on page load 35 $('li.sdm_cat').children('.sdm_placeholder').hide(); 36 37 // Slide toggle for each list item 38 $('body').on('click', '.sdm_cat_title', function(e) { 39 40 // If there is any html.. then we have more elements 41 if ($(this).next().html() != '') { 42 43 $(this).next().slideToggle(); // toggle div titles 44 } 45 }); 46 47});
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.