1var ITM_UGC = window.ITM_UGC || {}; 2ITM_UGC.ITM_OneCmsUGCLoad = false; 3ITM_UGC.ITM_OneCmsUGCLoad_Flag = ''; 4 5jQuery(document).ready(function( $ ){ 6 readyFn_UGCAjax( $ , 'document.ready' ); 7 ITM_UGC.ITM_OneCmsUGCLoad_Flag = 'document.ready'; 8}); 9 10//jQuery(document).ready(function($) { 11function readyFn_UGCAjax( $ , flagCheck = '') { 12 //alert('here'+flagCheck); 13 /*if (ITM_UGC.ITM_OneCmsUGCLoad) { 14 window.console.log('ITM_OneCmsUGCLoad return : '+flagCheck); 15 window.console.log('ITM_OneCmsUGCLoad_Flag : '+ITM_UGC.ITM_OneCmsUGCLoad_Flag); 16 return; 17 }*/ 18 19 //we need to call only once. if pjax and or document.ready above. 20 ITM_UGC.ITM_OneCmsUGCLoad = true; 21 22 23//jQuery(document).ready(function($) { 24 if (typeof ugc_image_language === "undefined") { 25 ugc_image_language = "english"; 26 } 27 28 //Image js 29 30 var ugcFormSubmit = 31 "/wp-content/plugins/wpb-ugc-v2/public/post/image-form-submit.php"; 32 33 $("#imageUploadButton").on("mouseup", function(event) { 34 event.preventDefault(); 35 var bootstrapValidator = $("#galleryUgcForm").data("bootstrapValidator"); 36 bootstrapValidator.validate(); 37 38 //------------------------------------------------------- 39 //WPB-3163 -- not using now. 40 /*var teamId = jQuery('#team').val(); 41 var galleryId_Sport = jQuery('#uploadGallery_select').val(); 42 //alert('teamId : '+ teamId + ' >> galleryId : ' + galleryId_Sport); 43 44 if (teamId && teamId != 'undefined') { 45 jQuery.ajax({ 46 type: "GET", 47 url: "/wp-content/plugins/wpb-ugc-v2/public/image-tags.php", 48 data: "teamId=" + teamId + "&galleryId=" + galleryId_Sport, 49 50 success: function(data) { 51 alert(data); 52 } 53 }); 54 }*/ 55 //return false; 56 //------------------------------------------------------- 57 //WPB-3163 -- single post page of team/sport/school 58 var sport_ugc_info_hidden_val = jQuery('#sport_ugc_info_hidden').val(); 59 var sport_ugc_info_other_val = jQuery('#sport_ugc_info_other').val(); 60 61 //school/team selection form. 62 var schoolId_Sport = jQuery('#school').val(); 63 var teamId_Sport = jQuery('#team').val(); 64 var galleryId_Sport = jQuery('#uploadGallery_select').val(); 65 var playlistId_Sport = jQuery('#uploadVideo_select').val(); 66 67 var sport_ugc_selection_val = ''; 68 69 if (schoolId_Sport || teamId_Sport) { 70 sport_ugc_selection_val = schoolId_Sport+'^@^'+teamId_Sport+'^@^'+galleryId_Sport+'^@^'+playlistId_Sport; 71 } 72 73 //alert(sport_ugc_selection_val); 74 75 //wpb-315 76 try { 77 //jQuery('#contest_signup_dialog_user_form') -- this is div. 78 var $form = jQuery("#galleryUgcForm"); 79 var $gdpr_div = $form.find(".gdpr_html_div_class"); 80 //alert($gdpr_div); 81 var gdpr_chk_id = $gdpr_div.find(".gdpr_chk_box").attr("id"); 82 //alert('gdpr_chk_id : '+gdpr_chk_id); 83 if (gdpr_chk_id && gdpr_chk_id != "undefined") { 84 //if found gdpr checkbox then only. 85 var chk_error_text = gdpr_chk_error_msg; 86 //alert('chk_error_text : '+chk_error_text); 87 if ($gdpr_div.find(".gdpr_chk_box").is(":checked")) { 88 //if terms gdpr checked then allow below code as usual. 89 } else { 90 alert(chk_error_text); 91 return false; 92 } 93 } 94 } catch (e) {} 95 96 if (bootstrapValidator.isValid()) { 97 var formData = new FormData($("#galleryUgcForm")[0]); 98 //WPB-3163 -- send to gallery form. 99 if (sport_ugc_info_hidden_val) { 100 formData.append('sport_ugc_info_hidden', sport_ugc_info_hidden_val); 101 } 102 if (sport_ugc_info_other_val) { 103 formData.append('sport_ugc_info_other', sport_ugc_info_other_val); 104 } 105 if (sport_ugc_selection_val) { 106 formData.append('sport_ugc_selection_val', sport_ugc_selection_val); 107 } 108 109 $("#loading_message_UGC").show(); 110 $("body, html").animate( 111 { scrollTop: $("#loading_message_UGC").offset().top }, 112 "slow" 113 ); 114 $.ajax({ 115 url: ugcFormSubmit, 116 type: "POST", 117 data: formData, 118 success: function(response) { 119 console.log(response); 120 $("#uploadImageFields").html(""); 121 //$("#uploadVideoField").html(''); 122 $("#galleryUgcForm")[0].reset(); 123 $("#loading_message_UGC").hide(); 124 $("#success_message_UGC").show(); 125 $("#success_message_UGC") 126 .delay(5000) 127 .fadeOut(); 128 $("#galleryUgcForm") 129 .data("bootstrapValidator") 130 .resetForm(); 131 //console.log(response) 132 }, 133 cache: false, 134 contentType: false, 135 processData: false 136 }); 137 } else { 138 return; 139 } 140 }); 141 142 $("#galleryUgcForm").bootstrapValidator({ 143 feedbackIcons: { 144 valid: "glyphicon glyphicon-ok", 145 invalid: "glyphicon glyphicon-remove", 146 validating: "glyphicon glyphicon-refresh" 147 }, 148 excluded: [":disabled"], 149 fields: { 150 uploaderName: { 151 validators: {
152 stringLength: { 153 min: 3, 154 message: 155 ugc_image_language == "spanish" 156 ? language_arr["Enter_Valid_Name"] 157 : "Please enter a valid name." 158 }, 159 notEmpty: { 160 message: 161 ugc_image_language == "spanish" 162 ? language_arr["Enter_Name"] 163 : "Please enter your name." 164 } 165 } 166 }, 167 uploaderEmail: { 168 validators: { 169 notEmpty: { 170 message: 171 ugc_image_language == "spanish" 172 ? language_arr["Enter_Email"] 173 : "Please enter your email address." 174 }, 175 emailAddress: { 176 message: 177 ugc_image_language == "spanish" 178 ? language_arr["Enter_Valid_Email"] 179 : "Please enter a valid email address." 180 } 181 } 182 }, 183 uploaderPhone: { 184 validators: { 185 phone: { 186 message: 187 ugc_image_language == "spanish" 188 ? language_arr["Enter_Valid_Phone"] 189 : "Please enter a valid phone number." 190 } 191 } 192 }, 193 uploadGallery: { 194 validators: { 195 notEmpty: { 196 message: 197 ugc_image_language == "spanish" 198 ? language_arr["Enter_Gallery"] 199 : "Please select gallery." 200 } 201 } 202 }, 203 uploadercomment: { 204 validators: { 205 notEmpty: { 206 message: 207 ugc_image_language == "spanish" 208 ? language_arr["Enter_Comment"] 209 : "Please enter your comments." 210 } 211 } 212 }, 213 "uplodedImages[]": { 214 validators: { 215 file: { 216 maxSize: 64 * 1024 * 1024, //64 MB 217 extension: "gif,jpg,png,jpeg,GIF,JPG,PNG,JPEG", 218 type: "image/gif,image/jpg,image/png,image/jpeg", 219 message: 220 ugc_image_language == "spanish" 221 ? language_arr["Enter_Valid_Image"] 222 : "The selected file is not valid, or the size is too large(max size 64MB)!" 223 }, 224 notEmpty: { 225 message: 226 ugc_image_language == "spanish" 227 ? language_arr["Atleast_One_Image"] 228 : "Please select atleast one image." 229 } 230 } 231 }, 232 "imgTitle[]": { 233 validators: { 234 stringLength: { 235 min: 3 236 }, 237 notEmpty: { 238 message: 239 ugc_image_language == "spanish" 240 ? language_arr["Enter_Image_Title"] 241 : "Please enter your Image Title." 242 } 243 } 244 } 245 } 246 }); 247 248 var regex = new RegExp("(.*?).(jpg|jpeg|png|gif)$"); 249 $("#uplodedImages").change(function(e) { 250 //WPB-391 251 var ugc_image_language_val = ""; 252 try { 253 var ugc_image_language_val = ugc_image_language; 254 } catch (err) {} 255 256 var image_title_place_holder = "Image Title"; 257 var image_caption_place_holder = "Image Caption"; 258 259 var image_title_label = "Title for"; 260 var image_caption_label = "Caption for"; 261 262 if (ugc_image_language_val == "spanish") { 263 image_title_place_holder = language_arr["Title"]; 264 image_caption_place_holder = language_arr["Caption"]; 265 266 image_title_label = language_arr["Title"]; 267 image_caption_label = language_arr["Caption"]; 268 } 269 270 $("#uploadImageFields").html(""); 271 var validated = true; 272 var val = $(this) 273 .val() 274 .toLowerCase(); 275 var numFiles = e.currentTarget.files.length; 276 for (var i = 0; i < numFiles; i++) { 277 file = e.currentTarget.files[i]; 278 279 if ("name" in file) { 280 var fileName = file.name; 281 } else { 282 var fileName = file.fileName; 283 } 284 285 fileName = fileName.toLowerCase(); 286 //console.log('fileName-'+fileName); 287 if (!regex.test(fileName)) { 288 validated = false; 289 } 290 } 291 if (validated) { 292 //console.log('validated-'+validated); 293 var files = $(this)[0].files; 294 $("#uploadImageFields").html(""); 295 for (var i = 0; i < files.length; i++) { 296 var html = ""; 297 var imageTitle = 298 files[i].name.substr(0, files[i].name.lastIndexOf(".")) || 299 files[i].name; 300 html = html + '<div class="form-group">'; 301 html = 302 html + 303 '<label class="col-md-3 control-label">' + 304 image_title_label + 305 " " + 306 files[i].name + 307 ":</label>"; 308 html = html + '<div class="col-md-8 inputGroupContainer">'; 309 html = html + '<div class="input-group">'; 310 html = 311 html + 312 '<span class="input-group-addon"><i class="glyphicon glyphicon-edit"></i></span>'; 313 html = 314 html + 315 '<input name="imgTitle[]" placeholder="' + 316 image_title_place_holder + 317 '" class="form-control" type="text" id="imgTitle' + 318 i + 319 '" value="' + 320 imageTitle + 321 '">'; 322 html = html + "</div>"; 323 html = html + "</div>"; 324 html = html + "</div>"; 325 html = html + '<div class="form-group">'; 326 html = 327 html + 328 ' <label class="col-md-3 control-label">' + 329 image_caption_label + 330 " " + 331 files[i].name + 332 ":</label> "; 333 html = html + ' <div class="col-md-8 inputGroupContainer">'; 334 html = html + ' <div class="input-group">'; 335 html = 336 html + 337 ' <span class="input-group-addon"><i class="glyphicon glyphicon-edit"></i></span>'; 338 html = 339 html + 340 ' <input name="imgCaption[]" placeholder="' + 341 image_caption_place_holder + 342 '" class="form-control" type="text" id="imgCaption' + 343 i + 344 '">';
345 html = html + " </div>"; 346 html = html + " </div>"; 347 html = html + " </div>"; 348 349 $("#uploadImageFields").append(html); 350 } 351 } 352 }); 353 354 //Video js 355 356 var ugcFormSubmitForVideos = 357 "/wp-content/plugins/wpb-ugc-v2/public/post/video-form-submit.php"; 358 359 $("#videoUploadButton").on("mouseup", function(event) { 360 event.preventDefault(); 361 var bootstrapValidator = $("#videoUgcForm").data("bootstrapValidator"); 362 bootstrapValidator.validate(); 363 364 //------------------------------------------------------- 365 //WPB-3163 -- single post page of team/sport/school 366 var sport_ugc_info_hidden_val = jQuery('#sport_ugc_info_hidden').val(); 367 var sport_ugc_info_other_val = jQuery('#sport_ugc_info_other').val(); 368 369 //school/team selection form. 370 var schoolId_Sport = jQuery('#school').val(); 371 var teamId_Sport = jQuery('#team').val(); 372 var galleryId_Sport = jQuery('#uploadGallery_select').val(); 373 var playlistId_Sport = jQuery('#uploadVideo_select').val(); 374 375 var sport_ugc_selection_val = ''; 376 377 if (schoolId_Sport || teamId_Sport) { 378 sport_ugc_selection_val = schoolId_Sport+'^@^'+teamId_Sport+'^@^'+galleryId_Sport+'^@^'+playlistId_Sport; 379 } 380 381 //wpb-315 382 try { 383 //jQuery('#contest_signup_dialog_user_form') -- this is div. 384 var $form = jQuery("#videoUgcForm"); 385 var $gdpr_div = $form.find(".gdpr_html_div_class"); 386 //alert($gdpr_div); 387 var gdpr_chk_id = $gdpr_div.find(".gdpr_chk_box").attr("id"); 388 //alert('gdpr_chk_id : '+gdpr_chk_id); 389 if (gdpr_chk_id && gdpr_chk_id != "undefined") { 390 //if found gdpr checkbox then only. 391 var chk_error_text = gdpr_chk_error_msg; 392 //alert('chk_error_text : '+chk_error_text); 393 if ($gdpr_div.find(".gdpr_chk_box").is(":checked")) { 394 //if terms gdpr checked then allow below code as usual. 395 } else { 396 alert(chk_error_text); 397 return false; 398 } 399 } 400 } catch (e) {} 401 402 if (bootstrapValidator.isValid()) { 403 var formData = new FormData($("#videoUgcForm")[0]); 404 //WPB-3163 -- send to gallery form. 405 if (sport_ugc_info_hidden_val) { 406 formData.append('sport_ugc_info_hidden', sport_ugc_info_hidden_val); 407 } 408 if (sport_ugc_info_other_val) { 409 formData.append('sport_ugc_info_other', sport_ugc_info_other_val); 410 } 411 if (sport_ugc_selection_val) { 412 formData.append('sport_ugc_selection_val', sport_ugc_selection_val); 413 } 414 415 $("#loading_message_UGCVideo").show(); 416 $("body, html").animate( 417 { scrollTop: $("#loading_message_UGCVideo").offset().top }, 418 "slow" 419 ); 420 $.ajax({ 421 url: ugcFormSubmitForVideos, 422 type: "POST", 423 data: formData, 424 success: function(response) { 425 console.log(response); 426 //$("#uploadImageFields").html(''); 427 $("#uploadVideoField").html(""); 428 $("#videoUgcForm")[0].reset(); 429 $("#loading_message_UGCVideo").hide(); 430 $("#success_message_UGCVideo").show(); 431 $("#success_message_UGCVideo") 432 .delay(5000) 433 .fadeOut(); 434 $("#videoUgcForm") 435 .data("bootstrapValidator") 436 .resetForm(); 437 //console.log(response) 438 }, 439 cache: false, 440 contentType: false, 441 processData: false 442 }); 443 } else { 444 return; 445 } 446 }); 447 448 $("#videoUgcForm").bootstrapValidator({ 449 feedbackIcons: { 450 valid: "glyphicon glyphicon-ok", 451 invalid: "glyphicon glyphicon-remove", 452 validating: "glyphicon glyphicon-refresh" 453 }, 454 excluded: [":disabled"], 455 fields: { 456 videoUploaderName: { 457 validators: { 458 stringLength: { 459 min: 3 460 }, 461 notEmpty: { 462 message: "Please enter your name." 463 } 464 } 465 }, 466 videoUploaderEmail: { 467 validators: { 468 notEmpty: { 469 message: "Please enter your email address." 470 }, 471 emailAddress: { 472 message: "Please enter a valid email address." 473 } 474 } 475 }, 476 videoUploaderPhone: { 477 validators: { 478 phone: { 479 message: 480 ugc_image_language == "spanish"
481 ? language_arr["Enter_Valid_Phone"] 482 : "Please enter a valid phone number." 483 } 484 } 485 }, 486 uploadGallery: { 487 validators: { 488 notEmpty: { 489 message: "Please select gallery." 490 } 491 } 492 }, 493 videoUploadercomment: { 494 validators: { 495 notEmpty: { 496 message: "Please enter your comments." 497 } 498 } 499 }, 500 "imgTitle[]": { 501 validators: { 502 stringLength: { 503 min: 3 504 }, 505 notEmpty: { 506 message: "Please enter your Image Title." 507 } 508 } 509 }, 510 uploadVideo: { 511 validators: { 512 notEmpty: { 513 message: "Please select Playlist." 514 } 515 } 516 }, 517 "uplodedVideo[]": { 518 validators: { 519 file: { 520 maxSize: 64 * 1024 * 1024, //64 MB 521 522 // extension: "wmv,avi,mp4,m4v,mov,avi", 523 // type: 524 // "video/x-ms-wmv,video/x-msvideo,video/mp4,video/x-m4v,video/quicktime,video/x-msvideo", 525 extension: "wmv,avi,mp4,m4v,flv,mov,mpeg,mpg", 526 type: 527 "video/x-ms-wmv,video/x-msvideo,video/mp4,video/x-m4v,video/x-flv,video/quicktime,video/mpeg,video/mpg", 528 529 message: 530 "The selected file is not valid, or the size is too large(max size 64MB)!" 531 }, 532 notEmpty: { 533 message: "Please select atleast one video." 534 } 535 } 536 } 537 } 538 }); 539 540 $("#uplodedVideo").change(function(e) { 541 var numFiles = e.currentTarget.files.length; 542 var validated = true; 543 if (numFiles > 0) { 544 var regexVid = new RegExp( 545 //"(.*?).(wmv|avi|mp4|mov|m4v)$" 546 "(.*?).(wmv|avi|mp4|mov|flv|m4v|mpg|mpeg)$" 547 ); 548 //console.log('numFiles-'+numFiles); 549 for (var i = 0; i < numFiles; i++) { 550 file = e.currentTarget.files[i]; 551 552 if ("name" in file) { 553 var fileName = file.name; 554 } else { 555 var fileName = file.fileName; 556 } 557 558 fileName = fileName.toLowerCase(); 559 560 if (!regexVid.test(fileName)) { 561 validated = false; 562 } 563 } 564 if (validated) { 565 var files = $(this)[0].files; 566 $("#uploadVideoField").html(""); 567 for (var i = 0; i < files.length; i++) { 568 var html = ""; 569 var videoTitle = 570 files[i].name.substr(0, files[i].name.lastIndexOf(".")) || 571 files[i].name; 572 html = html + '<div class="form-group">'; 573 html = 574 html + 575 '<label class="col-md-3 control-label">Title for ' + 576 files[i].name + 577 ":</label>"; 578 html = html + '<div class="col-md-8 inputGroupContainer">'; 579 html = html + '<div class="input-group">'; 580 html = 581 html + 582 '<span class="input-group-addon"><i class="glyphicon glyphicon-edit"></i></span>'; 583 html = 584 html + 585 '<input name="videoTitle[]" placeholder="Video Title" class="form-control" type="text" id="videoTitle' + 586 i + 587 '" value="' + 588 videoTitle + 589 '">'; 590 html = html + "</div>"; 591 html = html + "</div>"; 592 html = html + "</div>"; 593 html = html + '<div class="form-group">'; 594 html = 595 html + 596 ' <label class="col-md-3 control-label">Caption for ' + 597 files[i].name + 598 ":</label> "; 599 html = html + ' <div class="col-md-8 inputGroupContainer">'; 600 html = html + ' <div class="input-group">'; 601 html = 602 html + 603 ' <span class="input-group-addon"><i class="glyphicon glyphicon-edit"></i></span>'; 604 html = 605 html + 606 ' <input name="videoCaption[]" placeholder="Video Caption" class="form-control" type="text" id="videoCaption' + 607 i + 608 '">'; 609 html = html + " </div>"; 610 html = html + " </div>"; 611 html = html + " </div>"; 612 613 $("#uploadVideoField").append(html); 614 } 615 // $('#galleryUgcForm').bootstrapValidator('enableFieldValidators', 'uploadVideo',true) 616 //$('#galleryUgcForm').bootstrapValidator('validateField', 'uploadVideo'); 617 } 618 } 619 }); 620 621 //Audio js 622 623 var ugcFormSubmitForAudio = 624 "/wp-content/plugins/wpb-ugc-v2/public/post/audio-form-submit.php"; 625 626 $("#audioUgcForm").bootstrapValidator({ 627 feedbackIcons: { 628 valid: "glyphicon glyphicon-ok", 629 invalid: "glyphicon glyphicon-remove", 630 validating: "glyphicon glyphicon-refresh" 631 }, 632 excluded: [":disabled"], 633 fields: { 634 audioUploaderName: { 635 validators: {
636 stringLength: { 637 min: 3 638 }, 639 notEmpty: { 640 message: "Please enter your name." 641 } 642 } 643 }, 644 audioUploaderEmail: { 645 validators: { 646 notEmpty: { 647 message: "Please enter your email address." 648 }, 649 emailAddress: { 650 message: "Please enter a valid email address." 651 } 652 } 653 }, 654 audioUploaderPhone: { 655 validators: { 656 phone: { 657 message: 658 ugc_image_language == "spanish" 659 ? language_arr["Enter_Valid_Phone"] 660 : "Please enter a valid phone number." 661 } 662 } 663 }, 664 audioUploadercomment: { 665 validators: { 666 notEmpty: { 667 message: "Please enter your comments." 668 } 669 } 670 }, 671 "uplodedAudio[]": { 672 validators: { 673 file: { 674 maxSize: 64 * 1024 * 1024, //64 MB 675 extension: "mp3,ogg,m4a,ra,mid midi kar", 676 // type: 677 // "audio/mpeg,audio/ogg,audio/x-m4a,audio/x-realaudio,audio/midi", 678 679 message: 680 "The selected file is not valid, or the size is too large(max size 64MB)!" 681 }, 682 notEmpty: { 683 message: "Please select an audio." 684 } 685 } 686 } 687 } 688 }); 689 690 $("#uplodedAudio").change(function(e) { 691 var numFiles = e.currentTarget.files.length; 692 var validated = true; 693 if (numFiles > 0) { 694 var regexVid = new RegExp("(.*?).(mp3|mid|midi|kar|ogg|m4a|ra)$"); 695 console.log("numFiles-" + numFiles); 696 for (var i = 0; i < numFiles; i++) { 697 file = e.currentTarget.files[i]; 698 699 if ("name" in file) { 700 var fileName = file.name; 701 } else { 702 var fileName = file.fileName; 703 } 704 705 fileName = fileName.toLowerCase(); 706 707 if (!regexVid.test(fileName)) { 708 validated = false; 709 } 710 } 711 if (validated) { 712 var files = $(this)[0].files; 713 $("#uploadAudioField").html(""); 714 for (var i = 0; i < files.length; i++) { 715 var html = ""; 716 var audioTitle = 717 files[i].name.substr(0, files[i].name.lastIndexOf(".")) || 718 files[i].name; 719 html = html + '<div class="form-group">'; 720 html = 721 html + 722 '<label class="col-md-3 control-label">Title for ' + 723 files[i].name + 724 ":</label>"; 725 html = html + '<div class="col-md-8 inputGroupContainer">'; 726 html = html + '<div class="input-group">'; 727 html = 728 html + 729 '<span class="input-group-addon"><i class="glyphicon glyphicon-edit"></i></span>'; 730 html = 731 html + 732 '<input name="audioTitle[]" placeholder="Audio Title" class="form-control" type="text" id="audioTitle' + 733 i + 734 '" value="' + 735 audioTitle + 736 '">'; 737 html = html + "</div>"; 738 html = html + "</div>"; 739 html = html + "</div>"; 740 html = html + '<div class="form-group">'; 741 html = 742 html + 743 ' <label class="col-md-3 control-label">Caption for ' + 744 files[i].name + 745 ":</label> "; 746 html = html + ' <div class="col-md-8 inputGroupContainer">'; 747 html = html + ' <div class="input-group">'; 748 html = 749 html + 750 ' <span class="input-group-addon"><i class="glyphicon glyphicon-edit"></i></span>'; 751 html = 752 html + 753 ' <input name="audioCaption[]" placeholder="Audio Caption" class="form-control" type="text" id="audioCaption' + 754 i + 755 '">'; 756 html = html + " </div>"; 757 html = html + " </div>"; 758 html = html + " </div>"; 759 760 $("#uploadAudioField").append(html); 761 } 762 } 763 } 764 }); 765 766 $("#audioUploadButton").on("mouseup", function(event) { 767 event.preventDefault(); 768 var bootstrapValidator = $("#audioUgcForm").data("bootstrapValidator"); 769 bootstrapValidator.validate(); 770 771 //wpb-315 772 try { 773 //jQuery('#contest_signup_dialog_user_form') -- this is div. 774 var $form = jQuery("#audioUgcForm");
775 var $gdpr_div = $form.find(".gdpr_html_div_class"); 776 //alert($gdpr_div); 777 var gdpr_chk_id = $gdpr_div.find(".gdpr_chk_box").attr("id"); 778 //alert('gdpr_chk_id : '+gdpr_chk_id); 779 if (gdpr_chk_id && gdpr_chk_id != "undefined") { 780 //if found gdpr checkbox then only. 781 var chk_error_text = gdpr_chk_error_msg; 782 //alert('chk_error_text : '+chk_error_text); 783 if ($gdpr_div.find(".gdpr_chk_box").is(":checked")) { 784 //if terms gdpr checked then allow below code as usual. 785 } else { 786 alert(chk_error_text); 787 return false; 788 } 789 } 790 } catch (e) {} 791 792 if (bootstrapValidator.isValid()) { 793 var formData = new FormData($("#audioUgcForm")[0]); 794 $("#loading_message_UGCAudio").show(); 795 $("body, html").animate( 796 { scrollTop: $("#loading_message_UGCAudio").offset().top }, 797 "slow" 798 ); 799 $.ajax({ 800 url: ugcFormSubmitForAudio, 801 type: "POST", 802 data: formData, 803 success: function(response) { 804 console.log(response); 805 //$("#uploadImageFields").html(''); 806 $("#uploadAudioField").html(""); 807 $("#audioUgcForm")[0].reset(); 808 $("#loading_message_UGCAudio").hide(); 809 $("#success_message_UGCAudio").show(); 810 $("#success_message_UGCAudio") 811 .delay(5000) 812 .fadeOut(); 813 $("#audioUgcForm") 814 .data("bootstrapValidator") 815 .resetForm(); 816 //console.log(response) 817 }, 818 cache: false, 819 contentType: false, 820 processData: false 821 }); 822 } else { 823 return; 824 } 825 }); 826//}); 827}//End of function readyFn_UGCAjax
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.