Skip to content

Instantly share code, notes, and snippets.

@xecutioner
Created March 9, 2016 09:10
Show Gist options
  • Save xecutioner/2609de1f1ad3c4a6111d to your computer and use it in GitHub Desktop.
Save xecutioner/2609de1f1ad3c4a6111d to your computer and use it in GitHub Desktop.
share buttons views
<div class="share_buttons <%='pull-right' if defined?(pull_left) && pull_left!=true%>">
<span class='st_facebook_large' st_url=<%=request.original_url%> displayText='Facebook'></span>
<span class='st_googleplus_large' st_url=<%=request.original_url%> displayText='Google +'></span>
<span class='st_twitter_large' st_url=<%=request.original_url%> displayText='Tweet'></span>
<span class='st_linkedin_large'st_url=<%=request.original_url%> displayText='LinkedIn'></span>
<span class='st_email_large' st_url=<%=request.original_url%> displayText='Email'></span>
<span class='st_reddit_large' st_url=<%=request.original_url%> displayText='Reddit'></span>
<!-- <span class='st_plusone_large' displayText='Google +1'></span> -->
<%if !defined?(pull_left) %>
<span class="share_text">If you like this article, Then perhaps share?</span>
<%end%>
<hr>
</div>
$ ->
ShareThisTurbolinks.reload()
# if you're using jquery.turbolinks, you don't need this binding
$(document).on 'page:load', ->
ShareThisTurbolinks.reload()
$(document).on 'page:restore', ->
ShareThisTurbolinks.restore()
ShareThisTurbolinks =
load: ->
window.switchTo5x = false
$.getScript 'https://ws.sharethis.com/button/buttons.js', ->
window.stLight.options
publisher: '4190751e-2f43-4b18-8316-53985dc80cab'
shorten: false
reload: ->
stlib?.cookie.deleteAllSTCookie()
$('[src*="sharethis.com"], [href*="sharethis.com"]').remove()
window.stLight = undefined
@load()
restore: ->
$('.stwrapper, #stOverlay').remove()
@reload()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment