1(function ($) { 2 $(document).ready(function (e) { 3 $('.nl-comment-form-entry-wrapper').each(function (index, element) { 4 if ($(element).find('.nl-comment-form-entry-group').length > 0) { 5 $(element).find('.nl-comment-form-pagination').twbsPagination({ 6 totalPages: $(element).find('.nl-comment-form-entry-group').length, 7 visiblePages: 5, 8 first: false, 9 prev: '<', 10 next: '>', 11 last: false, 12 onPageClick: function (event, page) { 13 $(element).find('.nl-comment-form-entry-group').hide(); 14 $(element).find('.nl-comment-form-entry-group[data-page="' + page + '"]').show(); 15 } 16 }); 17 } 18 }); 19 }); 20 $(document).on('click', '[data-toggle="nl-comment-form-submit"]', function (e) { 21 if (!this.parentNode.reportValidity()) { 22 return false; 23 } 24 var data = $(this).parent().serializeArray(); 25 data.unshift({ "name": "action", "value": "nl_comment_form_insert_comment" }); 26 $.ajax({ 27 type: 'POST', 28 url: nl_comment_form_ajax_url, 29 data: data, 30 success: function (response) { 31 $('#nl-comment-form-' + response.post_id + '-button').attr('disabled', true); 32 $('#nl-comment-form-' + response.post_id + '-message').html(response.message); 33 }, 34 error: function () { 35 console.error('Error'); 36 } 37 }); 38 }); 39})(jQuery); 40 41(function ($) { 42 $(document).ready(function (e) { 43 var comment_ids = $('[data-toggle="nl-comment-form-good-button"]').map(function () { 44 return $(this).data('comment-id'); 45 }).toArray(); 46 if (comment_ids.length == 0) { 47 return false; 48 } 49 $.ajax({ 50 type: 'GET', 51 url: nl_comment_form_ajax_url, 52 data: { 53 'action': 'nl_comment_form_good_button_get_counts', 54 'comment_ids': comment_ids 55 }, 56 success: function (response) { 57 for (var i in response) { 58 $('#nl-comment-form-entry-good-button-display-' + response[i].id).text(response[i].count); 59 } 60 }, 61 error: function () { 62 console.error('Error'); 63 } 64 }); 65 }); 66 $(document).on('click', '[data-toggle="nl-comment-form-good-button"]', function (e) { 67 var button = $(this); 68 if (button.attr('disabled') == 'disabled') { 69 return false; 70 } else { 71 button.attr('disabled', true); 72 } 73 var comment_id = button.data('comment-id'); 74 $.ajax({ 75 type: 'POST', 76 url: nl_comment_form_ajax_url, 77 data: { 78 'action': 'nl_comment_form_good_button_update_count', 79 'comment_id': comment_id 80 }, 81 success: function (response) { 82 $('#nl-comment-form-entry-good-button-display-' + comment_id).text(response.count); 83 }, 84 error: function () { 85 console.error('Error'); 86 } 87 }); 88 }); 89})(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.