1$(document).ready(function(){ 2 3 function pay(email,title,summa,sub,user_id,transaction_id){ 4 5 var payments = new cp.Widget({ 6 language: "ru-RU", 7 email: email, 8 applePaySupport: false, 9 googlePaySupport: false, 10 yandexPaySupport: true, 11 tinkoffInstallmentSupport: false, 12 }); 13 14 var data = {}; 15 if(sub == 1){ 16 data.CloudPayments = { 17 recurrent: { 18 interval: 'Month', 19 period: 1, 20 } 21 } 22 } 23 24 25 26 payments.pay("charge", { 27 //publicId: "test_api_00000000000000000000002", 28 publicId: "pk_d0582d8e2d456471640e7eb52c9dd", 29 description: 'ÐказаÑÑ Ð¿Ð¾Ð¼Ð¾ÑÑ - ' + title, 30 amount: Number(summa), 31 currency: "RUB", 32 invoiceId: transaction_id, 33 accountId: user_id, 34 email: email, 35 skin: "modern", 36 requireEmail: true, 37 data: data 38 }).then(function(widgetResult) { 39 console.log('result', widgetResult); 40 }).catch(function(error) { 41 console.log('error', error); 42 }); 43 44 } 45 46 47 function beforeTransaction(name,phone,email,title,summa,content_id,sub){ 48 $.ajax({
49 type: "post", 50 url: "/ajax/beforetransaction", 51 data: { 52 name: name, 53 phone: phone, 54 email: email, 55 summa: summa, 56 content_id: content_id, 57 sub: sub, 58 }, 59 60 success: function(data){ 61 pay(email,title,summa,sub,data.user_id,data.transaction_id); 62 } 63 }); 64 } 65 66 67 68 /* ÐплаÑа в вÑпадаÑÑем окне */ 69 $(document).on('click', '#pay', function (e) { 70 e.preventDefault(); 71 72 /* ÐолÑÑаем Ð¿Ð¾Ð»Ñ */ 73 var name = $('#payform-name').val(); 74 var email = $('#payform-email').val(); 75 var phone = ''; 76 var sub = false; 77 var summa = $('#ssum').val(); 78 79 var content_id = $('#payform-id').val(); 80 var title = $('#payform-title').val(); 81 82 if(!title){ 83 title = 'Ðо ÑÑмоÑÑÐµÐ½Ð¸Ñ Ñонда'; 84 } 85 86 if(!email){ 87 $('.field-payform-email').addClass('has-error'); 88 return false; 89 } 90 91 /* СоздаÑм ÑÑанзакÑÐ¸Ñ Ð¸ полÑзоваÑÐµÐ»Ñ (еÑли нÑжно) */ 92 beforeTransaction(name,phone,email,title,summa,content_id,sub); 93 94 95 96 97 }); 98 99 100 /* ÐплаÑа подпиÑки на главной */ 101 $('.index-sub').click(function (e){ 102 e.preventDefault(); 103 104 var name = $('#subscription-name').val(); 105 var email = $('#subscription-email').val(); 106 var phone = $('#subscription-phone').val(); 107 var summa = $('#ssum').val(); 108 var title = 'ÐлагоÑвоÑиÑелÑÐ½Ð°Ñ Ð¿Ð¾Ð´Ð¿Ð¸Ñка'; 109 110 if(!email){ 111 $('.field-subscription-email').addClass('has-error'); 112 return false; 113 } 114 115 /* СоздаÑм ÑÑанзакÑÐ¸Ñ Ð¸ полÑзоваÑÐµÐ»Ñ (еÑли нÑжно) */ 116 beforeTransaction(name,phone,email,title,summa,0,1); 117 }); 118 119 120 /* ÐплаÑа Ñ "ХоÑÑ Ð¿Ð¾Ð¼Ð¾ÑÑ" */ 121 $('.send-want').click(function (e){ 122 e.preventDefault(); 123 124 var email = $('#wantform-email').val(); 125 var name = $('#wantform-name').val(); 126 var summa = $('#ssum').val(); 127 128 var sub = $('#ssub').val(); 129 130 var a = ''; 131 if(sub === 'ÐжемеÑÑÑно'){ 132 a = 1; 133 } 134 135 var id = $('#wantform-program').val(); 136 var title = $('#wantform-program option:selected').text(); 137 138 if(!email){ 139 $('.field-wantform-email').addClass('has-error'); 140 return false; 141 } 142 143 144 145 /* СоздаÑм ÑÑанзакÑÐ¸Ñ Ð¸ полÑзоваÑÐµÐ»Ñ (еÑли нÑжно) */ 146 beforeTransaction(name,'',email,title,summa,id,a); 147 }); 148 149 150 151 152 153 154 /* ÐÑпадаÑÑий ÑпиÑок пÑи наведении */ 155 $('.drop-link').hover(function (){ 156 $(this).find('.drop').stop().fadeIn(100); 157 $(this).find('.down-icon').addClass('r2'); 158 },function (){ 159 $(this).find('.drop').stop().fadeOut(100); 160 $(this).find('.down-icon').removeClass('r2'); 161 }); 162 163 164 $('.about-link').click(function (){ 165 166 $(this).parent().toggleClass('about-open'); 167 $(this).find('.about-icon').toggleClass('r2'); 168 //$(this).next().toggleClass('sv-open'); 169 var block = $(this).next(); 170 if(block.is(':visible')){ 171 block.slideUp(200); 172 }else{ 173 block.slideDown(200); 174 } 175 return false; 176 }); 177 178 179 //Ðиалоговое окно пÑи Ñдалении "ТоÑно ÑдалиÑÑ?" 180 $('.delete').click(function(){ 181 if(!confirm("ТоÑно ÑдалиÑÑ?")){ 182 return false; 183 } 184 }); 185 186 //Ðвод ÑолÑко ÑиÑÑ 187 $('body').on("input",'.digit', function() { 188 if (this.value.match(/[^0-9]/g)) { 189 this.value = this.value.replace(/[^0-9]/g, ''); 190 } 191 }); 192 193 194 /* ÐÑÑÐ³ÐµÑ */ 195 $('#burger').click(function () { 196 $(this).toggleClass('animate'); 197 $('.mnavi').toggleClass('show'); 198 });
199 200 201 $( 'body' ).on('click', '.tab-button',function() { 202 $('.tab-button').removeClass('active-tab-button'); 203 $(this).addClass('active-tab-button'); 204 $('#another-summa').val(''); 205 var summa = $(this).data('summa'); 206 207 $('#ssum').val(summa); 208 }); 209 210 $( 'body' ).on('keyup', '#another-summa',function() { 211 var summa = $(this).val(); 212 $('.tab-button').removeClass('active-tab-button'); 213 214 $('#ssum').val(summa); 215 }); 216 217 //var sticky = new Sticky('.sticky'); 218 219 /* ÐлавнÑй ÑкÑол */ 220 $('.l').on('click', function(event) { 221 event.preventDefault(); 222 var sc = $(this).attr("href"), 223 dn = $(sc).offset().top; 224 $('html, body').animate({scrollTop: dn}, 500); 225 }); 226 227 228 229 230 $( 'body' ).on('click', '.tab-button1',function() { 231 $('.tab-button1').removeClass('active-tab-button'); 232 $(this).addClass('active-tab-button'); 233 234 //$('#another-summa').val(''); 235 var ssub = $(this).data('val'); 236 237 $('#ssub').val(ssub); 238 }); 239 240 /* 241 //ÐаÑÑÑÐµÐ»Ñ 242 $(".owl-carousel").owlCarousel({ 243 items:1, 244 loop:true, 245 nav:true, 246 autoplay:true, 247 }); 248 249 250 //Colorbox 251 $(".group1").colorbox({ 252 rel:'group1', 253 maxWidth:"90%", 254 maxHeight:"90%" 255 }); 256 257 258 259 */ 260 /* 261 $('.summernote').summernote({ 262 lang : 'ru-RU', 263 height: 600, 264 }); 265 */ 266 267 268 /* ÐÐÐÐÐЬÐÐÐ ÐÐÐÐ */ 269 270 $('body').on('click', '.open-modal',function() { 271 272 $.ajax({
273 type: "get", 274 url: "/ajax/test", 275 276 success: function(data){ 277 var text = `<div class="modal-wrapper"> 278 <div class="modal"> 279 <div class="modal-inner"> 280 <div class="modal-content"> 281 `+data+` 282 </div> 283 <div class="modal-close"> 284 <img width="18" src="/images/close.svg" alt=""> 285 </div> 286 </div> 287 </div> 288 </div>`; 289 290 $('body').append(text); 291 $('.modal-wrapper').animate({opacity: 1}, 200); 292 } 293 }); 294 295 }); 296 297 298 $('body').on('click', '.pay-modal',function() { 299 300 var id = $(this).data('id'); 301 302 $.ajax({ 303 type: "get", 304 url: "/ajax/pay?id="+id, 305 306 success: function(data){ 307 var text = `<div class="modal-wrapper"> 308 <div class="modal"> 309 <div class="modal-inner"> 310 <div class="modal-content"> 311 `+data+` 312 </div> 313 <div class="modal-close"> 314 <img width="18" src="/images/close.svg" alt=""> 315 </div> 316 </div> 317 </div> 318 </div>`; 319 320 $('body').append(text); 321 $('.modal-wrapper').animate({opacity: 1}, 200); 322 } 323 }); 324 325 326 return false; 327 }); 328 329 330 /* ÐакÑÑÑÑ Ð¼Ð¾Ð´Ð°Ð»Ñное окно */ 331 $('body').on('click', '.modal-close',function() { 332 $('.modal-wrapper').animate({opacity: 0}, 200, function (){ 333 $('.modal-wrapper').remove(); 334 }); 335 }); 336 $('body').on('click', '.modal-wrapper',function(e) { 337 var div = $(".modal"); // ÑÑÑ ÑказÑваем ID ÑлеменÑа 338 if (!div.is(e.target) // еÑли клик бÑл не по наÑÐµÐ¼Ñ Ð±Ð»Ð¾ÐºÑ 339 && div.has(e.target).length === 0) { // и не по его доÑеÑним ÑлеменÑам 340 $('.modal-wrapper').animate({opacity: 0}, 200, function (){ 341 $('.modal-wrapper').remove(); 342 }); 343 } 344 }); 345 346});
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.