Skip to content

Commit

Permalink
Adding script for twitter share button
Browse files Browse the repository at this point in the history
  • Loading branch information
ialbuqu committed Oct 24, 2013
1 parent 4c0875d commit 9797ad2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions views/layout.erb
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,16 @@
<script type="text/javascript">
window.i18n = <%= locale_labels %>
</script>

<script type="text/javascript">
$(document).ready(function(){
$('a.tweet').click(function(e){
e.preventDefault();
var loc = $(this).attr('href');
var title = escape($(this).attr('title'));
window.open('http://twitter.com/share?url=' + loc + '&text=' + title + '&', 'twitterwindow', 'height=450, width=550, top='+($(window).height()/2 - 225) +', left='+$(window).width()/2 +', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
});
});
</script>
</body>
</html>

0 comments on commit 9797ad2

Please sign in to comment.