1$(document).ready(function () { 2 $.fn.serializeObject = function () { 3 "use strict"; 4 5 var result = {}; 6 var extend = function (i, element) { 7 var node = result[element.name]; 8 if ('undefined' !== typeof node && node !== null) { 9 if ($.isArray(node)) { 10 node.push(element.value); 11 } else { 12 result[element.name] = [node, element.value]; 13 } 14 } else { 15 result[element.name] = element.value; 16 } 17 }; 18 $.each(this.serializeArray(), extend); 19 20 return result; 21 }; 22 23 24 25 function serializeForm(form) { 26 var data = form.serializeObject(); 27 return data; 28 }; 29 30 31 32 //more press-releases 33 $(document).on('click','.js-more-news',function(){ 34 var data = {}; 35 var th_form = $('.js-filter-news'); 36 var th_content_box = $('.js-load-box'); 37 var th_more_button = $('.js-more-news').parent(); 38 39 data = serializeForm(th_form); 40 data['action'] = 'rmi-more-news'; 41 42 $.ajax({ 43 url: [ 44 location.protocol, 45 '//', 46 location.host, 47 location.pathname 48 ].join(''), 49 data: data, 50 type: 'post', 51 dataType: 'json', 52 beforeSend: function(){ 53 th_content_box.addClass('loading'); 54 }, 55 success: function (response) { 56 if (response.success) { 57 if( response.nextpage == 2 ){ 58 th_content_box.html(''); 59 } 60 if( response.elements == '0' ){ 61 th_content_box.html(''); 62 th_more_button.hide(); 63 } else { 64 th_form.find('input[name="page"]').val(response.nextpage); 65 th_content_box.append(response.elements); 66 $('.js-box-filter-total').text(response.total) 67 var elements_length = $('.afisha-item').length; 68 if( elements_length >= response.total){ 69 th_more_button.hide(); 70 } else { 71 var total_text = response.total-elements_length; 72 $('.js-total-left').text(total_text) 73 th_more_button.show(); 74 } 75 } 76 77 AOS.refresh(); 78 79 } else { 80 $.jGrowl('Ð ÑожалениÑ, пÑоизоÑла оÑибка пÑи загÑÑзке даннÑÑ =( ÐожалÑйÑÑа, обÑаÑиÑеÑÑ Ðº админиÑÑÑаÑии ÑайÑа', {theme: 'af-message-error', sticky: false}); 81 } 82 }, 83 error: function () { 84 $.jGrowl('Ð ÑожалениÑ, пÑоизоÑла оÑибка пÑи загÑÑзке даннÑÑ =( ÐожалÑйÑÑа, обÑаÑиÑеÑÑ Ðº админиÑÑÑаÑии ÑайÑа', {theme: 'af-message-error', sticky: false}); 85 }, 86 complete: function(){ 87 th_content_box.removeClass('loading'); 88 89 } 90 }); 91 92 }); 93});
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.