title added with share url

This commit is contained in:
Harry Bomrah 2014-02-21 18:21:07 +08:00
parent 725bfcac5a
commit beac76f29a
1 changed files with 2 additions and 2 deletions

View File

@ -39,14 +39,14 @@
</div> </div>
<%= share_links(@bulletin, 'announcement') %> <%= share_links(@bulletin, 'announcement') %>
<a href="<%= request.url %>&t=<%= @bulletin.title %>" target="_blank" class="fb-share-button"> <a href="" target="_blank" class="fb-share-button">
<%= image_tag("announcement/fbn.png",:width=>30, :height=>30) %> <%= image_tag("announcement/fbn.png",:width=>30, :height=>30) %>
</a> </a>
<script type="text/javascript"> <script type="text/javascript">
(function(){ (function(){
$(".fb-share-button").click(function(){ $(".fb-share-button").click(function(){
var url = "https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent($(this).attr("href")); var url = "https://www.facebook.com/sharer/sharer.php?u=" + encodeURIComponent("<%= request.url %>") + "t=" +encodeURIComponent("<%= @bulletin.title %>");
newwindow = window.open(url,'name','height=500,width=1024'); newwindow = window.open(url,'name','height=500,width=1024');
if (window.focus) {newwindow.focus()} if (window.focus) {newwindow.focus()}
return false; return false;