KatanaCode/blogit

View on GitHub
app/views/blogit/posts/_share_bar.html.erb

Summary

Maintainability
Test Coverage
<div id="blogit_share_bar">

  <div class="blogit_share_bar__social_button blogit_share_bar__social_button--google_plus">
    <!-- GOOGLE +1 -->
    <g:plusone size="medium"></g:plusone>
    <script type="text/javascript">
      window.___gcfg = {lang: '<%= I18n.default_locale %>'};

      (function() {
        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/plusone.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
      })();
    </script>
    <!-- /GOOGLE +1 -->
  </div>

  <div class="blogit_share_bar__social_button blogit_share_bar__social_button--twitter">    <!-- TWITTER -->
    <a href="https://twitter.com/share" class="twitter-share-button"
        data-lang="<%= I18n.default_locale %>"
        data-url="http://<%= request.host_with_port %><%= request.path.gsub("//","/") %>"
        data-via="<%= Blogit.configuration.twitter_username %>"
        data-text="<%= post.title%>"
        data-count="horizontal">Tweet</a>

    <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="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
    <!-- /TWITTER -->
  </div>

  <div class="blogit_share_bar__social_button blogit_share_bar__social_button--facebook"> 
    <!-- FACEBOOK LIKE -->
    <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/<%= t "blogit.share_bar.facebook" %>/all.js#xfbml=1";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
    <div class="fb-like" data-send="false"  data-layout="button_count" data-width="90" data-show-faces="false"></div>
    <!-- /FACEBOOK LIKE -->
  </div>

</div>