Updated Facebook set

This commit is contained in:
spen 2014-03-13 15:20:44 +08:00
parent cfda9365ab
commit 5bab384195
3 changed files with 1 additions and 19 deletions

View File

@ -55,7 +55,6 @@ class Panel::Announcement::FrontEnd::BulletinsController < OrbitWidgetController
def show
@item = Page.find(params[:page_id]) rescue nil
@fb_share = eval(params[:facebook_share]) rescue false
if params[:preview] == "true"
preview_content
else

View File

@ -38,20 +38,4 @@
<% end %>
</div>
<%#= share_links(@bulletin, 'announcement') %>
<% if @fb_share %>
<a href="" target="_blank" class="fb-share-button">
<%= image_tag("announcement/fbn.png",:width=>30, :height=>30) %>
</a>
<script type="text/javascript">
(function(){
$(".fb-share-button").click(function(){
var img = window.location.protocol + "//" + window.location.host + "<%= @bulletin.image.url rescue '' %>",
url = "https://www.facebook.com/sharer/sharer.php?s=100&p[title]=<%= @bulletin.title %>&p[images][0]=" + img + "&p[url]="+window.location.href;
newwindow = window.open(url,'name','height=500,width=1024');
if (window.focus) {newwindow.focus()}
return false;
})
})();
</script>
<% end %>
<%= share_links(@bulletin, 'announcement') %>

View File

@ -38,7 +38,6 @@ module Announcement
enable ["typeA", "typeB_style3", "typeC"]
image :image
field :postdate
facebook_enabled false
link_field :title,{:method => 'panel_announcement_front_end_bulletin_path',:args=>:self}
link_field :bulletin_category_with_title,{:method => 'panel_announcement_front_end_bulletins_path',:args=>{:category_id => [:category,:id]}}
field :subtitle