1const verifyRecaptcha = '/ajax/verify/'; 2 3function sendCallback(token) { 4 5 // Check if reCAPTCHA token is present 6 if (token === undefined || token === null || token === '') { 7 // reCAPTCHA not completed 8 alert('ÐожалÑйÑÑа, заполниÑе reCAPTCHA.'); 9 return false; 10 } 11 12 var name = $('#callback_form').find('[name="name"]').val(); 13 var phone = $('#callback_form').find('[name="phone"]').val(); 14 var url = $('#send_callback').data('url'); 15 var url_target = $('#send_callback').data('url-target'); 16 var errors = 0; 17 18 if (name.length < 3) { 19 errors++; 20 $('#callback_form').find('[name="name"]').addClass('error'); 21 $('#callback_form').find('[name="name"]').parent().addClass('error'); 22 } else { 23 $('#without_ticket_form').find('[name="name"]').removeClass('error'); 24 $('#without_ticket_form').find('[name="name"]').parent().removeClass('error'); 25 } 26 27 if (phone.length < 6) { 28 errors++; 29 $('#callback_form').find('[name="phone"]').addClass('error'); 30 $('#callback_form').find('[name="phone"]').parent().addClass('error'); 31 } else { 32 $('#callback_form').find('[name="phone"]').removeClass('error'); 33 $('#callback_form').find('[name="phone"]').parent().removeClass('error'); 34 } 35 36 if (errors > 0) { 37 return false; 38 } 39 $.ajax({ 40 url: verifyRecaptcha, // Change the URL to the appropriate endpoint for reCAPTCHA verification 41 type: 'POST', 42 data: { token:token }, 43 dataType: 'JSON', 44 success: function (data) { 45 if (data.status == 'ok') { 46 $.ajax({ 47 url: url, 48 type: 'POST', 49 data: $('#callback_form').serialize(), 50 dataType: 'JSON', 51 success: function (data) { 52 $('#callback_form')[0].reset(); 53 location.href = url_target + '?act=subscribe'; 54 }, 55 error: function (xhr, status) { 56 // Handle error 57 } 58 }); //here need check 59 } else { 60 // reCAPTCHA validation failed 61 alert('ÐÑибка пÑовеÑки reCAPTCHA. ÐожалÑйÑÑа, попÑобÑйÑе еÑе Ñаз.'); 62 } 63 }, 64 error: function () { 65 // Error occurred during reCAPTCHA verification 66 alert('ÐÑибка пÑи вÑполнении пÑовеÑки reCAPTCHA. ÐожалÑйÑÑа, попÑобÑйÑе позже.'); 67 } 68 }); 69 70 return false; 71} 72 73function sendFeedback(token) { 74 75 // Check if reCAPTCHA token is present 76 if (token === undefined || token === null || token === '') { 77 // reCAPTCHA not completed 78 alert('ÐожалÑйÑÑа, заполниÑе reCAPTCHA.'); 79 return false; 80 } 81 82 var name = $('[data-form="feedback"]').find('[name="name"]').val(); 83 var phone = $('[data-form="feedback"]').find('[name="phone"]').val(); 84 var url = $('#send_feedback').data('url'); 85 var url_target = $('#send_feedback').data('url-target'); 86 var errors = 0; 87 88 if (name.length < 3) { 89 errors++; 90 $('[data-form="feedback"]').find('[name="name"]').addClass('error'); 91 $('[data-form="feedback"]').find('[name="name"]').parent().addClass('error'); 92 } else { 93 $('[data-form="feedback"]').find('[name="name"]').removeClass('error'); 94 $('[data-form="feedback"]').find('[name="name"]').parent().removeClass('error'); 95 } 96 97 if (phone.length < 6) { 98 errors++; 99 $('[data-form="feedback"]').find('[name="phone"]').addClass('error'); 100 $('[data-form="feedback"]').find('[name="phone"]').parent().addClass('error'); 101 } else { 102 $('[data-form="feedback"]').find('[name="phone"]').removeClass('error'); 103 $('[data-form="feedback"]').find('[name="phone"]').parent().removeClass('error'); 104 } 105 106 if (errors > 0) { 107 return false;
108 } 109 console.log(token) 110 $.ajax({ 111 url: verifyRecaptcha, // Change the URL to the appropriate endpoint for reCAPTCHA verification 112 type: 'POST', 113 data: { token:token }, 114 dataType: 'JSON', 115 success: function (data) { 116 if (data.status == 'ok') { 117 console.log('token good') 118 $.ajax({ 119 url: url, 120 type: 'POST', 121 data: { 122 name: name, 123 phone: phone, 124 message: $('[data-form="feedback"]').find('[name="message"]').val() 125 }, 126 dataType: 'JSON', 127 success: function(data) { 128 console.log('feedback') 129 $('[data-form="feedback"]')[0].reset(); 130 location.href = url_target + '?act=feedback'; 131 }, 132 error: function(xhr, status) { 133 // Handle error 134 } 135 }); 136 } else { 137 // reCAPTCHA validation failed 138 alert('ÐÑибка пÑовеÑки reCAPTCHA. ÐожалÑйÑÑа, попÑобÑйÑе еÑе Ñаз.'); 139 } 140 }, 141 error: function () { 142 // Error occurred during reCAPTCHA verification 143 alert('ÐÑибка пÑи вÑполнении пÑовеÑки reCAPTCHA. ÐожалÑйÑÑа, попÑобÑйÑе позже.'); 144 } 145 }); 146 147 return false; 148} 149 150function sendComment(token) { 151 // Check if reCAPTCHA token is present 152 if (token === undefined || token === null || token === '') { 153 // reCAPTCHA not completed 154 alert('ÐожалÑйÑÑа, заполниÑе reCAPTCHA.'); 155 return; 156 } 157 var send = $('[data-comment="send-button"]'); 158 var url = $('#send_comment').data('url'); 159 160 send.attr('disabled', 'disabled'); 161 var comment = { 162 name: $('[data-comment="name"]').val(), 163 comment: $('[data-comment="message"]').val(), 164 event: $('[data-comment="event"]').val(), 165 branch: $('[data-comment="parent"]').val(), 166 }; 167 168 if (!(comment['event'])){ 169 comment['event'] = null; 170 } 171 172 var error = { 173 name: false, 174 message: false, 175 } 176 177 if (comment.name.length < 3) { 178 error.name = true; 179 } 180 181 if (comment.comment.length < 7) { 182 error.message = true; 183 } 184 185 if (error.name) { 186 $('[data-comment="name"]').addClass('error'); 187 } 188 189 if (error.message) { 190 $('[data-comment="message"]').addClass('error'); 191 } 192 193 if (error.name || error.message) { 194 send.removeAttr('disabled'); 195 return; 196 } 197 198 $.ajax({ 199 url: verifyRecaptcha, // Change the URL to the appropriate endpoint for reCAPTCHA verification 200 type: 'POST', 201 data: { token:token }, 202 dataType: 'JSON', 203 success: function (data) { 204 if (data.status == 'ok') { 205 206 $.ajax({ 207 url: url, 208 type: 'POST', 209 data: { comment:comment }, 210 dataType: 'JSON', 211 success: function(data) { 212 213 if (data.status == 'error') 214 { 215 alert('ÐÑибка. ÐовÑоÑиÑе позже'); 216 return; 217 } 218 219 //Add new comment without moderation 220 221 /*if (data.review.branch) { 222 var html = '<div class="child_block">'+ 223 '<span class="arrow"></span>'+ 224 '<div class="rewies_message child">' + 225 '<div class="box">' + 226 '<div class="title">' + 227 '<img src="/images/icon-comment.png" class="icon" al
227ign="absmiddle"><span>'+data.review.name+'</span> '+data.review.date+ 228 '</div>'+ 229 '<div class="text">'+data.review.comment+'</div>'+ 230 '</div>'+ 231 '<a href="#comment_form" data-comment="answer" data-comment-id="'+data.review.branch+'">ÐÑвеÑиÑÑ</a>'+ 232 '</div>'; 233 '</div>'; 234 $('[comment-child-list="'+ data.review.branch +'"]').prepend(html); 235 } else { 236 var html = '<div class="rewies_message">' + 237 '<div class="box">' + 238 '<div class="title">' + 239 '<img src="/images/icon-comment.png" class="icon" align="absmiddle"><span>'+data.review.name+'</span> '+data.review.date+ 240 '</div>'+ 241 '<div class="text">'+data.review.comment+'</div>'+ 242 '</div>'+ 243 '<a href="#comment_form" data-comment="answer" data-comment-id="'+data.review.id+'">ÐÑвеÑиÑÑ</a>'+ 244 '</div>'; 245 $('[comment="list"]').prepend(html); 246 }*/ 247 248 send.removeAttr('disabled'); 249 250 $('[data-comment="name"]').val(''); 251 $('[data-comment="message"]').val(''); 252 alert('ÐомменÑаÑий оÑпÑавлен на модеÑаÑиÑ!'); 253 }, 254 error: function(xhr, status) { 255 alert('ÐомменÑаÑий не добавлен, повÑоÑиÑе позже.'); 256 send.removeAttr('disabled'); 257 } 258 }); 259 } else { 260 // reCAPTCHA validation failed 261 alert('ÐÑибка пÑовеÑки reCAPTCHA. ÐожалÑйÑÑа, попÑобÑйÑе еÑе Ñаз.'); 262 } 263 }, 264 error: function () { 265 // Error occurred during reCAPTCHA verification 266 alert('ÐÑибка пÑи вÑполнении пÑовеÑки reCAPTCHA. ÐожалÑйÑÑа, попÑобÑйÑе позже.'); 267 } 268 }); 269} 270 271function sendFastBuy(token) { 272 273 // Check if reCAPTCHA token is present 274 if (token === undefined || token === null || token === '') { 275 // reCAPTCHA not completed 276 alert('ÐожалÑйÑÑа, заполниÑе reCAPTCHA.'); 277 return false; 278 } 279 280 var url = $('#send_without_ticket_form').data('url'); 281 var url_target = $('#send_without_ticket_form').data('url-target'); 282 var name = $('#without_ticket_form').find('[name="name"]').val(); 283 var date = $('#without_ticket_form').find('[name="date"]').val(); 284 var phone = $('#without_ticket_form').find('[name="phone"]').val(); 285 var comment = $('#without_ticket_form').find('[name="comment"]').val(); 286 var place = $('#without_ticket_form').find('[name="place"]').val(); 287 var event = $('#without_ticket_form').find('[name="event"]').val(); 288 289 var errors = 0; 290 291 if (name.length < 3) { 292 $errors++; 293 $('#without_ticket_form').find('[name="name"]').addClass('error'); 294 $('#without_ticket_form').find('[name="name"]').parent().addClass('error'); 295 } else { 296 $('#without_ticket_form').find('[name="name"]').removeClass('error'); 297 $('#without_ticket_form').find('[name="name"]').parent().removeClass('error'); 298 } 299 300 if (phone.length < 6) { 301 $errors++; 302 $('#without_ticket_form').find('[name="phone"]').addClass('error'); 303 $('#without_ticket_form').find('[name="phone"]').parent().addClass('error'); 304 } else { 305 $('#without_ticket_form').find('[name="phone"]').removeClass('error'); 306 $('#without_ticket_form').find('[name="phone"]').parent().removeClass('error'); 307 } 308 309 if (errors > 0) { 310 return false;
311 } 312 313 $.ajax({ 314 url: verifyRecaptcha, // Change the URL to the appropriate endpoint for reCAPTCHA verification 315 type: 'POST', 316 data: { token:token }, 317 dataType: 'JSON', 318 success: function (data) { 319 if (data.status == 'ok') { 320 $.ajax({ 321 url: url, 322 type: 'POST', 323 data: { name:name, date:date, phone:phone, comment:comment, place:place, event:event }, 324 dataType: 'JSON', 325 success: function(data) { 326 $('#without_ticket_form')[0].reset(); 327 location.href = url_target + '?act=feedback'; 328 }, 329 error: function(xhr, status) { 330 } 331 }); 332 } else { 333 // reCAPTCHA validation failed 334 alert('ÐÑибка пÑовеÑки reCAPTCHA. ÐожалÑйÑÑа, попÑобÑйÑе еÑе Ñаз.'); 335 } 336 }, 337 error: function () { 338 // Error occurred during reCAPTCHA verification 339 alert('ÐÑибка пÑи вÑполнении пÑовеÑки reCAPTCHA. ÐожалÑйÑÑа, попÑобÑйÑе позже.'); 340 } 341 }); 342 343 return false; 344} 345 346function sendSchemeCallBack(token) { 347 348 // Check if reCAPTCHA token is present 349 if (token === undefined || token === null || token === '') { 350 // reCAPTCHA not completed 351 alert('ÐожалÑйÑÑа, заполниÑе reCAPTCHA.'); 352 return false; 353 } 354 355 var errors = 0; 356 if ($('#form_order_name').val().length < 3) { 357 $('#form_order_name').addClass('error'); 358 errors++; 359 } else { 360 $('#form_order_name').removeClass('error'); 361 } 362 363 if ($('#form_order_phone').val().length < 6) { 364 $('#form_order_phone').addClass('error'); 365 errors++; 366 } else { 367 $('#form_order_phone').removeClass('error'); 368 } 369 370 if (errors > 0) { 371 return; 372 } 373 374 var path = $('#send_new_tickets_order').attr('path'); 375 376 var name = $('#form_order_name').val(); 377 var date = $('#select_date option:selected').attr('data-str'); 378 var phone = $('#form_order_phone').val(); 379 var comment = $('#form_order_message').val(); 380 var place = $('#select_date option:selected').attr('data-place'); 381 var event = $('#form_order_event').val(); 382 383 if ( place == '' || place == undefined) { 384 place = $('#without_ticket_form').find('[name="place"]').val(); 385 } 386 387 $.ajax({ 388 url: verifyRecaptcha, // Change the URL to the appropriate endpoint for reCAPTCHA verification 389 type: 'POST', 390 data: { token: token }, 391 dataType: 'JSON', 392 success: function (data) { 393 if (data.status == 'ok') { 394 $.ajax({ 395 url: path, 396 type: 'POST', 397 data: { name:name, date:date, phone:phone, comment:comment, place:place, event:event }, 398 dataType: 'JSON', 399 success: function(data) { 400 //alert('СпаÑибо за заказ! ÐаÑвка на заказ билеÑов нами полÑÑена и пÑинÑÑа к ÑаÑÑмоÑÑениÑ. ÐÑ Ð² ÑкоÑом вÑемени обÑзаÑелÑно ÑвжемÑÑ Ñ Ð²Ð°Ð¼Ð¸ Ð´Ð»Ñ ÑÑоÑÐ½ÐµÐ½Ð¸Ñ Ð´ÐµÑалей'); 401 //yaCounter34811365.reachGoal('ORDER'); 402 //$('#wrapper_ticket_order').fadeOut('fast'); 403 $('#non_tickets').css({'display':'none'}); 404 $('#list_tickets').css({'display':'none'}); 405 $('#schema_tickets').css({'display':'none'}); 406 $('#tickets_form').css({'display':'none'}); 407 $('#success_send_order').css({'display':'block'}); 408 409 $('#form_order_name').val(''); 410 $('#form_order_phone').val(''); 411 $('#form_order_message').val(''); 412 413 } 414 }); 415 } else { 416 // reCAPTCHA validation failed 417 alert('ÐÑибка пÑовеÑки reCAPTCHA. ÐожалÑйÑÑа, попÑобÑйÑе еÑе Ñаз.'); 418 } 419 }, 420 error: function () { 421 // Error occurred during reCAPTCHA verification 422 alert('ÐÑибка пÑи вÑполнении пÑовеÑки reCAPTCHA. ÐожалÑйÑÑа, попÑобÑйÑе еÑе Ñаз.'); 423 } 424 }); 425} 426
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.