tmort / Socialite

Other
1.68k stars 163 forks source link

Adding an Extension #71

Open since1976 opened 10 years ago

since1976 commented 10 years ago

Hi there straight up aplogies for the noob question, but how do you go about adding an extension?

I'd like to add a pinterest button—to the default set of networks—with a count sitting above it but for the life of me can't figure out how I get it to work.

Is there some documentation on how to go about this? Currently I'm using Socialite.load('.social-buttons'); to initiate the default buttons but how would I add Pinterest to that?

Thanks in advance for any help offered Dan

NicolasGraph commented 10 years ago

I was looking how to extend socialite with the pinterest extension and this is what I'm now using.

<script src="<txp:site_url />js/socialite.min.js"></script>
<script src="<txp:site_url />js/extensions/socialite.pinterest.js"></script>
<script>
$(document).ready(function() {
      Socialite.load();
   });
</script>
<a data-pin-log="button_pinit_bookmarklet" class="socialite pinterest-pinit" href="http://www.pinterest.com/pin/create/button/" rel="nofollow" target="_blank"><span class="vhidden">Share on Pinterest</span></a>

Unfortunatly, something goes wrong because the button appears but the Pinterest javascript is not loading properly (no popup, no count)…

See: http://developers.pinterest.com/pin_it/ > "The Pin It button should pop up the Create a Pin form in a small window. If it doesn't pop up, you'll see fewer Pins. That's because people expect Pinterest to look and act a certain way. If your JavaScript is broken or missing, your Pin It button will still work, but it won't be as useful or pretty! You won't get Pin counts and the Create a Pin form will appear full screen, which means people will have to press the Back button to keep browsing on your page."

derpyherp commented 9 years ago

I also have a problem with Pinterest - but their button doesn't display at all for me. The Pinterest script does load, I checked.