Skip to content
This repository has been archived by the owner on Dec 5, 2018. It is now read-only.

Replace Twitter button with ShareThis including Twitter, Facebook, Pinterest, and Email #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions app/views/captioned_images/_captioned_image.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@
</div>
<br>
<p>
<%= link_to 'Adoption Info', captioned_image.adoption_info_url, class: 'btn btn-info' %>
<%= link_to 'Adoption Info', captioned_image.adoption_info_url, class: 'btn btn-large btn-warning' %>
<br />
<%# TODO: extract into presenter %>
<%= link_to 'Tweet', 'https://twitter.com/share', class: "twitter-share-button", data: { lang: 'en', size: 'large', dnt: 'true', text: captioned_image.title, hashtags: 'adoptaLOL', url: captioned_image_url(captioned_image) } %>
<div class='social-share'>
<span class='st_facebook_vcount' displayText='Facebook' st_title='<%= captioned_image.title %>' st_url='<%= captioned_image_url(captioned_image) %>'></span>
<span class='st_twitter_vcount' displayText='Tweet' st_title='<%= captioned_image.title %>' st_url='<%= captioned_image_url(captioned_image) %>' st_msg="#adoptaLOL"></span>
<span class='st_pinterest_vcount' displayText='Pinterest' st_title='<%= captioned_image.title %>' st_url='<%= captioned_image_url(captioned_image) %>'></span>
<span class='st_email_vcount' displayText='Email' st_title='<%= captioned_image.title %>' st_url='<%= captioned_image_url(captioned_image) %>'></span>
</div>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! It looks great...

I haven't had a chance to test it locally yet, but do we still include the hashtag, text, and link in a similar way? Or does it just use the current location?

</p>
</article>
4 changes: 3 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<%= javascript_include_tag "application" %>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "ur-25a3bfcd-439e-6cbf-8e29-2af66b7d7d7f", doNotHash: false, doNotCopy: false, hashAddressBar: false, shorten: true});</script>

</body>
</html>