Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Social Popups Code #30

Closed
kylehotchkiss opened this issue Dec 2, 2016 · 4 comments
Closed

Social Popups Code #30

kylehotchkiss opened this issue Dec 2, 2016 · 4 comments

Comments

@kylehotchkiss
Copy link
Member

kylehotchkiss commented Dec 2, 2016

var social = function() {
    jQuery("a[href*='twitter.com/intent']").unbind();

    var socialpopup = function( url, title, width, height ) {
        var top = ( screen.height / 2 ) - ( height / 2 );
        var left = ( screen.width / 2 ) - ( width / 2 );

        window.open( url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left );
    };

    jQuery("a[href*='facebook.com/sharer']").click(function( event ) {
        event.preventDefault();
        var url = jQuery(this).attr("href");
        socialpopup( url, "Share on Facebook", 550, 520 );
    });

    jQuery("a[href*='twitter.com/intent']").click(function( event ) {
        event.preventDefault();
        var url = jQuery(this).attr("href");
        socialpopup( url, "Share on Twitter", 550, 520 );
    });
};

I think this provides good UX because it opens Facebook and Twitter shares in the same sized popup. I've added this to a bunch of sites and haven't seen any errors with it. Works as expected on mobile. What do you guys think of dropping it into bubs?

@ccorda
Copy link
Contributor

ccorda commented Dec 2, 2016

How does it play with quickshare which we have?

There is also the open social analytics ticket: #15

@kylehotchkiss
Copy link
Member Author

kylehotchkiss commented Dec 5, 2016 via email

@ccorda
Copy link
Contributor

ccorda commented Dec 7, 2016

https://github.com/Upstatement/quickshare

Sample from their docs:

<div class="qs-container" data-qs-url="http://specific-url.com">
    <a class="qs-link" data-qs-service="twitter">Twitter</a>
    <a class="qs-link" data-qs-service="facebook-share">Facebook</a>
</div>

@ccorda
Copy link
Contributor

ccorda commented Feb 25, 2017

I think quickshare takes care of this sufficiently, closing out.

@ccorda ccorda closed this as completed Feb 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants