( function( $ ) {
'use strict';
if ( typeof wpcf7 === 'undefined' || wpcf7 === null ) {
return;
}
wpcf7 = $.extend( {
cached: 0,
inputs: []
}, wpcf7 );
$( function() {
wpcf7.supportHtml5 = ( function() {
var features = {};
var input = document.createElement( 'input' );
features.placeholder = 'placeholder' in input;
var inputTypes = [ 'email', 'url', 'tel', 'number', 'range', 'date' ];
$.each( inputTypes, function( index, value ) {
input.setAttribute( 'type', value );
features[ value ] = input.type !== 'text';
} );
return features;
} )();
$( 'div.wpcf7 > form' ).each( function() {
var $form = $( this );
$form.submit( function( event ) {
if ( typeof window.FormData !== 'function' ) {
return;
}
wpcf7.submit( $form );
event.preventDefault();
} );
$( '.wpcf7-submit', $form ).after( '' );
wpcf7.toggleSubmit( $form );
$form.on( 'click', '.wpcf7-acceptance', function() {
wpcf7.toggleSubmit( $form );
} );
// Exclusive Checkbox
$( '.wpcf7-exclusive-checkbox', $form ).on( 'click', 'input:checkbox', function() {
var name = $( this ).attr( 'name' );
$form.find( 'input:checkbox[name="' + name + '"]' ).not( this ).prop( 'checked', false );
} );
// Free Text Option for Checkboxes and Radio Buttons
$( '.wpcf7-list-item.has-free-text', $form ).each( function() {
var $freetext = $( ':input.wpcf7-free-text', this );
var $wrap = $( this ).closest( '.wpcf7-form-control' );
if ( $( ':checkbox, :radio', this ).is( ':checked' ) ) {
$freetext.prop( 'disabled', false );
} else {
$freetext.prop( 'disabled', true );
}
$wrap.on( 'change', ':checkbox, :radio', function() {
var $cb = $( '.has-free-text', $wrap ).find( ':checkbox, :radio' );
if ( $cb.is( ':checked' ) ) {
$freetext.prop( 'disabled', false ).focus();
} else {
$freetext.prop( 'disabled', true );
}
} );
} );
// Placeholder Fallback
if ( ! wpcf7.supportHtml5.placeholder ) {
$( '[placeholder]', $form ).each( function() {
$( this ).val( $( this ).attr( 'placeholder' ) );
$( this ).addClass( 'placeheld' );
$( this ).focus( function() {
if ( $( this ).hasClass( 'placeheld' ) ) {
$( this ).val( '' ).removeClass( 'placeheld' );
}
} );
$( this ).blur( function() {
if ( '' === $( this ).val() ) {
$( this ).val( $( this ).attr( 'placeholder' ) );
$( this ).addClass( 'placeheld' );
}
} );
} );
}
if ( wpcf7.jqueryUi && ! wpcf7.supportHtml5.date ) {
$form.find( 'input.wpcf7-date[type="date"]' ).each( function() {
$( this ).datepicker( {
dateFormat: 'yy-mm-dd',
minDate: new Date( $( this ).attr( 'min' ) ),
maxDate: new Date( $( this ).attr( 'max' ) )
} );
} );
}
if ( wpcf7.jqueryUi && ! wpcf7.supportHtml5.number ) {
$form.find( 'input.wpcf7-number[type="number"]' ).each( function() {
$( this ).spinner( {
min: $( this ).attr( 'min' ),
max: $( this ).attr( 'max' ),
step: $( this ).attr( 'step' )
} );
} );
}
// Character Count
$( '.wpcf7-character-count', $form ).each( function() {
var $count = $( this );
var name = $count.attr( 'data-target-name' );
var down = $count.hasClass( 'down' );
var starting = parseInt( $count.attr( 'data-starting-value' ), 10 );
var maximum = parseInt( $count.attr( 'data-maximum-value' ), 10 );
var minimum = parseInt( $count.attr( 'data-minimum-value' ), 10 );
var updateCount = function( target ) {
var $target = $( target );
var length = $target.val().length;
var count = down ? starting - length : length;
$count.attr( 'data-current-value', count );
$count.text( count );
if ( maximum && maximum ' );
$.each( data.invalidFields, function( i, n ) {
if ( n.idref ) {
var $li = $( '
' ).append( $( '' ).attr( 'href', '#' + n.idref ).append( n.message ) );
} else {
var $li = $( '' ).append( n.message );
}
$invalids.append( $li );
} );
$response.append( $invalids );
}
$response.attr( 'role', 'alert' ).focus();
} );
};
$.ajax( {
type: 'POST',
url: wpcf7.apiSettings.root + wpcf7.apiSettings.namespace +
'/contact-forms/' + wpcf7.getId( $form ) + '/feedback',
data: formData,
dataType: 'json',
processData: false,
contentType: false
} ).done( function( data, status, xhr ) {
ajaxSuccess( data, status, xhr, $form );
$( '.ajax-loader', $form ).removeClass( 'is-active' );
} ).fail( function( xhr, status, error ) {
var $e = $( '' ).text( error.message );
$form.after( $e );
} );
};
wpcf7.triggerEvent = function( target, name, detail ) {
var $target = $( target );
/* DOM event */
var event = new CustomEvent( 'wpcf7' + name, {
bubbles: true,
detail: detail
} );
$target.get( 0 ).dispatchEvent( event );
/* jQuery event */
$target.trigger( 'wpcf7:' + name, detail );
$target.trigger( name + '.wpcf7', detail ); // deprecated
};
wpcf7.toggleSubmit = function( form, state ) {
var $form = $( form );
var $submit = $( 'input:submit', $form );
if ( typeof state !== 'undefined' ) {
$submit.prop( 'disabled', ! state );
return;
}
if ( $form.hasClass( 'wpcf7-acceptance-as-validation' ) ) {
return;
}
$submit.prop( 'disabled', false );
$( 'input:checkbox.wpcf7-acceptance', $form ).each( function() {
var $a = $( this );
if ( $a.hasClass( 'wpcf7-invert' ) && $a.is( ':checked' )
|| ! $a.hasClass( 'wpcf7-invert' ) && ! $a.is( ':checked' ) ) {
$submit.prop( 'disabled', true );
return false;
}
} );
};
wpcf7.notValidTip = function( target, message ) {
var $target = $( target );
$( '.wpcf7-not-valid-tip', $target ).remove();
$( '' )
.text( message ).appendTo( $target );
if ( $target.is( '.use-floating-validation-tip *' ) ) {
var fadeOut = function( target ) {
$( target ).not( ':hidden' ).animate( {
opacity: 0
}, 'fast', function() {
$( this ).css( { 'z-index': -100 } );
} );
}
$target.on( 'mouseover', '.wpcf7-not-valid-tip', function() {
fadeOut( this );
} );
$target.on( 'focus', ':input', function() {
fadeOut( $( '.wpcf7-not-valid-tip', $target ) );
} );
}
}
wpcf7.refill = function( form, data ) {
var $form = $( form );
var refillCaptcha = function( $form, items ) {
$.each( items, function( i, n ) {
$form.find( ':input[name="' + i + '"]' ).val( '' );
$form.find( 'img.wpcf7-captcha-' + i ).attr( 'src', n );
var match = /([0-9]+)\.(png|gif|jpeg)$/.exec( n );
$form.find( 'input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]' ).attr( 'value', match[ 1 ] );
} );
};
var refillQuiz = function( $form, items ) {
$.each( items, function( i, n ) {
$form.find( ':input[name="' + i + '"]' ).val( '' );
$form.find( ':input[name="' + i + '"]' ).siblings( 'span.wpcf7-quiz-label' ).text( n[ 0 ] );
$form.find( 'input:hidden[name="_wpcf7_quiz_answer_' + i + '"]' ).attr( 'value', n[ 1 ] );
} );
};
if ( typeof data === 'undefined' ) {
$.ajax( {
type: 'GET',
url: wpcf7.apiSettings.root + wpcf7.apiSettings.namespace +
'/contact-forms/' + wpcf7.getId( $form ) + '/refill',
dataType: 'json'
} ).done( function( data, status, xhr ) {
if ( data.captcha ) {
refillCaptcha( $form, data.captcha );
}
if ( data.quiz ) {
refillQuiz( $form, data.quiz );
}
} );
} else {
if ( data.captcha ) {
refillCaptcha( $form, data.captcha );
}
if ( data.quiz ) {
refillQuiz( $form, data.quiz );
}
}
};
wpcf7.clearResponse = function( form ) {
var $form = $( form );
$form.removeClass( 'invalid spam sent failed' );
$form.siblings( '.screen-reader-response' ).html( '' ).attr( 'role', '' );
$( '.wpcf7-not-valid-tip', $form ).remove();
$( '[aria-invalid]', $form ).attr( 'aria-invalid', 'false' );
$( '.wpcf7-form-control', $form ).removeClass( 'wpcf7-not-valid' );
$( '.wpcf7-response-output', $form )
.hide().empty().removeAttr( 'role' )
.removeClass( 'wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked' );
};
} )( jQuery );
/*
* Polyfill for Internet Explorer
* See https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
*/
( function () {
if ( typeof window.CustomEvent === "function" ) return false;
function CustomEvent ( event, params ) {
params = params || { bubbles: false, cancelable: false, detail: undefined };
var evt = document.createEvent( 'CustomEvent' );
evt.initCustomEvent( event,
params.bubbles, params.cancelable, params.detail );
return evt;
}
CustomEvent.prototype = window.Event.prototype;
window.CustomEvent = CustomEvent;
} )();
Скачать Hyperburner v1.13 на андроид
–°–Ї–?—З–?—В—М Contacts Widget –Ь–Њ–і APK 7.0.4 (Remove ads
Spark - скачать приложение Spark на Андроид бесплатно
Скачать Cherry-Live Video Chat Мод APK (ограниченные деньги) для Android.
AOSP compatible) –і–ї—П Android.