Skip to content

Commit

Permalink
New SVG icon, new style.
Browse files Browse the repository at this point in the history
Removed `tqq renren kaixin001 baidu plurk` support.
Share with popup window.
Add Weixin (Weichat).
  • Loading branch information
huacnlee committed Jun 28, 2016
1 parent 62a8342 commit 706dff2
Show file tree
Hide file tree
Showing 65 changed files with 212 additions and 177 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
== 0.3.0

* New SVG icon, new style.
* Removed `tqq renren kaixin001 baidu plurk` support.
* Share with popup window.
* Add Weixin (Weichat).

== 0.2.1

* Allow for override of allowed sites in helper.
Expand Down
5 changes: 1 addition & 4 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
source "http://rubygems.org"
source "https://rubygems.org"

# Specify your gem's dependencies in social-share.gemspec
gemspec

gem "sprite-factory", "1.4.1"
gem "chunky_png"
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,13 @@ This is a gem to helper you quick create a share feature in you Rails apps.
* Google+
* Weibo
* QZone
* Tencent Weibo
* Renren
* Hi Baidu
* Kaixin001
* Google Bookmark
* Delicious
* Tumblr
* Plurk
* Pinterest
* Email
* LinkedIn
* Weichat (Weixin)

## Screenshot

Expand All @@ -36,6 +32,12 @@ In your `Gemfile`:
gem 'social-share-button'
```

Old version for IE and lower browser support:

```ruby
gem 'social-share-button', '0.2.1'
```

And install it:

```bash
Expand All @@ -49,7 +51,7 @@ You can config `config/initializers/social_share_button.rb` to choose which site

```ruby
SocialShareButton.configure do |config|
config.allow_sites = %w(twitter facebook google_plus weibo douban tqq renren qq kaixin001 baidu google_bookmark delicious tumblr plurk pinterest email linkedin)
config.allow_sites = %w(twitter facebook weibo)
end
```

Expand Down Expand Up @@ -89,12 +91,6 @@ Apart from the default title, you can specify the title for the special social n
<%= social_share_button_tag(@post.title, 'data-twitter-title' => 'TheTitleForTwitter') %>
```

For Popup window use this custom popup attribute:

```erb
<%= social_share_button_tag(@post.title, :popup => "true")
```

And you can custom rel attribute:

```erb
Expand Down Expand Up @@ -131,6 +127,13 @@ Here are the mapping of attributes depending on you data-type parameter
| | | data-source |
</pre>

## Weichat feature

You must include Weichat API JS file:

```
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
```

## Demo

Expand Down
27 changes: 0 additions & 27 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,28 +1 @@
require "bundler/gem_tasks"

require 'sprite_factory'

ROOT_PATH = File.dirname(__FILE__)

namespace :assets do
desc 'recreate sprite images and css'
task :resprite do
SpriteFactory.library = :chunkypng
SpriteFactory.csspath = "image-path('sprites/$IMAGE')"
dirs = Dir.glob("#{ROOT_PATH}/app/assets/images/sprites/*/")
dirs.each do |path|
dir_name = path.split("/").last
SpriteFactory.run!("app/assets/images/sprites/#{dir_name}",
:layout => :packed,
:output_style => "app/assets/stylesheets/#{dir_name}.scss",
:nocomments => true,
:selector => ".#{dir_name}-") do |images|
result = []
images.each do |img|
result << ".social-share-button-#{img[0]} { display:inline-block; #{img[1][:style]} }"
end
result.join("\n")
end
end
end
end
13 changes: 13 additions & 0 deletions app/assets/images/social-share-button/delicious.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions app/assets/images/social-share-button/douban.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions app/assets/images/social-share-button/email.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions app/assets/images/social-share-button/facebook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions app/assets/images/social-share-button/google_bookmark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions app/assets/images/social-share-button/google_plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions app/assets/images/social-share-button/linkedin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions app/assets/images/social-share-button/pinterest.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 706dff2

Please sign in to comment.