first version of fb_share

This commit is contained in:
Matthew K. Fu JuYuan 2012-08-06 16:12:49 +08:00 committed by Christophe Vilayphiou
parent 2ed0f709c8
commit 85a556a4a2
9 changed files with 42 additions and 3 deletions

View File

@ -40,6 +40,8 @@ gem 'progress_bar'
gem 'sinatra'
gem 'sprockets'
gem 'social-share-button'
gem 'tinymce-rails'
gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux")
gem 'rb-readline' if RUBY_PLATFORM.downcase.include?("linux")

View File

@ -250,6 +250,7 @@ GEM
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
social-share-button (0.0.6)
spork (0.9.0)
spork (0.9.0-x86-mingw32)
win32-process
@ -343,6 +344,7 @@ DEPENDENCIES
shoulda-matchers
simplecov
sinatra
social-share-button
spork
sprockets
sunspot-rails-tester

View File

@ -6,4 +6,5 @@
//
//= require jquery
//= require jquery_ujs
//= require_tree .
//= require_tree .
//= social-share-button

View File

@ -3,5 +3,5 @@
*and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
*the top of the compiled file, but it's generally better to create a new file per style scope.
*= require_self
*= require social-share-button
*/

View File

@ -140,6 +140,7 @@ module ApplicationHelper
stylesheets << "<link href='/assets/bootstrap-orbit.css' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='/assets/style.css' rel='stylesheet' type='text/css' />\n"
end
stylesheets << "<link href='/assets/social-share-button.scss' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='#{page.design.reset_css.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.reset_css
stylesheets << "<link href='#{asset_path 'banner_nav.css'}' rel='stylesheet' type='text/css' />\n"
stylesheets << "<link href='#{page.design.default_css.file.url}' rel='stylesheet' type='text/css' />\n" if page.design.default_css
@ -161,6 +162,7 @@ module ApplicationHelper
end
javascripts << "<script type='text/javascript' src='/static/jquery.cycle.all.latest.js'></script>\n"
javascripts << "<script type='text/javascript' src='/static/kernel.js'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/social-share-button.coffee'></script>\n"
javascripts << "<script type='text/javascript' src='/assets/event.js'></script>\n"
page.design.javascripts.each do |js|
# javascripts << "<script type='text/javascript' src='#{js.file.url}'></script>"

View File

@ -0,0 +1,3 @@
SocialShareButton.configure do |config|
config.allow_sites = %w(twitter facebook google_plus)
end

View File

@ -0,0 +1,14 @@
en:
social_share_button:
share_to: Share to %{name}
weibo: Sina Weibo
twitter: Twitter
facebook: Facebook
douban: Douban
qq: Qzone
tqq: Tqq
delicious: Delicious
baidu: Baidu.com
kaixin001: Kaixin001.com
renren: Renren.com
google_plus: Google+

View File

@ -0,0 +1,14 @@
zh_tw:
social_share_button:
share_to: 分享到%{name}
weibo: 新浪微博
twitter: Twitter
facebook: Facebook
douban: 豆瓣
qq: QQ空間
tqq: 腾讯微博
delicious: Delicious
baidu: 百度收藏
kaixin001: 開心網
renren: 人人網
google_plus: Google+

View File

@ -40,5 +40,6 @@
</div>
<div class="fb">
<%= render "shared/addthis_toolbox"%>
<%= social_share_button_tag(@news_bulletin.title) %>
<%#= render "shared/addthis_toolbox"%>
</div>