social-share-button 0.1.10 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changelogs.md +8 -0
- data/README.md +10 -1
- data/app/assets/images/sprites/social-share-button.png +0 -0
- data/app/assets/images/sprites/social-share-button@2x.png +0 -0
- data/app/assets/javascripts/social-share-button.coffee +2 -0
- data/app/assets/stylesheets/social-share-button.scss +5 -0
- data/lib/generators/social_share_button/templates/config/initializers/social_share_button.rb +1 -1
- data/lib/generators/social_share_button/templates/config/locales/social_share_button.en.yml +1 -0
- data/lib/generators/social_share_button/templates/config/locales/social_share_button.zh-CN.yml +2 -0
- data/lib/generators/social_share_button/templates/config/locales/social_share_button.zh-TW.yml +2 -0
- data/lib/social_share_button/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c7352142b888a38c539b4fb46898ca2f1204b46
|
4
|
+
data.tar.gz: afb97a770bfdd89598ac7049d07c5351c39f4715
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfb93dc708f5843f9e3103305db1a6427f2ce58b7399d7cfb7ece5957b65e8a6a431a0cfce8981affa4876d9297a522352a2762b289504dfec2601f04278a3ef
|
7
|
+
data.tar.gz: c996babab24cb81df2cb147e18f7f95c0e6e0b3cd0463fe82616f3aa9a686775e84659c4363346979159b2ceb61b129c027a0aa1f2646ecc3d82e2d80507a47b
|
data/Changelogs.md
CHANGED
data/README.md
CHANGED
@@ -20,6 +20,7 @@ This is a gem to helper you quick create a share feature in you Rails apps.
|
|
20
20
|
* Plurk
|
21
21
|
* Pinterest
|
22
22
|
* Email
|
23
|
+
* LinkedIn
|
23
24
|
|
24
25
|
## Screenshot
|
25
26
|
|
@@ -46,7 +47,7 @@ You can config `config/initializes/social_share_button.rb` to choose which site
|
|
46
47
|
|
47
48
|
```ruby
|
48
49
|
SocialShareButton.configure do |config|
|
49
|
-
config.allow_sites = %w(twitter facebook google_plus weibo douban tqq renren qq kaixin001 baidu tumblr plurk pinterest email)
|
50
|
+
config.allow_sites = %w(twitter facebook google_plus weibo douban tqq renren qq kaixin001 baidu google_bookmark delicious tumblr plurk pinterest email linkedin)
|
50
51
|
end
|
51
52
|
```
|
52
53
|
|
@@ -66,6 +67,14 @@ You need add require css,js file in your app assets files:
|
|
66
67
|
*= require social-share-button
|
67
68
|
```
|
68
69
|
|
70
|
+
In Rails 4.1.6 , use `@import` to require files:
|
71
|
+
|
72
|
+
`app/assets/stylesheets/application.css.scss`
|
73
|
+
|
74
|
+
```
|
75
|
+
@import "social-share-button";
|
76
|
+
```
|
77
|
+
|
69
78
|
Then you can use `social_share_button_tag` helper in views, for example `app/views/posts/show.html.erb`
|
70
79
|
|
71
80
|
```erb
|
Binary file
|
Binary file
|
@@ -52,6 +52,8 @@ window.SocialShareButton =
|
|
52
52
|
SocialShareButton.openUrl("http://www.plurk.com/?status=#{title}: #{url}&qualifier=shares", popup)
|
53
53
|
when "pinterest"
|
54
54
|
SocialShareButton.openUrl("http://www.pinterest.com/pin/create/button/?url=#{url}&media=#{img}&description=#{title}", popup)
|
55
|
+
when "linkedin"
|
56
|
+
SocialShareButton.openUrl("https://www.linkedin.com/shareArticle?url=#{url}&title=#{title}", popup)
|
55
57
|
when "tumblr"
|
56
58
|
get_tumblr_extra = (param) ->
|
57
59
|
cutom_data = $(el).attr("data-#{param}")
|
@@ -19,6 +19,8 @@
|
|
19
19
|
app/assets/images/sprites/social-share-button/tumblr.png (16x16)
|
20
20
|
app/assets/images/sprites/social-share-button/twitter.png (16x16)
|
21
21
|
app/assets/images/sprites/social-share-button/weibo.png (16x16)
|
22
|
+
app/assets/images/sprites/social-share-button/linkedin.png (16x16)
|
23
|
+
|
22
24
|
|
23
25
|
Output files:
|
24
26
|
app/assets/images/sprites/social-share-button.png
|
@@ -45,6 +47,8 @@
|
|
45
47
|
.social-share-button-tumblr { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -32px -48px no-repeat }
|
46
48
|
.social-share-button-twitter { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -48px -48px no-repeat }
|
47
49
|
.social-share-button-weibo { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -64px 0px no-repeat }
|
50
|
+
.social-share-button-linkedin { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -64px -16px no-repeat }
|
51
|
+
|
48
52
|
|
49
53
|
@media only screen and (-webkit-device-pixel-ratio: 2) {
|
50
54
|
.social-share-button-baidu { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) 0px 0px no-repeat; background-size:80px 64px; }
|
@@ -64,4 +68,5 @@
|
|
64
68
|
.social-share-button-tumblr { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) -32px -48px no-repeat; background-size:80px 64px; }
|
65
69
|
.social-share-button-twitter { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) -48px -48px no-repeat; background-size:80px 64px; }
|
66
70
|
.social-share-button-weibo { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) -64px 0px no-repeat; background-size:80px 64px; }
|
71
|
+
.social-share-button-linkedin { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) -64px -16px no-repeat; background-size:80px 64px; }
|
67
72
|
}
|
data/lib/generators/social_share_button/templates/config/initializers/social_share_button.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
SocialShareButton.configure do |config|
|
2
|
-
config.allow_sites = %w(twitter facebook google_plus weibo douban tqq renren qq kaixin001 baidu google_bookmark delicious huaban tumblr plurk pinterest)
|
2
|
+
config.allow_sites = %w(twitter facebook google_plus weibo douban tqq renren qq kaixin001 baidu google_bookmark delicious huaban tumblr plurk pinterest email linkedin)
|
3
3
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social-share-button
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
99
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.
|
100
|
+
rubygems_version: 2.6.2
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: Helper for add social share feature in your Rails app. Twitter, Facebook,
|