1var cf7signature_resized = 0; // for compatibility with contact-form-7-signature-addon 2 3var wpcf7cf_timeout; 4 5var wpcf7cf_show_animation = { "height": "show", "marginTop": "show", "marginBottom": "show", "paddingTop": "show", "paddingBottom": "show" }; 6var wpcf7cf_hide_animation = { "height": "hide", "marginTop": "hide", "marginBottom": "hide", "paddingTop": "hide", "paddingBottom": "hide" }; 7 8var wpcf7cf_show_step_animation = { "width": "show", "marginLeft": "show", "marginRight": "show", "paddingRight": "show", "paddingLeft": "show" }; 9var wpcf7cf_hide_step_animation = { "width": "hide", "marginLeft": "hide", "marginRight": "hide", "paddingRight": "hide", "paddingLeft": "hide" }; 10 11var wpcf7cf_change_events = 'input.wpcf7cf paste.wpcf7cf change.wpcf7cf click.wpcf7cf propertychange.wpcf7cf'; 12 13var wpcf7cf_forms = []; 14 15function Wpcf7cfForm($form) { 16 17 var options_element = $form.find('input[name="_wpcf7cf_options"]').eq(0); 18 if (!options_element.length || !options_element.val()) { 19 // doesn't look like a CF7 form created with conditional fields plugin enabled. 20 return false; 21 } 22 23 var form = this; 24 25 var form_options = JSON.parse(options_element.val()); 26 27 form.$form = $form; 28 form.$hidden_group_fields = $form.find('[name="_wpcf7cf_hidden_group_fields"]'); 29 form.$hidden_groups = $form.find('[name="_wpcf7cf_hidden_groups"]'); 30 form.$visible_groups = $form.find('[name="_wpcf7cf_visible_groups"]'); 31 form.$repeaters = $form.find('[name="_wpcf7cf_repeaters"]'); 32 33 form.unit_tag = $form.closest('.wpcf7').attr('id'); 34 form.conditions = form_options['conditions']; 35 form.settings = form_options['settings']; 36 37 form.$groups = jQuery(); // empty jQuery set 38 form.repeaters = []; 39 form.multistep = null; 40 form.fields = []; 41 42 form.settings.animation_intime = parseInt(form.settings.animation_intime); 43 form.settings.animation_outtime = parseInt(form.settings.animation_outtime); 44 45 if (form.settings.animation === 'no') { 46 form.settings.animation_intime = 0; 47 form.settings.animation_outtime = 0; 48 } 49 50 form.updateGroups(); 51 form.updateEventListeners(); 52 form.displayFields(); 53 54 // bring form in initial state if the reset event is fired on it. 55 form.$form.on('reset', form, function(e) { 56 var form = e.data; 57 setTimeout(function(){ 58 form.displayFields(); 59 },200); 60 }); 61 62 // PRO ONLY 63 jQuery('.wpcf7cf_repeater', $form).each(function(){ 64 form.repeaters.push(new Wpcf7cfRepeater(jQuery(this),form)); 65 }); 66 67 $multistep = jQuery('.wpcf7cf_multistep'); 68 if ($multistep.length) { 69 form.steps = new Wpcf7cfMultistep($multistep, form); 70 } 71 72 // END PRO ONLY 73 74} 75Wpcf7cfForm.prototype.displayFields = function() { 76 77 var form = this; 78 79 var unit_tag = this.unit_tag; 80 var wpcf7cf_conditions = this.conditions; 81 var wpcf7cf_settings = this.settings; 82 83 //for compatibility with contact-form-7-signature-addon 84 if (cf7signature_resized === 0 && typeof signatures !== 'undefined' && signatures.constructor === Array && signatures.length > 0 ) { 85 for (var i = 0; i < signatures.length; i++) { 86 if (signatures[i].canvas.width === 0) { 87 88 var $sig_canvas = jQuery(".wpcf7-form-control-signature-body>canvas"); 89 var $sig_wrap = jQuery(".wpcf7-form-control-signature-wrap"); 90 $sig_canvas.eq(i).attr('width', $sig_wrap.width()); 91 $sig_canvas.eq(i).attr('height', $sig_wrap.height()); 92 93 cf7signature_resized = 1; 94 } 95 } 96 } 97 98 form.$groups.addClass('wpcf7cf-hidden'); 99 100 for (var i=0; i < wpcf7cf_conditions.length; i++) { 101 102 var condition = wpcf7cf_conditions[i]; 103 104 // compatibility with conditional forms created with older versions of the plugin ( < 1.4 ) 105 if (!('and_rules' in condition)) { 106 condition.and_rules = [{'if_field':condition.if_field,'if_value':condition.if_value,'operator':condition.operator}]; 107 } 108 109 var show_group = wpcf7cf.should_group_be_shown(condition, form.$form); 110 111 if (show_group) { 112 jQuery('[data-id='+condition.then_field+']',form.$form).eq(0).removeClass('wpcf7cf-hidden'); 113 } 114 } 115 116 var animation_intime = wpcf7cf_settings.animation_intime;
117 var animation_outtime = wpcf7cf_settings.animation_outtime; 118 119 form.$groups.each(function (index) { 120 $group = jQuery(this); 121 if ($group.is(':animated')) $group.finish(); // stop any current animations on the group 122 if ($group.css('display') === 'none' && !$group.hasClass('wpcf7cf-hidden')) { 123 if ($group.prop('tagName') === 'SPAN') { 124 $group.show().trigger('wpcf7cf_show_group'); 125 } else { 126 $group.animate(wpcf7cf_show_animation, animation_intime).trigger('wpcf7cf_show_group'); // show 127 } 128 } else if ($group.css('display') !== 'none' && $group.hasClass('wpcf7cf-hidden')) { 129 130 if ($group.attr('data-clear_on_hide') !== undefined) { 131 $inputs = jQuery(':input', $group).not(':button, :submit, :reset, :hidden'); 132 $inputs.prop('checked', false).prop('selected', false).prop('selectedIndex', 0); 133 $inputs.not('[type=checkbox],[type=radio],select').val(''); 134 $inputs.change(); 135 //display_fields(); 136 } 137 138 if ($group.prop('tagName') === 'SPAN') { 139 $group.hide().trigger('wpcf7cf_hide_group'); 140 } else { 141 $group.animate(wpcf7cf_hide_animation, animation_outtime).trigger('wpcf7cf_hide_group'); // hide 142 } 143 144 } 145 }); 146 147 form.updateHiddenFields(); 148}; 149Wpcf7cfForm.prototype.updateHiddenFields = function() { 150 151 var form = this; 152 153 var hidden_fields = []; 154 var hidden_groups = []; 155 var visible_groups = []; 156 157 form.$groups.each(function () { 158 var $this = jQuery(this); 159 if ($this.hasClass('wpcf7cf-hidden')) { 160 hidden_groups.push($this.data('id')); 161 $this.find('input,select,textarea').each(function () { 162 hidden_fields.push(jQuery(this).attr('name')); 163 }); 164 } else { 165 visible_groups.push($this.data('id')); 166 } 167 }); 168 169 form.hidden_fields = hidden_fields; 170 form.hidden_groups = hidden_groups; 171 form.visible_groups = visible_groups; 172 173 form.$hidden_group_fields.val(JSON.stringify(hidden_fields)); 174 form.$hidden_groups.val(JSON.stringify(hidden_groups)); 175 form.$visible_groups.val(JSON.stringify(visible_groups)); 176 177 return true; 178}; 179Wpcf7cfForm.prototype.updateGroups = function() { 180 var form = this; 181 form.$groups = form.$form.find('[data-class="wpcf7cf_group"]'); 182 183 form.$subgroups = form.$form.find('.wpcf7cf_repeater_sub [data-class="wpcf7cf_group"]'); 184 185 // var sub_conditions = []; 186 187 form.$subgroups.each(function() { 188 $group = jQuery(this); 189 var index = $group.data('repeater_index'); 190 var group_name_orig = $group.data('orig_id'); 191 192 form.conditions.forEach(function (condition) { 193 if (condition.then_field !== group_name_orig) return; 194 var and_rules = [];
195 condition.and_rules.forEach(function(entry) { 196 and_rules.push({if_field:entry.if_field+'__'+index, operator: entry.operator, if_value:entry.if_value}); 197 }); 198 form.conditions.push({ 199 then_field:condition.then_field+'__'+index, 200 and_rules: and_rules 201 }); 202 }); 203 }); 204 205}; 206Wpcf7cfForm.prototype.updateEventListeners = function() { 207 208 var form = this; 209 210 // monitor input changes, and call display_fields() if something has changed 211 jQuery('input, select, textarea, button',form.$form).not('.wpcf7cf_add, .wpcf7cf_remove').off(wpcf7cf_change_events).on(wpcf7cf_change_events,form, function(e) { 212 var form = e.data; 213 clearTimeout(wpcf7cf_timeout); 214 wpcf7cf_timeout = setTimeout(function() { 215 form.displayFields(); 216 }, 100); 217 }); 218 219 // PRO ONLY 220 jQuery('.wpcf7cf-togglebutton', form.$form).off('click.toggle_wpcf7cf').on('click.toggle_wpcf7cf',function() { 221 $this = jQuery(this); 222 if ($this.text() === $this.data('val-1')) { 223 $this.text($this.data('val-2')); 224 $this.val($this.data('val-2')); 225 } else { 226 $this.text($this.data('val-1')); 227 $this.val($this.data('val-1')); 228 } 229 }); 230 // END PRO ONLY 231}; 232 233// PRO ONLY 234function Wpcf7cfRepeater($repeater, form) { 235 var $ = jQuery; 236 237 var repeater = this; 238 239 var wpcf7cf_settings = form.settings; 240 241 repeater.form = form; 242 243 $repeater.num_subs = 0; 244 $repeater.id = $repeater.data('id'); 245 $repeater.min = typeof( $repeater.data('min')) !== 'undefined' ? parseInt($repeater.data('min')) : 1; 246 $repeater.max = typeof( $repeater.data('max')) !== 'undefined' ? parseInt($repeater.data('max')) : 200; 247 $repeater.initial_subs = typeof( $repeater.data('initial')) !== 'undefined' ? parseInt($repeater.data('initial')) : $repeater.min; 248 if ($repeater.initial_subs > $repeater.max) $repeater.initial_subs = $repeater.max; 249 var $repeater_sub = $repeater.find('.wpcf7cf_repeater_sub').eq(0); 250 var $repeater_controls = $repeater.find('.wpcf7cf_repeater_controls').eq(0); 251 252 var $clone = $repeater_sub.clone(); 253 $clone.find('[name]').each(function() { 254 $this = jQuery(this); 255 var orig_name = $this.attr('name'); 256 var new_name = orig_name+'__{{repeater_index}}'; 257 $this.attr('name', new_name); 258 $this.attr('data-orig_name', orig_name); 259 $this.closest('.wpcf7-form-control-wrap').addClass(new_name); 260 }); 261 $clone.find("[data-class='wpcf7cf_group']").each(function() { 262 $this = jQuery(this); 263 var orig_id = $this.data('id'); 264 var new_id = orig_id+'__{{repeater_index}}'; 265 $this.attr('data-repeater_index', '{{repeater_index}}'); 266 $this.attr('data-id', new_id); 267 }); 268 var repeater_sub_html = $clone[0].outerHTML; 269 270 271 var params = { 272 $repeater: $repeater, 273 $repeater_count_field: $repeater.find('#'+$repeater.id+'_count').eq(0), 274 repeater_sub_html: repeater_sub_html, 275 $repeater_controls: $repeater_controls, 276 $button_add: $repeater_controls.find('.wpcf7cf_add').eq(0), 277 $button_remove: $repeater_controls.find('.wpcf7cf_remove').eq(0), 278 wpcf7cf_settings: wpcf7cf_settings 279 }; 280 281 this.params = params; 282 283 jQuery('.wpcf7cf_add',$repeater).click( repeater, function(e) { 284 var repeater = e.data; 285 repeater.updateSubs(params.$repeater.num_subs+1); 286 }); 287 288 jQuery('.wpcf7cf_remove',$repeater).click( repeater,function(e) { 289 var repeater = e.data; 290 repeater.updateSubs(params.$repeater.num_subs-1); 291 }); 292 293 jQuery('.wpcf7cf_repeater_sub',params.$repeater).remove(); 294 repeater.updateSubs($repeater.initial_subs); 295 296} 297Wpcf7cfRepeater.prototype.updateSubs = function(subs_to_show) { 298 var repeater = this; 299 var params = repeater.params; 300 var subs_to_add = subs_to_show - params.$repeater.num_subs; 301 302 if (subs_to_add < 0) { 303 repeater.removeSubs(-subs_to_add); 304 } else if (subs_to_add > 0) { 305 repeater.addSubs(subs_to_add); 306 } 307 308 var showButtonRemove = false;
309 var showButtonAdd = false; 310 311 if (params.$repeater.num_subs < params.$repeater.max) { 312 showButtonAdd = true; 313 } 314 if (params.$repeater.num_subs > params.$repeater.min) { 315 showButtonRemove = true; 316 } 317 318 if (showButtonAdd) { 319 params.$button_add.show(); 320 } else { 321 params.$button_add.hide(); 322 323 } 324 325 if (showButtonRemove) { 326 params.$button_remove.show(); 327 } else { 328 params.$button_remove.hide(); 329 } 330 331 params.$repeater_count_field.val(subs_to_show); 332 333}; 334Wpcf7cfRepeater.prototype.addSubs = function(subs_to_add) { 335 var $ = jQuery; 336 var params = this.params; 337 var repeater = this; 338 var form = repeater.form; 339 340 341 var $repeater = params.$repeater; 342 var $repeater_controls = params.$repeater_controls; 343 344 //jQuery(params.repeater_sub_html.replace(/name="(.*?)"/g,'name="wpcf7cf_repeater['+$repeater.id+']['+$repeater.num_subs+'][$1]" data-original-name="$1"')).hide().insertBefore($repeater_controls).animate(wpcf7cf_show_animation, params.wpcf7cf_settings.animation_intime); 345 346 var html_str = ''; 347 348 for(var i=1; i<=subs_to_add; i++) { 349 var sub_index = $repeater.num_subs+i; 350 html_str += params.repeater_sub_html.replace(/\{\{repeater_index\}\}/g,sub_index); 351 } 352 353 jQuery(html_str).hide().insertBefore($repeater_controls).animate(wpcf7cf_show_animation, params.wpcf7cf_settings.animation_intime); 354 355 $repeater.num_subs+= subs_to_add; 356 357 form.updateGroups(); 358 form.updateEventListeners(); 359 form.displayFields(); 360 361 return false; 362}; 363Wpcf7cfRepeater.prototype.removeSubs = function(num_subs) { 364 var $ = jQuery; 365 var params = this.params; 366 var form = this.form; 367 368 params.$repeater.num_subs-= num_subs; 369 370 jQuery('.wpcf7cf_repeater_sub',params.$repeater).slice(-num_subs).animate(wpcf7cf_hide_animation, {duration:params.wpcf7cf_settings.animation_intime, done:function() { 371 jQuery(this).remove(); 372 form.updateGroups(); 373 form.updateEventListeners(); 374 form.displayFields(); 375 }}); 376 377 return false; 378}; 379 380function Wpcf7cfMultistep($multistep, form) { 381 var multistep = this; 382 multistep.$multistep = $multistep; 383 multistep.form = form; 384 multistep.$steps = $multistep.find('.wpcf7cf_step'); 385 multistep.$btn_next = $multistep.find('.wpcf7cf_next'); 386 multistep.$btn_prev = $multistep.find('.wpcf7cf_prev'); 387 multistep.current_step = 0; 388 389 multistep.$btn_next.click(function() { 390 multistep.validateStep(multistep.current_step) 391 }); 392 393 multistep.$btn_prev.click(function() { 394 multistep.moveToStep(multistep.current_step-1); 395 }); 396 397 multistep.moveToStep(1); 398} 399Wpcf7cfMultistep.prototype.validateStep = function(step_index) { 400 401 var multistep = this; 402 var $multistep = multistep.$multistep; 403 404 var formData = new FormData(multistep.form.$form[0]); 405 406 //validation 407 var $form = multistep.form.$form; 408 409 var fd = new FormData(); 410 411 jQuery.each($form.find('input[type="file"]'), function(index, el) { 412 fd.append(jQuery(el).attr('name'), jQuery(el)[0].files[0]); 413 }); 414 415 var other_data = $form.serializeArray(); 416 jQuery.each(other_data,function(key, input){ 417 fd.append(input.name, input.value); 418 }); 419 420 jQuery.ajax({ 421 url: wpcf7cf_global_settings.ajaxurl + '?action=wpcf7cf_validate_step', 422 type: 'POST', 423 data: fd, 424 processData: false, 425 contentType: false, 426 dataType: 'json', 427 }).done(function(json) { 428 429 /* 430 * Insert _form_data_id if 'json variable' has 431 */ 432 if (typeof json._cf7mls_db_form_data_id != 'undefined') { 433 if (!form.find('input[name="_cf7mls_db_form_data_id"]').length) { 434 form.append('<input type="hidden" name="_cf7mls_db_form_data_id" value="'+json._cf7mls_db_form_data_id+'" />'); 435 } 436 } 437 438 if (!json.success) { 439 var checkError = 0; 440 //reset error messages 441 $multistep.find('.wpcf7-form-control-wrap').removeClass('cf7mls-invalid'); 442 $multistep.find('.wpcf7-form-control-wrap .wpcf7-not-valid-tip').remove(); 443 444 $multistep.find('.wpcf7-response-output.wpcf7-validation-errors').removeClass('wpcf7-validation-errors'); 445 446 447 jQuery.each(json.invalid_fields, function(index, el) { 448 if ($multistep.find('input[name="'+index+'"]').length || 449 $multistep.find('input[name="'+index+'[]"]').length || 450 $multistep.find('select[name="'+index+'"]').length || 451 $multistep.find('select[name="'+index+'[]"]').length || 452 $multistep.find('textarea[name="'+index+'"]').length || 453 $multistep.find('textarea[name="'+index+'[]"]').length 454 ) { 455 checkError = checkError + 1; 456 457 var controlWrap = jQuery('.wpcf7-form-control-wrap.' + index, $form); 458 controlWrap.addClass('cf7mls-invalid'); 459 controlWrap.find('span.wpcf7-not-valid-tip').remove(); 460 controlWrap.append('<span role="alert" class="wpcf7-not-valid-tip">' + el.reason + '</span>'); 461 462 //return false;
463 } 464 }); 465 466 $multistep.append('<div class="wpcf7-response-output wpcf7-display-none wpcf7-validation-errors" style="display: block;" role="alert">' + json.message + '</div>'); 467 468 } 469 470 if (json.success) { 471 472 /* 473 $multistep.fadeOut('400', function() { 474 next_fs.fadeIn('400'); 475 }); 476 477 }); 478 */ 479 480 $multistep.css({ 481 height: '0px', 482 overflow: 'hidden', 483 opacity: '0', 484 'visibility': 'hidden' 485 }).removeClass('cf7mls_$multistep'); 486 next_fs.css({ 487 height: 'auto', 488 overflow: 'visible', 489 opacity: '1', 490 'visibility': 'visible' 491 }).addClass('cf7mls_$multistep'); 492 dhScrollTo(form); 493 494 495 return false; 496 497 } else { 498 499 } 500 }).fail(function() { 501 console.log("Validation error"); 502 }).always(function() { 503 console.log("Validation complete"); 504 }); 505 506}; 507Wpcf7cfMultistep.prototype.moveToStep = function(step_index) { 508 var multistep = this; 509 multistep.current_step = step_index; 510 multistep.$steps.animate(wpcf7cf_hide_step_animation, multistep.form.settings.animation_outtime); 511 multistep.$steps.eq(step_index-1).animate(wpcf7cf_show_step_animation, multistep.form.settings.animation_intime); 512 // jQuery(html_str).hide().insertBefore($repeater_controls).animate(wpcf7cf_show_animation, params.wpcf7cf_settings.animation_intime); 513}; 514// END PRO ONLY 515 516var wpcf7cf = { 517 518 // keep this for backwards compatibility 519 initForm : function($form) { 520 wpcf7cf_forms.push(new Wpcf7cfForm($form)); 521 }, 522 523 should_group_be_shown : function(condition, $current_form) { 524 525 var $ = jQuery; 526 527 var show_group = true; 528 529 for (var and_rule_i = 0; and_rule_i < condition.and_rules.length; and_rule_i++) { 530 531 var condition_ok = false; 532 533 var condition_and_rule = condition.and_rules[and_rule_i]; 534 535 var $field = jQuery('[name="' + condition_and_rule.if_field + '"], [name="' + condition_and_rule.if_field + '[]"], [data-original-name="' + condition_and_rule.if_field + '"], [data-original-name="' + condition_and_rule.if_field + '[]"]',$current_form); 536 537 var if_val = condition_and_rule.if_value; 538 var if_val_as_number = isFinite(parsedval=parseFloat(if_val)) ? parsedval:0; 539 var operator = condition_and_rule.operator; 540 var regex_patt = new RegExp(if_val, 'i'); 541 542 543 if ($field.length === 1) { 544 545 // single field (tested with text field, single checkbox, select with single value (dropdown), select with multiple values) 546 547 if ($field.is('select')) { 548 549 if (operator === 'not equals') { 550 condition_ok = true; 551 } 552 553 $field.find('option:selected').each(function () { 554 var $option = jQuery(this); 555 option_val = $option.val() 556 if ( 557 operator === 'equals' && option_val === if_val || 558 operator === 'equals (regex)' && regex_patt.test($option.val()) 559 ) { 560 condition_ok = true; 561 } else if ( 562 operator === 'not equals' && option_val === if_val || 563 operator === 'not equals (regex)' && !regex_patt.test($option.val()) 564 ) { 565 condition_ok = false; 566 return false; // break out of the loop 567 } 568 }); 569 570 show_group = show_group && condition_ok; 571 } 572 573 var field_val = $field.val(); 574 var field_val_as_number = isFinite(parsedval=parseFloat(field_val)) ? parsedval:0; 575 576 if ($field.attr('type') === 'checkbox') { 577 var field_is_checked = $field.is(':checked'); 578 if ( 579 operator === 'equals' && field_is_checked && field_val === if_val || 580 operator === 'not equals' && !field_is_checked || 581 operator === 'is empty' && !field_is_checked || 582 operator === 'not empty' && field_is_checked || 583 operator === '>' && field_is_checked && field_val_as_number > if_val_as_number || 584 operator === '<' && field_is_checked && field_val_as_number < if_val_as_number || 585 operator === 'â¥' && field_is_checked && field_val_as_number >= if_val_as_number || 586 operator === 'â¤' && field_is_checked && field_val_as_number <= if_val_as_number || 587 operator === 'equals (regex)' && field_is_checked && regex_patt.test(field_val) || 588 operator === 'not equals (regex)' && !field_is_checked 589 590 ) { 591 condition_ok = true; 592 } 593 } else if ( 594 operator === 'equals' && field_val === if_val || 595 operator === 'not equals' && field_val !== if_val || 596 operator === 'equals (regex)' && regex_patt.test(field_val) || 597 operator === 'not equals (regex)' && !regex_patt.test(field_val) || 598 operator === '>' && field_val_as_number > if_val_as_number || 599 operator === '<' && field_val_as_number < if_val_as_number || 600 operator === 'â¥' && field_val_as_number >= if_val_as_number || 601 operator === 'â¤' && field_val_as_number <= if_val_as_number || 602 operator === 'is empty' && field_val === '' || 603 operator === 'not empty' && field_val !== '' || 604 ( 605 operator === 'function' 606 && typeof window[if_val] == 'function' 607 && window[if_val]($field) 608 ) 609 ) { 610 condition_ok = true; 611 } 612 613 614 } else if ($field.length > 1) { 615 616 // multiple fields (tested with checkboxes, exclusive checkboxes, dropdown with multiple values) 617 618 var all_values = []; 619 var checked_values = []; 620 $field.each(function () { 621 all_values.push(jQuery(this).val()); 622 if (jQuery(this).is(':checked')) { 623 checked_values.push(jQuery(this).val()); 624 } 625 }); 626 627 var checked_value_index = jQuery.inArray(if_val, checked_values); 628 var value_index = jQuery.inArray(if_val, all_values); 629 630 if ( 631 ( operator === 'is empty' && checked_values.length === 0 ) || 632 ( operator === 'not empty' && checked_values.length > 0 ) 633 ) { 634 condition_ok = true; 635 } 636 637 638 for (var ind = 0; ind < checked_values.length; ind++) { 639 var checked_val = checked_values[ind]; 640 var checked_val_as_number = isFinite(parsedval=parseFloat(checked_val)) ? parsedval:0; 641 if ( 642 ( operator === 'equals' && checked_val === if_val ) || 643 ( operator === 'not equals' && checked_val !== if_val ) || 644 ( operator === 'equals (regex)' && regex_patt.test(checked_val) ) || 645 ( operator === 'not equals (regex)' && !regex_patt.test(checked_val) ) || 646 ( operator === '>' && checked_val_as_number > if_val_as_number ) || 647 ( operator === '<' && checked_val_as_number < if_val_as_number ) || 648 ( operator === 'â¥' && checked_val_as_number >= if_val_as_number ) || 649 ( operator === 'â¤' && checked_val_as_number <= if_val_as_number ) 650 ) { 651 condition_ok = true; 652 } 653 } 654 } 655 656 show_group = show_group && condition_ok; 657 } 658 659 return show_group; 660 661 } 662 663}; 664 665 666jQuery('.wpcf7-form').each(function(){ 667 wpcf7cf_forms.push(new Wpcf7cfForm(jQuery(this))); 668}); 669 670// Call displayFields again on all forms 671// Necessary in case some theme or plugin changed a form value by the time the entire page is fully loaded. 672jQuery('document').ready(function() {
673 wpcf7cf_forms.forEach(function(f){ 674 f.displayFields(); 675 }); 676}); 677 678// fix for exclusive checkboxes in IE (this will call the change-event again after all other checkboxes are unchecked, triggering the display_fields() function) 679var old_wpcf7ExclusiveCheckbox = jQuery.fn.wpcf7ExclusiveCheckbox; 680jQuery.fn.wpcf7ExclusiveCheckbox = function() { 681 return this.find('input:checkbox').click(function() { 682 var name = jQuery(this).attr('name'); 683 jQuery(this).closest('form').find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false).eq(0).change(); 684 }); 685}; 686
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.