Skip to content

Commit

Permalink
PROD-6805 - Fix jshint error
Browse files Browse the repository at this point in the history
  • Loading branch information
jitendrabanjara1991 committed Feb 20, 2024
1 parent 3152112 commit 30afd98
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"Backbone": false,
"jQuery": false,
"wp": false,
"BP_Nouveau": false
"BP_Nouveau": false,
"grecaptcha": false
}
}
14 changes: 8 additions & 6 deletions src/bp-integrations/recaptcha/assets/js/bb-recaptcha-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
},

enableVerifyButton: function ( event ) {
event.preventDefault();
// Enable/disable verify button and submit button.
var site_key = $('#bb-recaptcha-site-key').val();
var old_site_key = $('#bb-recaptcha-site-key').attr( 'data-old-value' );
Expand Down Expand Up @@ -213,7 +214,7 @@
window.bb_recaptcha_box = grecaptcha.render( 'verifying_token', {
sitekey: self.site_key,
theme: 'light',
callback: () => {
callback: function () {
self.captcha_response = grecaptcha.getResponse( window.bb_recaptcha_box );
},
} );
Expand All @@ -222,9 +223,9 @@
window.bb_recaptcha_v2_verify_invisible = function () {
window.bb_recaptcha_invisible = grecaptcha.render( 'v2_invisible_footer', {
sitekey: self.site_key,
tabindex : 9999,
tabindex: 9999,
size: 'invisible',
callback: ( token ) => {
callback: function ( token ) {
self.captcha_response = token;
$( '#' + selector + ' .verifying_token' ).hide();
$( '#' + selector + ' .verified_token' ).show();
Expand All @@ -251,7 +252,7 @@
captcha_response: self.captcha_response,
};
if ( self.v2_option ) {
data[ 'v2_option' ] = self.v2_option;
data.v2_option = self.v2_option;
}

var selector = this.fetchSelector();
Expand Down Expand Up @@ -292,6 +293,7 @@
},

fetchSelector: function () {
var selector = '';
if (
'recaptcha_v3' === self.selected_version ||
(
Expand All @@ -300,9 +302,9 @@
'v2_invisible_badge' === self.v2_option
)
) {
selector = 'bp-hello-content-recaptcha_v3'
selector = 'bp-hello-content-recaptcha_v3';
} else {
selector = 'bp-hello-content-recaptcha_v2'
selector = 'bp-hello-content-recaptcha_v2';
}

return selector;
Expand Down
2 changes: 1 addition & 1 deletion src/bp-integrations/recaptcha/assets/js/bb-recaptcha.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
'tabindex': 9999,
'badge': bbRecaptcha.data.v2_badge_position,
'size': 'invisible',
'callback': ( token ) => {
'callback': function ( token ) {
$( '#g-recaptcha-response' ).val( token );
if ( container ) {
$( '#' + container ).submit();
Expand Down

0 comments on commit 30afd98

Please sign in to comment.