Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi/core/admin/js
File: recaptcha.js
/**
[0] Fix | Delete
* NOTE: A minified copy of this script will be generated by grunt. Only the minified file will be included in zipped releases.
[1] Fix | Delete
*
[2] Fix | Delete
* @file Handles reCAPTCHA on the frontend.
[3] Fix | Delete
* @since 4.0.7
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
[7] Fix | Delete
(function($) {
[8] Fix | Delete
window.etCore = window.etCore || {};
[9] Fix | Delete
window.etCore.api = window.etCore.api || {};
[10] Fix | Delete
window.etCore.api.spam = window.etCore.api.spam || {};
[11] Fix | Delete
[12] Fix | Delete
/**
[13] Fix | Delete
* Recaptcha
[14] Fix | Delete
*
[15] Fix | Delete
* @since??
[16] Fix | Delete
*
[17] Fix | Delete
* @memberof window.etCore.api.spam
[18] Fix | Delete
*/
[19] Fix | Delete
window.etCore.api.spam.recaptcha = $.extend( et_core_api_spam_recaptcha, {
[20] Fix | Delete
[21] Fix | Delete
_bindMethods: function(target) {
[22] Fix | Delete
Object.keys(target).forEach(function(prop) {
[23] Fix | Delete
if (target.hasOwnProperty(prop) && 'function' === typeof target[prop]) {
[24] Fix | Delete
target[prop] = target[prop].bind(target);
[25] Fix | Delete
}
[26] Fix | Delete
});
[27] Fix | Delete
},
[28] Fix | Delete
[29] Fix | Delete
init: function() {
[30] Fix | Delete
this._bindMethods(this);
[31] Fix | Delete
[32] Fix | Delete
if (this.isEnabled()) {
[33] Fix | Delete
// Execute the default page-level action
[34] Fix | Delete
window.grecaptcha && grecaptcha.execute(this.site_key, this.page_action);
[35] Fix | Delete
}
[36] Fix | Delete
},
[37] Fix | Delete
[38] Fix | Delete
isEnabled: function() {
[39] Fix | Delete
return !! (this.site_key && window.grecaptcha);
[40] Fix | Delete
},
[41] Fix | Delete
[42] Fix | Delete
/**
[43] Fix | Delete
* Score an interaction to determine whether or not it's a bot.
[44] Fix | Delete
*
[45] Fix | Delete
* @since 4.0.7
[46] Fix | Delete
*
[47] Fix | Delete
* @param {string} action The name of the action being performed.
[48] Fix | Delete
*
[49] Fix | Delete
* @return {Promise<string>} Interaction token to be verified on server.
[50] Fix | Delete
*/
[51] Fix | Delete
interaction: function(action) {
[52] Fix | Delete
if (! this.isEnabled()) {
[53] Fix | Delete
return Promise.resolve('');
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
return grecaptcha.execute(this.site_key, { action: action });
[57] Fix | Delete
}
[58] Fix | Delete
} );
[59] Fix | Delete
[60] Fix | Delete
window.grecaptcha && grecaptcha.ready(function() {
[61] Fix | Delete
window.etCore.api.spam.recaptcha.init();
[62] Fix | Delete
});
[63] Fix | Delete
[64] Fix | Delete
})(jQuery);
[65] Fix | Delete
[66] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function