add bShare

This commit is contained in:
yafei Lee 2012-08-21 00:04:47 +08:00
parent 1b7ece79c3
commit 8f26d1d5a0
4 changed files with 17 additions and 2 deletions

View File

@ -1,4 +1,5 @@
source 'http://rubygems.org'
#source 'http://ruby.taobao.org'
gem 'rails', '3.2.6'
@ -43,3 +44,5 @@ gem "simple_form"
gem 'database_cleaner'
gem "mini_magick"
gem 'carrierwave-mongoid'
gem 'html_truncator'
gem 'nokogiri'

View File

@ -1,5 +1,5 @@
GEM
remote: http://rubygems.org/
remote: http://ruby.taobao.org/
specs:
actionmailer (3.2.6)
actionpack (= 3.2.6)
@ -59,6 +59,8 @@ GEM
multi_json (~> 1.0)
highline (1.6.13)
hike (1.2.1)
html_truncator (0.3.0)
nokogiri (~> 1.4)
i18n (0.6.0)
journey (1.0.4)
jquery-rails (2.0.2)
@ -86,6 +88,7 @@ GEM
net-ssh (2.5.2)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
nokogiri (1.5.5)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2)
@ -160,9 +163,11 @@ DEPENDENCIES
carrierwave-mongoid
coffee-rails (~> 3.2.1)
database_cleaner
html_truncator
jquery-rails
mini_magick
mongoid
nokogiri
rails (= 3.2.6)
redcarpet
rspec-rails (>= 2.8.1)

View File

@ -14,10 +14,15 @@ div.blog {
border-radius: 5px;
border: 1px solid #E6E6E6;
.cc {
height: 21px;
text-align: bottom;
color: #CCC;
a {
color: #CCC;
}
.bsync-custom {
display: inline-block;
}
}
h2 {
font-size: 40px;

View File

@ -5,7 +5,9 @@
<%= t(:announce_at) %>
<%= format_time(post.created_at) %> |
<%= "浏览数 " + post.visited.to_s %> |
<%= link_to t('comment'), blog_path(post) + "#disqus_thread" %>
<%= link_to t('comment'), blog_path(post) + "#disqus_thread" %> |
<div class="bsync-custom icon-long-blue"><a title="一键分享到各大微博和社交网络" class="bshare-bsync" onclick="javascript:bSync.share(event,'', {title:'<%= post.title %>', summary: '<%= Nokogiri(HTML_Truncator.truncate(post.content_html, 100)).text %>'})"></a></div>
<script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/bsync.js#uuid=df284dbb-7e09-4cac-9e90-5a186ac58e48"></script>
</div>
</div>
<div class="bottom"></div>