dimsemenov / PhotoSwipe

JavaScript image gallery for mobile and desktop, modular, framework independent
http://photoswipe.com
MIT License
24.18k stars 3.31k forks source link

Integrate Google +, Tumblr, email share buttons #1121

Open Slipkipu opened 8 years ago

Slipkipu commented 8 years ago

Hi all!

I want to integrate Google +, Tumblr and email sharing button , but I do not really understand the Photoswipe documentation here: http://photoswipe.com/documentation/getting-started.html I tried to change the code sharing buttons in the "photoswipe-ui-default.js", but nothing happens, on how process. Is there someone who has already made ​​these changes? And above all , what code do I fit in? It seems different to each button. Thank you in advance.

Slipkipu commented 8 years ago

Ok, the solution.

shareButtons: [ {id:'facebook', label:'Share on Facebook', url:'https://www.facebook.com/sharer/sharer.php?u={{url}}'}, {id:'twitter', label:'Tweet', url:'https://twitter.com/intent/tweet?text={{text}}&url={{url}}'}, {id:'gplus', label:'Share on Google+', url:'https://plus.google.com/share?url={{url}}'}, {id:'tumblr', label:'Share on Tumblr', url:'http://tumblr.com/widgets/share/tool?canonicalUrl={{url}}'}, {id:'email', label:'E-mail', url:'mailto:?subject=I wanted you to see this image&body=Check out this image : {{text}} - {{url}}'}, {id:'pinterest', label:'Pin it', url:'http://www.pinterest.com/pin/create/button/'+ '?url={{url}}&media={{image_url}}&description={{text}}'}, {id:'download', label:'Download image', url:'{{raw_image_url}}', download:true} ],

Jon007 commented 7 years ago

apart from Pinterest, they all share the wrong image (the page image rather than the open image). There's a fix for facebook #749 but can't find one for twitter to override the image used in a twitter image card.

Jon007 commented 7 years ago

Facebook has also stopped working: "Graph API v2.3 will be deprecated on July 10, 2017." and: https://github.com/dimsemenov/PhotoSwipe/issues/749