1$(document).ready(function() { 2 $(document).on('click', '.js-load-more', function(event) { 3 var targetContainer = $('.news__list'), 4 url = $('.js-load-more').attr('data-url'); 5 if(!targetContainer.length){ 6 targetContainer = $('.newslist') 7 } 8 console.log(targetContainer) 9 if (url !== undefined) { 10 $.ajax({ 11 type: 'GET', 12 url: url, 13 dataType: 'html', 14 success: function(data) { 15 $('.js-load-more').remove(); 16 var elements = $(data).find('.news__item'), 17 pagination = $(data).find('.js-load-more'); 18 if(!elements.length) { 19 elements = $(data).find('.news') 20 } 21 targetContainer.append(elements); 22 targetContainer.append(pagination); 23 } 24 }) 25 } 26 }); 27 28 // РеÑайз окна 29 // $(window).resize(function() { 30 // console.log($(window).width()); 31 // if ($(window).width() <= '1200') { 32 // return this;} 33 // else { 34 // $('#shelf').hide(10) 35 // } 36 // }); 37 38 39 $('.form__checkmark').on('click', function() { 40 let check = $('.js-politic input').prop('checked'); 41 if (check) { 42 $('.js-politic-submit').attr('disabled','disabled'); 43 } else { 44 $('.js-politic-submit').removeAttr('disabled'); 45 } 46 }); 47 48 $('.js-input-toggle').on('click', function (event) { 49 event.preventDefault(); 50 input = $(this).parent('.input-block').find('.input'); 51 if (input.prop('disabled') == true) { 52 $('span', this).text('Ð¡Ð¾Ñ ÑаниÑÑ'); 53 input.prop('disabled', false); 54 } else { 55 $('.save-password').click(); 56 input.prop('disabled', true); 57 $('span', this).text('РедакÑиÑоваÑÑ'); 58 } 59 }); 60 61 $('.js-input-toggle-mobile').on('click', function (event) { 62 event.preventDefault(); 63 input = $(this).parent('.input-block').find('.input'); 64 if (input.prop('disabled') == true) { 65 $('.input-button-text-mobile', this).text('Ð¡Ð¾Ñ Ñ.'); 66 input.prop('disabled', false); 67 } else { 68 $('.save-password').click(); 69 input.prop('disabled', true); 70 $('.input-button-text-mobile', this).text('Ред.'); 71 } 72 }); 73 74 $('.servisies__list-item_link').on('click', function(event) { 75 event.preventDefault(); 76 if(!$(this).parent().hasClass('active')) { 77 url = $(this).attr('href'); 78 $(this).parents('ul.servisies__list').find('li').removeClass('active'); 79 $(this).parent().addClass('active'); 80 } else { 81 url = '/services/section.php'; 82 $(this).parents('ul.servisies__list').find('li').removeClass('active'); 83 } 84 $.ajax({
85 type: "GET", 86 url: url, 87 data: $(this).serialize(), 88 timeout: 3000, 89 error: function(request,error) { 90 if (error == "timeout") { 91 console.log('timeout'); 92 } 93 else { 94 console.log('Error! Please try again!'); 95 } 96 }, 97 success: function(data) { 98 $('.result').html(data); 99 } 100 }); 101 }); 102 103 $('.js-modal-toggle').on('click', function(event) { 104 event.preventDefault(); 105 $('.js-modal').toggleClass('modal-visible'); 106 }); 107 108 // $('.js_checkbox').on('click', function() { 109 // let check = $('.js_politic-checkbox'); 110 // $('.js_checkbox').toggleClass('active'); 111 // if (check) { 112 // $('.js-politic_button').removeAttr('disabled'); 113 // $('.js_politic-checkbox').removeAttr('checked'); 114 // } else { 115 // $('.js_politic-checkbox').attr('checked', 'checked'); 116 // $('.js-politic_button').attr('disabled','disabled'); 117 // } 118 // }) 119 120 $('.js_sign-in').on('click', function(event) { 121 event.preventDefault(); 122 if($('.js_checkbox').hasClass('active')) { 123 $('#login_popup > form').submit(); 124 } 125 }); 126 127 $('.js_want-more').on('click', function(event) { 128 $('.js-user-request-submit').click(); 129 }); 130 131 const wantMoreFormElement = document.querySelector(".js-want-more-form"); 132 133 if (wantMoreFormElement) { 134 new WantMoreForm(wantMoreFormElement); 135 } 136 137 function WantMoreForm(formElement) { 138 document.querySelector(".js-want-more-form").addEventListener("submit", function(event) { 139 event.preventDefault(); 140 const url = $('.js-want-more-form').attr('action'); 141 const data = new FormData(formElement); 142 data.append("ajax", "Y"); 143 fetch(url, { 144 method: "POST", 145 body: data 146 }).then(function(response) { 147 if (response.ok) { 148 return response.blob(); 149 } 150 throw new Error("Network response was not ok."); 151 }).then(function(response) { 152 $('.js_popup-notification').addClass('active'); 153 console.log(response); 154 }); 155 }); 156 } 157 $('.js_partner').on('mouseenter', function(event) { 158 $(this).find('.js_partner__popup').toggleClass('active'); 159 }); 160 $('.js_partner').on('mouseleave', function(event) { 161 $(this).find('.js_partner__popup').toggleClass('active'); 162 }); 163 164 $('.js_be-partner').on('mouseenter', function(event) { 165 var block = $(this).closest('.js_partner__block'); 166 $(block).toggleClass('hover'); 167 $(block).find('.js_resolve').toggleClass('hover'); 168 $(block).find('.js_partner__button').toggleClass('hover'); 169 }); 170 $('.js_be-partner').on('mouseleave', function(event) { 171 var block = $(this).closest('.js_partner__block'); 172 $(block).toggleClass('hover'); 173 $(block).find('.js_resolve').toggleClass('hover'); 174 $(block).find('.js_partner__button').toggleClass('hover'); 175 }); 176 177 $('.js_be-partner').on('click', function(event){ 178 event.preventDefault(); 179 $('.js_login').toggleClass('active'); 180 }); 181});
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.