Jump to content

How to change location of Recaptcha badge (invisible) from left bottom to right bottom?


sonuyos

Recommended Posts

4 hours ago, sonuyos said:

Cannot find anyway even in the codes to change it from right bottom to left, any help?

one option is a quick fix with css...

.grecaptcha-badge { 
    left: 0px;
}

cwxRE2i.png

and technically, you could hide it with the css code below (it still validates), but that would almost certainly be against Googles T&Cs...

.grecaptcha-badge { 
    visibility: hidden;
}

the real solution is probably going to involve using the "data-badge" feature - which by default is bottomright, but you can define it to be bottomleft - I can do it by editing scripts.js and changing....

                // propagate invisible recaptcha if necessary
                if (isInvisible) {
                    if (recaptchaContent.data('size') !== 'invisible') {
                        recaptchaContent.attr('data-size', 'invisible');
                    }
                } else {
                    recaptchaContent.hide()
                }

to...

                // propagate invisible recaptcha if necessary
                if (isInvisible) {
                    if (recaptchaContent.data('size') !== 'invisible') {
                        recaptchaContent.attr('data-size', 'invisible');
                        recaptchaContent.attr('data-badge', 'bottomleft');
                    }
                } else {
                    recaptchaContent.hide()
                }

... minifying it and saving as scripts.min.js

osYXZxV.png

now someone, perhaps one of WHMCS' own devs, who is better than me at JavaScript, should be able to make that into a hook.... long-term, there's nothing to stop WHMCS putting a left/right location dropdown toggle in the security tab, but that's heading down the road of a feature request, so it won't be happening any time soon. 🙄

in fact, they should have already made it multilingual - as I showed how in the thread below....

though everything seems to be defined in the .js files now, so I doubt quick template edits wouldn't work on the latest versions.

Link to comment
Share on other sites

On 2/16/2019 at 10:18 PM, brian! said:

one option is a quick fix with css...


.grecaptcha-badge { 
    left: 0px;
}

cwxRE2i.png

and technically, you could hide it with the css code below (it still validates), but that would almost certainly be against Googles T&Cs...


.grecaptcha-badge { 
    visibility: hidden;
}

the real solution is probably going to involve using the "data-badge" feature - which by default is bottomright, but you can define it to be bottomleft - I can do it by editing scripts.js and changing....


                // propagate invisible recaptcha if necessary
                if (isInvisible) {
                    if (recaptchaContent.data('size') !== 'invisible') {
                        recaptchaContent.attr('data-size', 'invisible');
                    }
                } else {
                    recaptchaContent.hide()
                }

to...


                // propagate invisible recaptcha if necessary
                if (isInvisible) {
                    if (recaptchaContent.data('size') !== 'invisible') {
                        recaptchaContent.attr('data-size', 'invisible');
                        recaptchaContent.attr('data-badge', 'bottomleft');
                    }
                } else {
                    recaptchaContent.hide()
                }

... minifying it and saving as scripts.min.js

osYXZxV.png

now someone, perhaps one of WHMCS' own devs, who is better than me at JavaScript, should be able to make that into a hook.... long-term, there's nothing to stop WHMCS putting a left/right location dropdown toggle in the security tab, but that's heading down the road of a feature request, so it won't be happening any time soon. 🙄

in fact, they should have already made it multilingual - as I showed how in the thread below....

though everything seems to be defined in the .js files now, so I doubt quick template edits wouldn't work on the latest versions.

For some weird reason, neither method is working for me, i tried to add it in custom.css, it didnt work, and then i tried to add it in script.js and minfy it, didnt work there too 😐

Link to comment
Share on other sites

1 hour ago, brian! said:

then all bets are off! 🙂

if it's not based on Six, it may be calling different files - so maybe the above code is in another .js file somewhere... can you search for it ?

This is the js - https://snthostings.com/billing/templates/six77/js/scripts.min.js?v=063e8b

 

idk why v=063e8b is coming, i havnt set any version on it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated