Commit 3ae088dedcd84a3e7665152d85d8a6358ef9a7c9
1 parent
7532dfd0
Exists in
master
and in
11 other branches
proposals_discussion: added twitter share button
Showing
4 changed files
with
22 additions
and
0 deletions
Show diff stats
@@ -0,0 +1,14 @@ | @@ -0,0 +1,14 @@ | ||
1 | +function initTwitterButton() { | ||
2 | + !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs'); | ||
3 | +} | ||
4 | + | ||
5 | +jQuery(document).ready(function($) { | ||
6 | + initTwitterButton(); | ||
7 | + $('.proposals').on('mouseenter', '.proposal', function() { | ||
8 | + twttr.widgets.load(); | ||
9 | + $('.proposal .social').hide(); | ||
10 | + $(this).find('.social').show("fast"); | ||
11 | + }).on('mouseleave', '.proposal', function() { | ||
12 | + $(this).find('.social').hide("fast"); | ||
13 | + }); | ||
14 | +}); |
views/content_viewer/_proposal_card.html.erb
@@ -4,6 +4,9 @@ | @@ -4,6 +4,9 @@ | ||
4 | <div class="title"> | 4 | <div class="title"> |
5 | <%= link_to proposal_card.name, proposal_card.view_url %> | 5 | <%= link_to proposal_card.name, proposal_card.view_url %> |
6 | </div> | 6 | </div> |
7 | + <div class="social"> | ||
8 | + <%= render :partial => 'content_viewer/social', :locals => {:proposal => proposal_card} %> | ||
9 | + </div> | ||
7 | <div class="abstract"> | 10 | <div class="abstract"> |
8 | <%= link_to strip_tags(proposal_card.abstract), proposal_card.view_url %> | 11 | <%= link_to strip_tags(proposal_card.abstract), proposal_card.view_url %> |
9 | </div> | 12 | </div> |
views/content_viewer/_proposals_list.html.erb
1 | <script src="/javascripts/plugins/proposals_discussion/jquery.jscroll.min.js" type="text/javascript"></script> | 1 | <script src="/javascripts/plugins/proposals_discussion/jquery.jscroll.min.js" type="text/javascript"></script> |
2 | +<%= javascript_include_tag 'plugins/proposals_discussion/main.js' %> | ||
3 | + | ||
2 | <script> | 4 | <script> |
3 | jQuery(document).ready(function($) { | 5 | jQuery(document).ready(function($) { |
4 | function proposalsScroll() { | 6 | function proposalsScroll() { |