1(function ($) { 2 //jQuery time 3 var current_fs, next_fs, previous_fs; //fieldsets 4 var left, opacity, scale; //fieldset properties which we will animate 5 var animating; //flag to prevent quick multi-click glitches 6 var has_response = false; 7 var preview_clicked = false; 8 var next_clicked = false; 9 var step_click = false; 10 11 jQuery(document).ready(function ($) { 12 13 if($("form.wpcf7-form .cf7mls_progress_bar.cf7mls_bar_style_box_larerSign_squaren").height() >= 100) { 14 $('head').append('<style>.cf7mls_bar_style_box_larerSign_squaren.cf7mls_bar_style_text_vertical li:after{width: 74px;height: 74px;left: -36px;}</style>'); 15 } 16 // Transition effects 17 $("form.wpcf7-form").each(function (index, el) { 18 cf7mls_transition_effects(el, 'effects_in'); 19 }); 20 21 $("form.wpcf7-form").each(function (index, el) { 22 var totalFieldset = 0; 23 var this_form = $(el); 24 var findFieldset = $(el).find("fieldset.fieldset-cf7mls"); 25 if (findFieldset.length > 0) { 26 this_form.addClass('cf7mls') 27 $.each(findFieldset, function (i2, el2) { 28 if (i2 == 0) { 29 $(el2).addClass("cf7mls_current_fs"); 30 } 31 32 jQuery(el2).attr("data-cf7mls-order", i2); 33 totalFieldset = totalFieldset + 1; 34 //disable next button if the fieldset has wpcf7-acceptances 35 var acceptances = jQuery(el2).find("input:checkbox.wpcf7-acceptances"); 36 if (acceptances.length) { 37 cf7mls_toggle_next_btn(acceptances, el2); 38 } 39 }); 40 $.each(findFieldset, function (i2, el2) { 41 if (i2 == totalFieldset - 1) { 42 $(el2) 43 .find(".cf7mls_next") 44 .remove(); 45 } 46 }); 47 $(el).attr("data-count-fieldset", totalFieldset); 48 //on form submit 49 if(cf7mls_object.disable_submit == 'true') { 50 if (cf7mls_object.disable_enter_key) { 51 $(el) 52 .find('[type="submit"]') 53 .click(function (event) { 54 var findFieldset = $(el).find( 55 "fieldset.fieldset-cf7mls.cf7mls_current_fs" 56 ); 57 if (findFieldset.data("cf7mls-order") != totalFieldset - 1) { 58 findFieldset.find(".cf7mls_next").click(); 59 return false; 60 } 61 }); 62 } else { 63 $(el).submit(function (event) { 64 var findFieldset = $(el).find( 65 "fieldset.fieldset-cf7mls.cf7mls_current_fs" 66 ); 67 if (findFieldset.data("cf7mls-order") != totalFieldset - 1) { 68 findFieldset.find(".cf7mls_next").click(); 69 return false; 70 } 71 }); 72 } 73 } 74 } 75 //recall fields 76 $(el) 77 .find("input.wpcf7-cf7_recall") 78 .each(function (njt_a_i, njt_a_e) { 79 var $this = $(njt_a_e); 80 var qf = this_form.find('[name="' + $this.data("qf") + '"]'); 81 var sp = $("span.wpcf7-cf7_recall_" + $this.data("qf")); 82 var arrChecked = []; 83 84 var isCheckbox = false; 85 if($this.length > 0) { 86 isCheckbox = $this.data("qf") !== undefined && $this.data("qf").indexOf("cbmls") >= 0 ? true : false; 87 } 88 89 if (isCheckbox) { 90 qf = this_form.find('[name="' + $this.data("qf") + "[]" + '"]'); 91 qf.on("change", function (event) { 92 event.preventDefault(); 93 var _val = $(this).val(); 94 if( $(this).attr('type') == 'date' ) { 95 const D = new Date(_val); 96 _val = getFormattedDate(D); 97 } 98 var arrCheckedIndex = $.inArray(_val, arrChecked); 99 if (this.checked) { 100 if (arrCheckedIndex === -1) arrChecked.push(_val); 101 } else { 102 arrChecked.splice(arrCheckedIndex, 1); 103 } 104 sp.text(arrChecked.toString()); 105 $this.val(arrChecked.toString()); 106 }); 107 } else { 108 if (qf.val()) { 109 var _val = qf.val(); 110 sp.text(_val); 111 $this.val(_val); 112 } 113 qf.on("change", function (event) { 114 event.preventDefault(); 115 var _val = $(this).val(); 116 if( $(this).attr('type') == 'date' ) { 117 const D = new Date(_val); 118 _val = getFormattedDate(D); 119 } 120 sp.text(_val); 121 $this.val(_val); 122 }); 123 } 124 }); 125 });
126 127 // Background Color Progress Bar 128 $("form.wpcf7-form").each(function (index, el) { 129 let id_form = $(el).find('.cf7mls_progress_bar').attr('data-id-form'); 130 var progress_bar_bg_color = $(el).find('.cf7mls_progress_bar').attr('data-bg-color'); 131 $('head').append('<style id="cf7mls_style_progress_bar_' + id_form + '" type="text/css"></style>'); 132 if(progress_bar_bg_color && id_form) { 133 cf7mls_color_bar(progress_bar_bg_color, id_form, el); 134 } 135 }); 136 137 jQuery(document).on( 138 "click", 139 "form.wpcf7-form input:checkbox.wpcf7-acceptances", 140 function (event) { 141 //event.preventDefault(); 142 var $this = jQuery(this); 143 var parent_fieldset = $this.closest("fieldset.fieldset-cf7mls"); 144 if (parent_fieldset.length) { 145 var acceptances = jQuery(parent_fieldset).find( 146 "input:checkbox.wpcf7-acceptances" 147 ); 148 if (acceptances.length) { 149 cf7mls_toggle_next_btn(acceptances, parent_fieldset); 150 } 151 } 152 } 153 ); 154 155 $(document).on("click", ".cf7mls_next", function (event) { 156 if(next_clicked == false) { 157 next_clicked = true; 158 event.preventDefault(); 159 var $this = $(this); 160 $this.addClass("sending"); 161 current_fs = $this.closest(".fieldset-cf7mls"); 162 next_fs = current_fs.next(); 163 164 var form = $this.parent().closest("form.wpcf7-form"); 165 166 //signature fields 167 current_fs.find('.wpcf7-form-control-signature-global-wrap').each(function(j, wrapper){ 168 var f_id = $(wrapper).attr('data-field-id') 169 var canvas = $(wrapper).find('canvas') 170 if(typeof signatures != 'undefined') { 171 $.each(signatures, function(s_i, signature){ 172 if(signature.canvas.id == canvas.attr('id')) { 173 if (!signature.signature.isEmpty()){ 174 $('input[name="'+f_id+'"]').val(signature.canvas.toDataURL()) 175 }else{ 176 $('input[name="'+f_id+'"]').val("") 177 } 178 179 } 180 }) 181 } 182 }); 183 184 var fd = new FormData(); 185 $.each(form.find('input[type="file"]'), function (index, el) { 186 fd.append($(el).attr("name"), $(el)[0].files[0]); 187 }); 188 189 var other_data = form.serializeArray(); 190 $.each(other_data, function (key, input) { 191 fd.append(input.name, input.value); 192 }); 193 194 $.ajax({
195 url: cf7mls_object.ajax_url + "?action=cf7mls_validation", 196 type: "POST", 197 crossDomain: true, 198 data: fd, 199 processData: false, 200 contentType: false 201 }) 202 .done(function (msg) { 203 $this.removeClass("sending"); 204 var json = $.parseJSON(msg); 205 206 /* 207 * Insert _form_data_id if 'json variable' has 208 */ 209 if (typeof json._cf7mls_db_form_data_id != "undefined") { 210 if (!form.find('input[name="_cf7mls_db_form_data_id"]').length) { 211 form.append( 212 '<input type="hidden" name="_cf7mls_db_form_data_id" value="' + 213 json._cf7mls_db_form_data_id + 214 '" />' 215 ); 216 } 217 } 218 219 if (!json.success) { 220 var checkError = 0; 221 //reset error messages 222 current_fs 223 .find(".wpcf7-form-control-wrap") 224 .removeClass("cf7mls-invalid"); 225 current_fs.find(".cf7mls-invalid").removeClass("cf7mls-invalid"); 226 227 current_fs 228 .find(".wpcf7-form-control-wrap .wpcf7-not-valid-tip") 229 .remove(); 230 231 current_fs 232 .find(".wpcf7-form-control-wrap .wpcf7-not-valid") 233 .removeClass("wpcf7-not-valid"); 234 235 if (has_response) { 236 current_fs 237 .find(".wpcf7-response-output.wpcf7-validation-errors") 238 .removeClass("wpcf7-validation-errors"); 239 } else { 240 current_fs 241 .find(".wpcf7-response-output.wpcf7-validation-errors") 242 .remove(); 243 } 244 245 $.each(json.invalid_fields, function (index, el) { 246 if ( 247 current_fs.find('input[name="' + index + '"]').length || 248 current_fs.find('input[name="' + index + '[]"]').length || 249 current_fs.find('select[name="' + index + '"]').length || 250 current_fs.find('select[name="' + index + '[]"]').length || 251 current_fs.find('textarea[name="' + index + '"]').length || 252 current_fs.find('textarea[name="' + index + '[]"]').length || 253 current_fs.find('input[data-name="' + index + '"]').length || 254 current_fs.find('input[data-name="' + index + '[]"]').length 255 ) { 256 checkError = checkError + 1; 257 258 //var controlWrap = $('.wpcf7-form-control-wrap.' + index, form); 259 var controlWraps = [ 260 $('[name="' + index + '"]', form).parent(), 261 $('[name="' + index + '[]"]', form).parent(), 262 $('[data-name="' + index + '"]', form).parent(), 263 $('[data-name="' + index + '[]"]', form).parent() 264 ]; 265 $.each(controlWraps, function (i1, e1) { 266 var _c = "wpcf7-not-valid-tip"; 267 if (e1.hasClass("form-group")) { 268 e1.addClass("has-error"); 269 _c += " help-block"; 270 } 271 e1.addClass("cf7mls-invalid"); 272 e1.find("span.wpcf7-not-valid-tip").remove(); 273 e1.find(".wpcf7-validates-as-required").addClass( 274 "wpcf7-not-valid" 275 ); 276 if (e1.parents(".wpcf7-checkbox").length) { 277 e1.parents(".wpcf7-checkbox").after( 278 '<span role="alert" class="' + 279 _c + 280 '">' + 281 el.reason + 282 "</span>" 283 ); 284 } else if (e1.parents(".wpcf7-radio").length) { 285 e1.parents(".wpcf7-radio").after( 286 '<span role="alert" class="' + 287 _c + 288 '">' + 289 el.reason + 290 "</span>" 291 ); 292 } else { 293 e1.append( 294 '<span role="alert" class="' + 295 _c + 296 '">' + 297 el.reason + 298 "</span>" 299 ); 300 } 301 }); 302 303 //return false; 304 } 305 }); 306 307 if (checkError == 0) { 308 json.success = true; 309 has_response = false; 310 // jQuery("html, body").animate( 311 // { 312 // scrollTop: jQuery($this.closest("form")).offset().top - 110 313 // }, 314 // 1000 315 // ); 316 } else { 317 if (current_fs.find(".wpcf7-response-output").length) { 318 has_response = true; 319 320 $icon = ''; 321 $icon += '<svg class="wpcf7-icon-wraning" width="18px" height="18px" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">'; 322 $icon += '<g><path d="M499.9,361.6c-12.7,0-23,10.3-23,23v352.2c0,12.7,10.3,23,23,23s23-10.3,23-23V384.6C522.9,371.9,512.6,361.6,499.9,361.6z"/>';
323 $icon += '<path d="M500.1,240.2c-12.7,0-23,10.3-23,23v30.6c0,12.7,10.3,23,23,23c12.7,0,23-10.3,23-23v-30.6C523.1,250.5,512.8,240.2,500.1,240.2z"/>'; 324 $icon += '<path d="M500,10C229.4,10,10,229.4,10,500c0,270.6,219.4,490,490,490c270.6,0,490-219.4,490-490C990,229.4,770.6,10,500,10z M500,944.1C254.8,944.1,55.9,745.2,55.9,500C55.9,254.8,254.8,55.9,500,55.9S944.1,254.8,944.1,500C944.1,745.2,745.2,944.1,500,944.1z"/></g></svg>'; 325 current_fs 326 .find(".wpcf7-response-output") 327 .addClass("wpcf7-validation-errors") 328 .show() 329 .html($icon + json.message); 330 } else { 331 has_response = false; 332 $icon = ''; 333 $icon += '<svg class="wpcf7-icon-wraning" width="18px" height="18px" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">'; 334 $icon += '<g><path d="M499.9,361.6c-12.7,0-23,10.3-23,23v352.2c0,12.7,10.3,23,23,23s23-10.3,23-23V384.6C522.9,371.9,512.6,361.6,499.9,361.6z"/>'; 335 $icon += '<path d="M500.1,240.2c-12.7,0-23,10.3-23,23v30.6c0,12.7,10.3,23,23,23c12.7,0,23-10.3,23-23v-30.6C523.1,250.5,512.8,240.2,500.1,240.2z"/>'; 336 $icon += '<path d="M500,10C229.4,10,10,229.4,10,500c0,270.6,219.4,490,490,490c270.6,0,490-219.4,490-490C990,229.4,770.6,10,500,10z M500,944.1C254.8,944.1,55.9,745.2,55.9,500C55.9,254.8,254.8,55.9,500,55.9S944.1,254.8,944.1,500C944.1,745.2,745.2,944.1,500,944.1z"/></g></svg>'; 337 338 current_fs.append( 339 '<div class="wpcf7-response-output wpcf7-display-none wpcf7-validation-errors" style="display: block;" role="alert">' + $icon + 340 json.message + 341 "</div>" 342 343 344 ); 345 } 346 } 347 } 348 349 if (json.success) { 350 /* 351 current_fs.fadeOut('400', function() { 352 next_fs.fadeIn('400'); 353 }); 354 355 }); 356 */ 357 358 //reset error messages 359 current_fs 360 .find(".wpcf7-form-control-wrap") 361 .removeClass("cf7mls-invalid"); 362 current_fs.find(".cf7mls-invalid").removeClass("cf7mls-invalid"); 363 current_fs.find(".wpcf7-not-valid").removeClass("wpcf7-not-valid"); 364 current_fs 365 .find(".wpcf7-form-control-wrap .wpcf7-not-valid-tip") 366 .remove(); 367 368 /* 369 * Instead of hiding current fs, we hide all 370 */ 371 /* 372 current_fs.css({ 373 height: '0px', 374 overflow: 'hidden', 375 opacity: '0', 376 'visibility': 'hidden' 377 }).removeClass('cf7mls_current_fs'); 378 */ 379 380 form.find(".cf7mls_current_fs").addClass("cf7mls_back_fs"); 381 382 form.find(".fieldset-cf7mls").removeClass("cf7mls_current_fs"); 383 384 next_fs.addClass("cf7mls_current_fs"); 385 386 if (form.find(".cf7mls_progress_bar").length) { 387 let allow_choose_step = form.find('.cf7mls_progress_bar').attr('data-allow-choose-step'); 388 let order_cur = Number(form.find('fieldset.cf7mls-choose-step').attr('data-cf7mls-order')); 389 let step_cur = Number(form.find(".cf7mls_progress_bar li.current").attr('data-counter')) - 1; 390 391 // allow choose step 392 if(allow_choose_step === 'on') { 393 form.find('fieldset.fieldset-cf7mls').css({display: ''}); 394 form.find("fieldset.fieldset-cf7mls").removeClass("cf7mls-choose-step"); 395 for (let index = 0; index < step_cur; index++) { 396 console.log(index)
397 if(!$("form fieldset.fieldset-cf7mls[data-cf7mls-order="+index+"]").hasClass('cf7mls_back_fs')){ 398 $("form fieldset.fieldset-cf7mls[data-cf7mls-order="+index+"]").addClass('cf7mls_back_fs'); 399 } 400 } 401 } 402 403 if((allow_choose_step === 'on') && 404 ((order_cur !== step_cur) && ((order_cur === 0) || order_cur)) 405 ) { 406 407 $('form .cf7mls_progress_bar li.cf7_mls_steps_item').each(function( index) { 408 if($(this).hasClass('choose-step')) { 409 $(this).removeClass('choose-step'); 410 } 411 }); 412 form.find("fieldset.fieldset-cf7mls").removeClass("cf7mls_back_fs"); 413 form.find("fieldset.fieldset-cf7mls").removeClass("cf7mls_current_fs"); 414 415 form.find('fieldset.fieldset-cf7mls').each(function( index, el ) { 416 if(index > step_cur) { 417 return; 418 } 419 $(el).addClass("cf7mls_back_fs"); 420 if(index === step_cur) { 421 $(el).removeClass("cf7mls_back_fs"); 422 $(el).addClass("cf7mls_current_fs"); 423 } 424 }); 425 }else { 426 var cur = form.find("fieldset.fieldset-cf7mls").index(current_fs); 427 var nex = form.find("fieldset.fieldset-cf7mls").index(next_fs); 428 // if(cf7mls_object.is_rtl == '1') { 429 // cur = 0 - cur 430 // nex = 0 - nex 431 // } 432 form 433 .find(".cf7mls_progress_bar li") 434 .eq(cur) 435 .removeClass("current"); 436 form 437 .find(".cf7mls_progress_bar li") 438 .eq(nex) 439 .addClass("active current"); 440 441 cf7mls_step_item_finish(cur, nex, form, 'next'); 442 cf7mls_icon_check('next'); 443 } 444 } 445 446 447 // Progress Bar in ipad and mobie phone 448 if(form.find(".cf7mls_number_step_wrap").length) { 449 cf7mls_bar_process(form); 450 } 451 452 cf7mls_transition_effects(form, 'effects_next'); 453 454 dhScrollTo(form); 455 return false; 456 } else {} 457 next_clicked = false; 458 }) 459 .fail(function () { 460 $this.removeClass("sending"); 461 next_clicked = false; 462 // console.log("Validation error"); 463 }) 464 .always(function () { 465 $this.removeClass("sending"); 466 next_clicked = false; 467 // console.log("Validation complete"); 468 }); 469 470 return false; 471 } 472 }); 473 474 $(document).on("click", ".cf7mls_back", function (event) { 475 var $this = $(this); 476 var form = $this.parent().closest("form.wpcf7-form"); 477 478 $(".wpcf7-response-output.wpcf7-display-none") 479 .removeClass("wpcf7-validation-errors") 480 .removeAttr("style") 481 .html(""); 482 $(".wpcf7-response-output.wpcf7-display-none.wpcf7-mail-sent-ok").hide(); 483 484 current_fs = $this.closest(".fieldset-cf7mls"); 485 previous_fs = current_fs.prev(); 486 487 //reset error messages 488 current_fs.find(".wpcf7-form-control-wrap").removeClass("cf7mls-invalid"); 489 current_fs.find(".cf7mls-invalid").removeClass("cf7mls-invalid"); 490 current_fs.find(".wpcf7-not-valid").removeClass("wpcf7-not-valid"); 491 current_fs.find(".wpcf7-form-control-wrap .wpcf7-not-valid-tip").remove(); 492 493 /* 494 * Instead of hide current fs, we hide all 495 */ 496 /*current_fs.css({ 497 height: '0px', 498 overflow: 'hidden', 499 opacity: '0', 500 'visibility': 'hidden' 501 }).removeClass('cf7mls_current_fs');*/ 502 form.find(".fieldset-cf7mls").removeClass("cf7mls_current_fs"); 503 504 previous_fs.addClass("cf7mls_current_fs").removeClass("cf7mls_back_fs"); 505 506 if (form.find(".cf7mls_progress_bar").length) {
507 form.find('fieldset.fieldset-cf7mls').css({display: ''}); 508 let allow_choose_step = form.find('.cf7mls_progress_bar').attr('data-allow-choose-step'); 509 let order_cur = Number(form.find('fieldset.cf7mls-choose-step').attr('data-cf7mls-order')); 510 let step_cur = Number(form.find(".cf7mls_progress_bar li.choose-step").attr('data-counter')) - 1; 511 if((allow_choose_step === 'on') && 512 ((order_cur !== step_cur) && ((order_cur === 0) || order_cur)) 513 ) { 514 $('form .cf7mls_progress_bar li.cf7_mls_steps_item').each(function( index) { 515 if($(this).hasClass('choose-step')) { 516 $(this).removeClass('choose-step'); 517 $(this).addClass('active'); 518 $(this).addClass('current'); 519 if($(this).next().hasClass('cf7mls-steps-item-finish')) { 520 $(this).next().removeClass('active'); 521 $(this).next().removeClass('current'); 522 } 523 } else { 524 if($(this).hasClass('active') && $(this).hasClass('current') && !$(this).hasClass('cf7mls-steps-item-finish') ) { 525 $(this).removeClass('active'); 526 $(this).removeClass('current'); 527 } 528 } 529 }); 530 form.find("fieldset.fieldset-cf7mls").removeClass("cf7mls_back_fs"); 531 form.find("fieldset.fieldset-cf7mls").removeClass("cf7mls_current_fs"); 532 form.find("fieldset.fieldset-cf7mls").removeClass("cf7mls-choose-step"); 533 534 form.find('fieldset.fieldset-cf7mls').each(function( index, el ) { 535 if(index > step_cur) { 536 return; 537 } 538 $(el).addClass("cf7mls_back_fs"); 539 if(index === step_cur) { 540 $(el).removeClass("cf7mls_back_fs"); 541 $(el).addClass("cf7mls_current_fs"); 542 } 543 }); 544 }else { 545 var pre = form.find("fieldset.fieldset-cf7mls").index(previous_fs) 546 var cur = form.find("fieldset.fieldset-cf7mls").index(current_fs) 547 // if(cf7mls_object.is_rtl == '1') { 548 // pre = 0 - pre 549 // cur = 0 - cur 550 // } 551 form 552 .find(".cf7mls_progress_bar li") 553 .eq(pre) 554 .addClass("active current"); 555 form 556 .find(".cf7mls_progress_bar li") 557 .eq(cur) 558 .removeClass("active current"); 559 560 cf7mls_icon_check('back'); 561 cf7mls_step_item_finish(pre, cur, form, 'back'); 562 } 563 } 564 565 // Progress Bar in ipad and mobie phone 566 if(form.find(".cf7mls_number_step_wrap").length) { 567 cf7mls_bar_process(form); 568 } 569 570 cf7mls_transition_effects(form, 'effects_back'); 571 572 dhScrollTo(form); 573 return false; 574 }); 575 576 /* 577 * Preview Form Clicked 578 */ 579 $(document).on("click", ".cf7mls_close_preview", function (event) { 580 event.preventDefault(); 581 var $this = $(this); 582 var form = $this.closest("form.wpcf7-form"); 583 form.css('padding-top', '0px'); 584 form.find("ul.cf7mls_progress_bar").css('display', 'flex'); 585 form.find( ".cf7mls_close_preview" ).remove(); 586 form.css('overflow', ''); 587 // form.find(".fieldset-cf7mls").css({ 588 // height: "", 589 // overflow: "", 590 // opacity: "", 591 // visibility: "" 592 // }); 593 594 form.find(".cf7mls_back").css('display', ''); 595 form.find(".cf7mls_next").css('display', ''); 596 form.find(".wpcf7-cf7mls_preview_step").css('display', ''); 597 598 form.find('.fieldset-cf7mls').removeClass('cf7mls_preview_fs'); 599 600 form.find("input").removeAttr("disabled"); 601 form.find("button").removeAttr("disabled"); 602 form.find("select").removeAttr("disabled"); 603 form.find("textarea").removeAttr("disabled"); 604 605 form.removeClass("cf7mls_reviewing"); 606 $("body") 607 .find(".cf7mls_reviewing_overlay") 608 .remove(); 609 preview_clicked = !preview_clicked; 610 });
611 612 $(document).on("click", ".wpcf7-cf7mls_preview_step", function (event) { 613 event.preventDefault(); 614 var $this = $(this); 615 var form = $this.closest("form.wpcf7-form"); 616 617 if (preview_clicked === false) { 618 form.append("<div class=\"cf7mls_close_preview\"><span><i><svg viewBox=\"64 64 896 896\" data-icon=\"close\" width=\"1em\" height=\"1em\" fill=\"rgba(0, 0, 0, 0.45)\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 0 0 203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z\"></path></svg></i></span></div>"); 619 form.css('padding-top', '20px'); 620 form.find("ul.cf7mls_progress_bar").css('display', 'none'); 621 622 form.find(".cf7mls_back").css('display', 'none'); 623 form.find(".cf7mls_next").css('display', 'none'); 624 form.find(".wpcf7-cf7mls_preview_step").css('display', 'none'); 625 626 form.css('overflow', 'inherit'); 627 // form.find(".fieldset-cf7mls").css({ 628 // height: "auto", 629 // overflow: "visible", 630 // opacity: "1", 631 // visibility: "visible" 632 // }); 633 form.find("input").attr("disabled", "disabled"); 634 form.find("button").attr("disabled", "disabled"); 635 form.find("select").attr("disabled", "disabled"); 636 form.find("textarea").attr("disabled", "disabled"); 637 form.find(".wpcf7-cf7mls_preview_step").removeAttr("disabled"); 638 639 form.addClass("cf7mls_reviewing"); 640 $("body").append('<div class="cf7mls_reviewing_overlay"></div>'); 641 form.find('.fieldset-cf7mls').addClass('cf7mls_preview_fs'); 642 } else { 643 form.css('padding-top', '0px'); 644 form.find("ul.cf7mls_progress_bar").css('display', 'flex'); 645 form.find( ".cf7mls_close_preview" ).remove(); 646 form.css('overflow', ''); 647 // form.find(".fieldset-cf7mls").css({ 648 // height: "", 649 // overflow: "", 650 // opacity: "", 651 // visibility: "" 652 // }); 653 654 form.find(".cf7mls_back").css('display', ''); 655 form.find(".cf7mls_next").css('display', ''); 656 form.find(".wpcf7-cf7mls_preview_step").css('display', ''); 657 658 form.find('.fieldset-cf7mls').removeClass('cf7mls_preview_fs'); 659 660 form.find("input").removeAttr("disabled"); 661 form.find("button").removeAttr("disabled"); 662 form.find("select").removeAttr("disabled"); 663 form.find("textarea").removeAttr("disabled"); 664 665 form.removeClass("cf7mls_reviewing"); 666 $("body") 667 .find(".cf7mls_reviewing_overlay") 668 .remove(); 669 } 670 671 preview_clicked = !preview_clicked; 672 }); 673 }); 674 675 // Allow Choose Step 676 $("form.wpcf7-form").each(function (index, el) { 677 let style_bar = $(el).find('.cf7mls_progress_bar').attr('data-bg-style-bar'); 678 let step = ''; 679 if(style_bar == 'box_vertical_squaren' || 680 style_bar == 'box_larerSign_squaren' 681 ) { 682 step = $('.cf7mls_progress_bar li'); 683 step_click = '.cf7mls_progress_bar li'; 684 }else { 685 step = $('.cf7mls_progress_bar li .cf7_mls_steps_item_icon, .cf7mls_progress_bar li .cf7_mls_steps_item_content'); 686 step_click = '.cf7mls_progress_bar li .cf7_mls_steps_item_icon, .cf7mls_progress_bar li .cf7_mls_steps_item_content'; 687 } 688 }); 689 690 $(document).on("click", step_click, function (event) { 691 var allow_choose_step = $(this).parents('.cf7mls_progress_bar').attr('data-allow-choose-step'); 692 let style_bar = $(this).parents('.cf7mls_progress_bar').attr('data-bg-style-bar'); 693 if(allow_choose_step === 'on') { 694 var form = $(this).parents("form.wpcf7-form"); 695 form.find('.wpcf7-response-output').css('display', ''); 696 // form.find('.wpcf7-response-output').text(''); 697 let step_action = ''; 698 699 if(style_bar == 'box_vertical_squaren' || 700 style_bar == 'box_larerSign_squaren' 701 ) { 702 step_action = Number($(this).attr('data-counter')) - 1; 703 $( "form .cf7mls_progress_bar li.cf7_mls_steps_item" ).each(function( index ) {
704 $(this).removeClass('choose-step'); 705 if($(this).hasClass('active') && $(this).hasClass('current') && !$(this).hasClass('cf7mls-steps-item-finish')) { 706 $(this).removeClass('active'); 707 $(this).removeClass('current'); 708 $(this).addClass('choose-step'); 709 } 710 }); 711 if(!$(form.find(".cf7mls_progress_bar li.cf7_mls_steps_item[data-counter="+(step_action+1)+"]")).hasClass('cf7mls-steps-item-finish')) { 712 $(form.find(".cf7mls_progress_bar li.cf7_mls_steps_item[data-counter="+(step_action+1)+"]")).addClass('active'); 713 $(form.find(".cf7mls_progress_bar li.cf7_mls_steps_item[data-counter="+(step_action+1)+"]")).addClass('current'); 714 } 715 }else { 716 step_action = Number($(this).parents('li').attr('data-counter')) - 1; 717 $( "form .cf7mls_progress_bar li.cf7_mls_steps_item" ).each(function( index ) { 718 $(this).removeClass('choose-step'); 719 if($(this).hasClass('active') && $(this).hasClass('current') && !$(this).hasClass('cf7mls-steps-item-finish')) { 720 $(this).removeClass('active'); 721 $(this).removeClass('current'); 722 $(this).addClass('choose-step'); 723 if($(this).next().hasClass('cf7mls-steps-item-finish')) { 724 $(this).addClass('active'); 725 } 726 } 727 else if($(this).hasClass('active') && $(this).hasClass('current') && $(this).hasClass('cf7mls-steps-item-finish')) { 728 if( !$(this).next().hasClass('cf7mls-steps-item-finish') ){ 729 $(this).removeClass('active'); 730 } 731 $(this).addClass('choose-step'); 732 $(this).removeClass('current'); 733 // $(this).removeClass('cf7mls-steps-item-finish'); 734 } 735 }); 736 if(!$(form.find(".cf7mls_progress_bar li.cf7_mls_steps_item[data-counter="+step_action+"]")).next().hasClass('cf7mls-steps-item-finish')) { 737 $(form.find(".cf7mls_progress_bar li.cf7_mls_steps_item[data-counter="+(step_action+1)+"]")).addClass('active'); 738 $(form.find(".cf7mls_progress_bar li.cf7_mls_steps_item[data-counter="+(step_action+1)+"]")).addClass('current'); 739 } else { 740 $(form.find(".cf7mls_progress_bar li.cf7_mls_steps_item[data-counter="+(step_action+1)+"]")).addClass('active'); 741 $(form.find(".cf7mls_progress_bar li.cf7_mls_steps_item[data-counter="+(step_action+1)+"]")).addClass('current'); 742 } 743 } 744 745 $(form.find('.fieldset-cf7mls-wrapper .fieldset-cf7mls')[step_action]).removeClass('cf7mls-choose-step'); 746 form.find('.fieldset-cf7mls-wrapper .fieldset-cf7mls').removeClass('cf7mls_back_fs'); 747 form.find('.fieldset-cf7mls-wrapper .fieldset-cf7mls').removeClass('cf7mls_current_fs'); 748 form.find('.fieldset-cf7mls-wrapper .fieldset-cf7mls').removeClass('cf7mls-choose-step'); 749 750 form.find('.fieldset-cf7mls-wrapper .fieldset-cf7mls').css({display: 'none'}); 751 $(form.find('.fieldset-cf7mls-wrapper .fieldset-cf7mls')[step_action]).addClass('cf7mls_current_fs'); 752 $(form.find('.fieldset-cf7mls-wrapper .fieldset-cf7mls')[step_action]).addClass('cf7mls-choose-step'); 753 $(form.find('.fieldset-cf7mls-wrapper .fieldset-cf7mls')[step_action]).css({display: ''}); 754 // console.log(step_action); 755 cf7mls_transition_effects(form,'effects_next'); 756 } 757 }); 758 759 760 761 //jQuery(window).on("load", function () { 762 // jQuery.each(jQuery('form.wpcf7-form'), function(index, el) { 763 // var bar_li = jQuery('.cf7mls_progress_bar li', jQuery(el)); 764 // bar_li.css({ 765 // 'width' : "calc(100% / " + bar_li.length + ")" 766 // }); 767 // var le = jQuery('.cf7mls_progress_bar li', jQuery(el)).length; 768 // jQuery.each(jQuery('.cf7mls_progress_bar li', jQuery(el)), function(index, el) { 769 // jQuery(el).attr('data-counter', index + 1); 770 // jQuery(el).attr('data-counter_rtl', le); 771 // le--; 772 // }); 773 // }); 774 //}); 775 776 function cf7mls_is_not_last_fieldset(fieldset, total_fieldset) { 777 var order = fieldset.data("cf7mls-order"); 778 return order != total_fieldset; 779 } 780 781 function dhScrollTo(el) { 782 if (el.find(".fieldset-cf7mls-wrapper.no-scroll").length || el.hasClass('cf7mls-no-scroll')) { 783 return; 784 } 785 if (cf7mls_object.scroll_step == "true") { 786 $("html, body").animate({ 787 scrollTop: el.offset().top - 110 788 }, 789 "slow" 790 ); 791 } else if (cf7mls_object.scroll_step == "scroll_to_top") { 792 $("html, body").animate({ 793 scrollTop: $("body").offset().top - 110 794 }, 795 "slow" 796 ); 797 } 798 } 799 800 function cf7mls_toggle_next_btn(acceptances, fieldset) { 801 if (acceptances.length > 0) { 802 var ii = 0; 803 jQuery.each(acceptances, function (i, v) { 804 if (jQuery(v).is(":checked")) { 805 //console.log('checked'); 806 } else { 807 ii++; 808 } 809 }); 810 if (ii > 0) { 811 //console.log(ii);
812 jQuery(fieldset) 813 .find(".cf7mls_next") 814 .attr("disabled", "disabled"); 815 } else { 816 jQuery(fieldset) 817 .find(".cf7mls_next") 818 .removeAttr("disabled"); 819 } 820 } 821 } 822 823 // show, hide icon check 824 function cf7mls_icon_check(event) { 825 if(event == 'next') { 826 $('.cf7mls_progress_bar li').each(function(key, el) { 827 if(($(el).hasClass('active')) && !($(el).hasClass('current'))) { 828 $($(el).find('.cf7_mls_count_step')).css('display', 'none'); 829 $($(el).find('.cf7_mls_check')).css('display', 'block'); 830 } 831 }) 832 } 833 834 if(event == 'back') { 835 $('.cf7mls_progress_bar li').each(function(key, el) { 836 if(!($(el).hasClass('active')) || ($(el).hasClass('current'))) { 837 $($(el).find('.cf7_mls_count_step')).css('display', 'block'); 838 $($(el).find('.cf7_mls_check')).css('display', 'none'); 839 } 840 }) 841 } 842 } 843 844 // add, remove class step item finish 845 function cf7mls_step_item_finish (cur, nex, form, event) { 846 let style_text = form.find('.cf7mls_progress_bar').attr('data-style-text'); 847 let style_bar = form.find('.cf7mls_progress_bar').attr('data-bg-style-bar'); 848 /* 849 note: cur start form 0, nex start form 1. 850 */ 851 let numberItem; 852 if(style_text == 'horizontal' || style_text == 'no') { 853 if((style_bar == 'navigation_horizontal_squaren') || 854 (style_bar == 'navigation_horizontal_round') || 855 (style_bar == 'largerSign_squaren') || 856 (style_bar == 'largerSign_round') 857 ) { 858 numberItem = cur; 859 } 860 } 861 862 if(style_text == 'vertical') { 863 if((style_bar == 'navigation_horizontal_squaren') || 864 (style_bar == 'navigation_horizontal_round') || 865 (style_bar == 'largerSign_squaren') || 866 (style_bar == 'largerSign_round') 867 ) { 868 numberItem = nex; 869 } 870 } 871 872 if((style_bar == 'box_vertical_squaren') || 873 (style_bar == 'box_larerSign_squaren')) 874 { 875 numberItem = cur; 876 } 877 878 if((style_bar == 'horizontal_round') || 879 (style_bar == 'horizontal_squaren') 880 ) { 881 numberItem = nex; 882 } 883 884 if(numberItem || numberItem == '0') { 885 if(event == 'next') { 886 form 887 .find(".cf7mls_progress_bar li") 888 .eq(numberItem) 889 .addClass("cf7mls-steps-item-finish"); 890 }else if(event == 'back') { 891 form 892 .find(".cf7mls_progress_bar li") 893 .eq(numberItem) 894 .removeClass("cf7mls-steps-item-finish"); 895 } 896 897 } 898 } 899 900 function cf7mls_color_bar(color, id_form, el) { 901 let style_bar = 'cf7mls_bar_style_' + $(el).find('.cf7mls_progress_bar').attr('data-bg-style-bar'); 902 let style_text = 'cf7mls_bar_style_text_' + $(el).find('.cf7mls_progress_bar').attr('data-style-text'); 903 904 let css_item_icon = '.' + style_bar + '.' + style_text + '[data-id-form="'+ id_form +'"]' + ' li.active .cf7_mls_steps_item_icon { background: '+ color + ';}'; 905 let css_item_icon_befor = '.' + style_bar + '.' + style_text + '[data-id-form="'+ id_form +'"]' + ' li.active:before { background: '+ color + ';}'; 906 let css_bg_li = '.' + style_bar + '.' + style_text + '[data-id-form="'+ id_form +'"]' + ' li.active{ background: '+ color + ';}'; 907 let css_step = '.' + style_bar + '.' + style_text + '[data-id-form="'+ id_form +'"]' + ' li.active .cf7_mls_count_step{ color: '+ color + ';}' 908 let css_check = '.' + style_bar + '.' + style_text + '[data-id-form="'+ id_form +'"]' + ' li.active .cf7_mls_check{ color: '+ color + ';}'; 909 let css_li_after = '.' + style_bar + '.' + style_text + '[data-id-form="'+ id_form +'"]' + ' li.active:after{background: '+ color + ';}'; 910 let css_box_li_after = '.' + style_bar + '.' + style_text + '[data-id-form="'+ id_form +'"]' + ' li.active:after{background: #eaedef;}'; 911 let css_box_li_finish_after = '.' + style_bar + '.' + style_text + '[data-id-form="'+ id_form +'"]' + ' li.cf7mls-steps-item-finish + li:after{background:'+ color + ';}';
912 let css_box_li_before_finish_after = '.' + style_bar + '.' + style_text + '[data-id-form="'+ id_form +'"]' + ' li.active + li.cf7mls-steps-item-finish:after{background:'+ color + ';}'; 913 let css_active_title = '.' + style_bar + '.' + style_text + '[data-id-form="'+ id_form +'"]' + ' li.active .cf7mls_progress_bar_title{color: #fff;}'; 914 let classItemFinsish = '.' + style_bar + '.' + style_text + '[data-id-form="'+ id_form +'"]' + ' li.cf7mls-steps-item-finish'; 915 let classCurrent = '.' + style_bar + '.' + style_text + ' li.current'; 916 let css_title_after = '.cf7mls_progress_bar_title:after{background: '+ color + ';}'; 917 let css_title_border = '.cf7mls_progress_bar_title:after{border-color: '+ color + ';}'; 918 let css_li_cur = '.' + style_bar + '.' + style_text + ' li.current + li:after{ background: '+ color + ';}'; 919 920 let css_progress_bar = ''; 921 // progress bar on computer 922 if((style_bar == 'cf7mls_bar_style_navigation_horizontal_squaren') || 923 (style_bar == 'cf7mls_bar_style_largerSign_squaren') || 924 (style_bar == 'cf7mls_bar_style_navigation_horizontal_round') || 925 (style_bar == 'cf7mls_bar_style_largerSign_round') 926 ) { 927 switch (style_text) { 928 case 'cf7mls_bar_style_text_horizontal': 929 css_progress_bar += css_item_icon; 930 931 if((style_bar == 'cf7mls_bar_style_navigation_horizontal_squaren') || 932 (style_bar == 'cf7mls_bar_style_navigation_horizontal_round') 933 ) { 934 css_progress_bar += classItemFinsish + ' ' + css_title_after; 935 } 936 937 if((style_bar == 'cf7mls_bar_style_largerSign_squaren') || 938 (style_bar == 'cf7mls_bar_style_largerSign_round') 939 ) { 940 css_progress_bar += classItemFinsish + ' ' + '.cf7_mls_arrow_point_to_righ svg {fill: '+ color + ';}'; 941 } 942 943 break; 944 945 case 'cf7mls_bar_style_text_vertical': 946 css_progress_bar += css_item_icon_befor; 947 948 if((style_bar == 'cf7mls_bar_style_navigation_horizontal_squaren') || 949 (style_bar == 'cf7mls_bar_style_navigation_horizontal_round') 950 ) { 951 css_progress_bar += classItemFinsish + ':after{ background: '+ color + ';}'; 952 } 953 954 if((style_bar == 'cf7mls_bar_style_largerSign_squaren') || 955 (style_bar == 'cf7mls_bar_style_largerSign_round') 956 ) { 957 css_progress_bar += classItemFinsish + ':after{ border-color: '+ color + ';}'; 958 } 959 960 break; 961 962 case 'cf7mls_bar_style_text_no': 963 css_progress_bar += css_item_icon; 964 965 if((style_bar == 'cf7mls_bar_style_navigation_horizontal_squaren') || 966 (style_bar == 'cf7mls_bar_style_navigation_horizontal_round') 967 ) { 968 css_progress_bar += classItemFinsish + ' ' + css_title_after; 969 } 970 971 if((style_bar == 'cf7mls_bar_style_largerSign_squaren') || 972 (style_bar == 'cf7mls_bar_style_largerSign_round') 973 ) { 974 css_progress_bar += classItemFinsish + ' ' + css_title_border; 975 } 976 break; 977 } 978 } 979 980 if((style_bar == 'cf7mls_bar_style_horizontal_squaren') || 981 (style_bar == 'cf7mls_bar_style_horizontal_round') 982 ) { 983 if(style_text == 'cf7mls_bar_style_text_horizontal') { 984 css_progress_bar += css_item_icon; 985 css_progress_bar += classCurrent + ':before {background-color:' + color + '}'; 986 } 987 988 if((style_text == 'cf7mls_bar_style_text_vertical') || 989 (style_text == 'cf7mls_bar_style_text_no')) { 990 css_progress_bar += css_item_icon_befor; 991 css_progress_bar += classCurrent + ':after {background-color:' + color + '}'; 992 } 993 } 994 995 if(((style_bar == 'cf7mls_bar_style_box_vertical_squaren') || 996 (style_bar == 'cf7mls_bar_style_box_larerSign_squaren')) && 997 (style_text) 998 ) { 999 css_progress_bar += css_bg_li; 1000 css_progress_bar += css_step; 1001 css_progress_bar += css_check; 1002 css_progress_bar += css_li_after; 1003 css_progress_bar += css_active_title; 1004 } 1005 1006 if(style_bar == 'cf7mls_bar_style_box_larerSign_squaren') { 1007 css_progress_bar += css_li_cur; 1008 css_progress_bar += css_box_li_after; 1009 css_progress_bar += css_box_li_finish_after; 1010 css_progress_bar += css_box_li_before_finish_after; 1011 } 1012 1013 jQuery('style#cf7mls_style_progress_bar_' + id_form).text(css_progress_bar); 1014 } 1015 1016 // progress bar in ipad and mobie phone 1017 function cf7mls_bar_process(form) { 1018 let number_step_cur = form.find('.cf7mls_progress_bar li.current').attr('data-counter'); 1019 let number_step = form.find('.cf7mls_number_step_wrap').attr('data-number-step'); 1020 let bg_color = form.find('.cf7mls_number_step_wrap').attr('data-bg-color'); 1021 if(number_step_cur && number_step) { 1022 form.find('.cf7mls_number_step_wrap .cf7mls_number').text(number_step_cur + '/' + number_step); 1023 let title = $(form.find('.cf7mls_progress_bar li')[Number(number_step_cur) - 1]).find('.cf7mls_progress_bar_title').text(); 1024 form.find('.cf7mls_number_step_wrap .cf7mls_step_current').text(title); 1025 let percent_step = 100 / (Number(number_step) - 1); 1026 if(number_step_cur == '1') { 1027 form.find('.cf7mls_number_step_wrap .cf7mls_progress_barinner').css('width', ''); 1028 }else { 1029 form.find('.cf7mls_number_step_wrap .cf7mls_progress_barinner').css('width', ((percent_step * (Number(number_step_cur) - 1)) + '%')); 1030 } 1031 } 1032 1033 if(bg_color) { 1034 form.find('.cf7mls_number_step_wrap .cf7mls_progress_barinner').css('background', bg_color); 1035 } 1036 } 1037 1038 function cf7mls_transition_effects(form, transitions_bt) { 1039 var transition_effects = $(form).find(".fieldset-cf7mls-wrapper").attr("data-transition-effects"); 1040 if(transition_effects && typeof transition_effects !== undefined) { 1041 var effects = transition_effects.split(" "); 1042 var effect_form = { 1043 transition_effects: transition_effects, 1044 effects_back: '', 1045 effects_next: '', 1046 effects_in: '' 1047 }; 1048 1049 jQuery.each(effects, function(index, effect){ 1050 var es = effect.split("_"); 1051 1052 switch(es[0]) { 1053 case 'back': 1054 effect_form.effects_back = es[1]; 1055 break; 1056 case 'next': 1057 effect_form.effects_next = es[1]; 1058 break; 1059 case 'in': 1060 effect_form.effects_in = es[1]; 1061 break; 1062 } 1063 }) 1064 1065 if(transitions_bt == 'effects_in') { 1066 $(form).find('.fieldset-cf7mls-wrapper .cf7mls_current_fs').addClass(effect_form.effects_in + ' ' +"animated"); 1067 }else if(form.find(".fieldset-cf7mls-wrapper").length && transitions_bt) { 1068 form.find(".fieldset-cf7mls-wrapper .fieldset-cf7mls").removeClass(effect_form.effects_back); 1069 form.find(".fieldset-cf7mls-wrapper .fieldset-cf7mls").removeClass(effect_form.effects_next); 1070 form.find(".fieldset-cf7mls-wrapper .fieldset-cf7mls").removeClass(effect_form.effects_in); 1071 form.find(".fieldset-cf7mls-wrapper .fieldset-cf7mls").removeClass('animated'); 1072 form.find(".fieldset-cf7mls-wrapper .cf7mls_current_fs").addClass(effect_form[transitions_bt] + ' ' + "animated"); 1073 } 1074 } 1075 } 1076 1077 function getFormattedDate(date) { 1078 let year = date.getFullYear(); 1079 let month = (1 + date.getMonth()).toString().padStart(2, '0'); 1080 let day = date.getDate().toString().padStart(2, '0'); 1081 1082 return day + '.' + month + '.' + year; 1083 } 1084 1085})(jQuery);
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.