Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/ninja-fo.../assets/js/min
File: global.js
// TODO: Fix error collecting.
[0] Fix | Delete
//window.onerror = function(message, url, lineNumber) {
[1] Fix | Delete
// var data;
[2] Fix | Delete
//
[3] Fix | Delete
// data = {
[4] Fix | Delete
// 'action': 'nf_log_js_error',
[5] Fix | Delete
// 'security': nfFrontEnd.ajaxNonce,
[6] Fix | Delete
// 'message': message,
[7] Fix | Delete
// 'url': url,
[8] Fix | Delete
// 'lineNumber': lineNumber
[9] Fix | Delete
// };
[10] Fix | Delete
//
[11] Fix | Delete
// jQuery.ajax({
[12] Fix | Delete
// url: nfFrontEnd.adminAjax,
[13] Fix | Delete
// type: 'POST',
[14] Fix | Delete
// data: data,
[15] Fix | Delete
// cache: false,
[16] Fix | Delete
// success: function( data, textStatus, jqXHR ) {
[17] Fix | Delete
// try {
[18] Fix | Delete
//
[19] Fix | Delete
// } catch( e ) {
[20] Fix | Delete
// console.log( e );
[21] Fix | Delete
// console.log( 'Parse Error' );
[22] Fix | Delete
// console.log( e );
[23] Fix | Delete
// }
[24] Fix | Delete
//
[25] Fix | Delete
// },
[26] Fix | Delete
// error: function( jqXHR, textStatus, errorThrown ) {
[27] Fix | Delete
// // Handle errors here
[28] Fix | Delete
// console.log('ERRORS: ' + errorThrown);
[29] Fix | Delete
// console.log( jqXHR );
[30] Fix | Delete
//
[31] Fix | Delete
// try {
[32] Fix | Delete
//
[33] Fix | Delete
// } catch( e ) {
[34] Fix | Delete
// console.log( 'Parse Error' );
[35] Fix | Delete
// }
[36] Fix | Delete
// }
[37] Fix | Delete
// });
[38] Fix | Delete
// return false;
[39] Fix | Delete
//};
[40] Fix | Delete
[41] Fix | Delete
var nfRadio = Backbone.Radio;
[42] Fix | Delete
[43] Fix | Delete
nfRadio.channel( 'form' ).on( 'render:view', function() {
[44] Fix | Delete
jQuery( '.g-recaptcha' ).each( function() {
[45] Fix | Delete
var callback = jQuery( this ).data( 'callback' );
[46] Fix | Delete
var fieldID = jQuery( this ).data( 'fieldid' );
[47] Fix | Delete
if ( typeof window[ callback ] !== 'function' ){
[48] Fix | Delete
window[ callback ] = function( response ) {
[49] Fix | Delete
nfRadio.channel( 'recaptcha' ).request( 'update:response', response, fieldID );
[50] Fix | Delete
};
[51] Fix | Delete
}
[52] Fix | Delete
} );
[53] Fix | Delete
} );
[54] Fix | Delete
[55] Fix | Delete
var nfRecaptcha = Marionette.Object.extend( {
[56] Fix | Delete
initialize: function() {
[57] Fix | Delete
/*
[58] Fix | Delete
* If we've already rendered our form view, render our recaptcha fields.
[59] Fix | Delete
*/
[60] Fix | Delete
if ( 0 != jQuery( '.g-recaptcha' ).length ) {
[61] Fix | Delete
this.renderCaptcha();
[62] Fix | Delete
}
[63] Fix | Delete
/*
[64] Fix | Delete
* We haven't rendered our form view, so hook into the view render radio message, and then render.
[65] Fix | Delete
*/
[66] Fix | Delete
this.listenTo( nfRadio.channel( 'form' ), 'render:view', this.renderCaptcha );
[67] Fix | Delete
this.listenTo( nfRadio.channel( 'captcha' ), 'reset', this.renderCaptcha );
[68] Fix | Delete
},
[69] Fix | Delete
[70] Fix | Delete
renderCaptcha: function() {
[71] Fix | Delete
jQuery( '.g-recaptcha' ).each( function() {
[72] Fix | Delete
var opts = {
[73] Fix | Delete
fieldid: jQuery( this ).data( 'fieldid' ),
[74] Fix | Delete
size: jQuery( this ).data( 'size' ),
[75] Fix | Delete
theme: jQuery( this ).data( 'theme' ),
[76] Fix | Delete
sitekey: jQuery( this ).data( 'sitekey' ),
[77] Fix | Delete
callback: jQuery( this ).data( 'callback' )
[78] Fix | Delete
};
[79] Fix | Delete
[80] Fix | Delete
var grecaptchaID = grecaptcha.render( jQuery( this )[0], opts );
[81] Fix | Delete
[82] Fix | Delete
if ( opts.size === 'invisible' ) {
[83] Fix | Delete
try {
[84] Fix | Delete
grecaptcha.execute( grecaptchaID );
[85] Fix | Delete
} catch( e ){
[86] Fix | Delete
console.log( 'Notice: Error trying to execute grecaptcha.' );
[87] Fix | Delete
}
[88] Fix | Delete
}
[89] Fix | Delete
} );
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
} );
[93] Fix | Delete
[94] Fix | Delete
var nfRenderRecaptcha = function() {
[95] Fix | Delete
new nfRecaptcha();
[96] Fix | Delete
}
[97] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function