Question

There is a social login wordpress plugin that produces a large popup window when authenticating a login from a social networking site (facebook, google, etc.)

I would like to make the popup window much smaller, but can't figure it out. The code the produces the popup window is:

if( get_option( 'wsl_settings_use_popup' ) == 1 || ! get_option( 'wsl_settings_use_popup' ) ){
    ?>
        <html><head><script>
        function init() {
            window.opener.wsl_wordpress_social_login({
                'action'   : 'wordpress_social_login',
                'provider' : '<?php echo $provider ?>'
            });

            window.close()
        }

How do I set the width and height for this popup?

Thanks in advance!

Was it helpful?

Solution

UPDATE FOR CENTERED WINDOW

Add this 2 calculation just under provider = $(this).attr("data-provider");:

datop = (($(document).height()-400)/2);
daleft = (($(document).width()-225)/2);

Add this 2 parameters to the attributes:

top="+datop+",left="+daleft+""

like this:

"location=1,status=0,scrollbars=0,width=225,height=400,top="+datop+",left="+daleft+""

END

Edit

You can find the file here: wp-content/plugins/wordpress-social-login/assets/js/connect.js

End edit
The file is "wordpress-social-login\assets\js\connect.js" I don't know where this file will be installed, but probably you can find the function inside it in every page which contain the login (if you can locate it, you can unistall, edit the file and the reinstall with the file modified). This should be the function you are searching for:

(function($){ 
    $(function(){
        $(".wsl_connect_with_provider").click(function(){//selector.event
            popupurl = $("#wsl_popup_base_url").val();//assign text of the element with id #wls_popup_base..
            provider = $(this).attr("data-provider");//assign the attribute data-provider of the element with class .wls_connect.. 

            window.open(
                popupurl+"provider="+provider,//url
                "hybridauth_social_sing_on", //window name
                "location=1,status=0,scrollbars=0,width=1000,height=600"//attributes of the window
            ); 
        });
    });
})(jQuery);

This should be the code of the popup

window.open(
    popupurl+"provider="+provider,
    "hybridauth_social_sing_on",
    "location=1,status=0,scrollbars=0,width=1000,height=600"
);

To change width and height,edit this 2 params: ..width=1000,height=600"

Note that i add the comments to let you understand what the function do and what are you doing

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top