social-share-button 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelogs.md +6 -1
- data/README.md +3 -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 +5 -1
- data/app/assets/stylesheets/social-share-button.scss +34 -31
- 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 +2 -0
- data/lib/generators/social_share_button/templates/config/locales/social_share_button.zh-CN.yml +3 -1
- data/lib/generators/social_share_button/templates/config/locales/social_share_button.zh-TW.yml +3 -1
- data/lib/social_share_button/helper.rb +1 -1
- 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: ee1aad2c7824f2f8572ac792243562ea1c38bb8b
|
4
|
+
data.tar.gz: 8f4afb708af3f2c064032ecf5dc92d217cb00f8e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2a88f7b6eefbb1a157bff1d831ff1386ee6c4a551d0a3de88d878355a73648b8af3fee83a1a8b236bf03cf330ef111d27490848e7b41b909a5dff1aed62f450
|
7
|
+
data.tar.gz: df50a8d2814cfcf9f40e5bb89cc69fa6d9a480fd10029efd246d0967eb7c396f046fc6f2c43c3651307870558946dcf35f9f2444c1627c3ef80fc4ef6ade423e
|
data/Changelogs.md
CHANGED
data/README.md
CHANGED
@@ -17,6 +17,8 @@ This is a gem to helper you quick create a share feature in you Rails apps.
|
|
17
17
|
* Google Bookmark
|
18
18
|
* Delicious
|
19
19
|
* Tumblr
|
20
|
+
* Plurk
|
21
|
+
* Email
|
20
22
|
|
21
23
|
## Screenshot
|
22
24
|
|
@@ -43,7 +45,7 @@ You can config `config/initializes/social_share_button.rb` to choose which site
|
|
43
45
|
|
44
46
|
```ruby
|
45
47
|
SocialShareButton.configure do |config|
|
46
|
-
config.allow_sites = %w(twitter facebook google_plus weibo douban tqq renren qq kaixin001 baidu tumblr)
|
48
|
+
config.allow_sites = %w(twitter facebook google_plus weibo douban tqq renren qq kaixin001 baidu tumblr plurk email)
|
47
49
|
end
|
48
50
|
```
|
49
51
|
|
Binary file
|
Binary file
|
@@ -11,6 +11,8 @@ window.SocialShareButton =
|
|
11
11
|
if url.length == 0
|
12
12
|
url = encodeURIComponent(location.href)
|
13
13
|
switch site
|
14
|
+
when "email"
|
15
|
+
location.href = "mailto:?to=&subject=#{title}&body=#{url}"
|
14
16
|
when "weibo"
|
15
17
|
SocialShareButton.openUrl("http://service.weibo.com/share/share.php?url=#{url}&type=3&pic=#{img}&title=#{title}")
|
16
18
|
when "twitter"
|
@@ -28,13 +30,15 @@ window.SocialShareButton =
|
|
28
30
|
when "kaixin001"
|
29
31
|
SocialShareButton.openUrl("http://www.kaixin001.com/rest/records.php?url=#{url}&content=#{title}&style=11&pic=#{img}")
|
30
32
|
when "renren"
|
31
|
-
SocialShareButton.openUrl("http://widget.renren.com/dialog/share?resourceUrl=#{url}&title=#{title}&description=")
|
33
|
+
SocialShareButton.openUrl("http://widget.renren.com/dialog/share?resourceUrl=#{url}&srcUrl=#{url}&title=#{title}&pic=#{img}&description=")
|
32
34
|
when "google_plus"
|
33
35
|
SocialShareButton.openUrl("https://plus.google.com/share?url=#{url}&t=#{title}")
|
34
36
|
when "google_bookmark"
|
35
37
|
SocialShareButton.openUrl("https://www.google.com/bookmarks/mark?op=edit&output=popup&bkmk=#{url}&title=#{title}")
|
36
38
|
when "delicious"
|
37
39
|
SocialShareButton.openUrl("http://www.delicious.com/save?url=#{url}&title=#{title}&jump=yes&pic=#{img}")
|
40
|
+
when "plurk"
|
41
|
+
SocialShareButton.openUrl("http://www.plurk.com/?status=#{title}: #{url}&qualifier=shares")
|
38
42
|
when "tumblr"
|
39
43
|
get_tumblr_extra = (param) ->
|
40
44
|
cutom_data = $(el).attr("data-#{param}")
|
@@ -1,26 +1,27 @@
|
|
1
1
|
/*
|
2
2
|
|
3
3
|
Creating a sprite from following images:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
4
|
+
|
5
|
+
app/assets/images/sprites/social-share-button/baidu.png (16x16)
|
6
|
+
app/assets/images/sprites/social-share-button/delicious.png (16x16)
|
7
|
+
app/assets/images/sprites/social-share-button/douban.png (16x16)
|
8
|
+
app/assets/images/sprites/social-share-button/email.png (16x16)
|
9
|
+
app/assets/images/sprites/social-share-button/facebook.png (16x16)
|
10
|
+
app/assets/images/sprites/social-share-button/flickr.png (16x16)
|
11
|
+
app/assets/images/sprites/social-share-button/google_bookmark.png (16x16)
|
12
|
+
app/assets/images/sprites/social-share-button/google_plus.png (16x16)
|
13
|
+
app/assets/images/sprites/social-share-button/kaixin001.png (16x16)
|
14
|
+
app/assets/images/sprites/social-share-button/plurk.png (16x16)
|
15
|
+
app/assets/images/sprites/social-share-button/qq.png (16x16)
|
16
|
+
app/assets/images/sprites/social-share-button/renren.png (16x16)
|
17
|
+
app/assets/images/sprites/social-share-button/tqq.png (16x16)
|
18
|
+
app/assets/images/sprites/social-share-button/tumblr.png (16x16)
|
19
|
+
app/assets/images/sprites/social-share-button/twitter.png (16x16)
|
20
|
+
app/assets/images/sprites/social-share-button/weibo.png (16x16)
|
20
21
|
|
21
22
|
Output files:
|
22
|
-
|
23
|
-
|
23
|
+
app/assets/images/sprites/social-share-button.png
|
24
|
+
app/assets/stylesheets/social-share-button.scss
|
24
25
|
|
25
26
|
Output size:
|
26
27
|
64x64
|
@@ -36,12 +37,13 @@
|
|
36
37
|
.social-share-button-google_bookmark { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) 0px -32px no-repeat }
|
37
38
|
.social-share-button-google_plus { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -16px -32px no-repeat }
|
38
39
|
.social-share-button-kaixin001 { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -32px -32px no-repeat }
|
39
|
-
.social-share-button-
|
40
|
-
.social-share-button-
|
41
|
-
.social-share-button-
|
42
|
-
.social-share-button-
|
43
|
-
.social-share-button-
|
44
|
-
.social-share-button-
|
40
|
+
.social-share-button-plurk { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -48px 0px no-repeat }
|
41
|
+
.social-share-button-qq { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -48px -16px no-repeat }
|
42
|
+
.social-share-button-renren { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -48px -32px no-repeat }
|
43
|
+
.social-share-button-tqq { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) 0px -48px no-repeat }
|
44
|
+
.social-share-button-tumblr { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -16px -48px no-repeat }
|
45
|
+
.social-share-button-twitter { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -32px -48px no-repeat }
|
46
|
+
.social-share-button-weibo { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -48px -48px no-repeat }
|
45
47
|
|
46
48
|
@media only screen and (-webkit-device-pixel-ratio: 2) {
|
47
49
|
.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:64px 64px; }
|
@@ -53,10 +55,11 @@
|
|
53
55
|
.social-share-button-google_bookmark { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) 0px -32px no-repeat; background-size:64px 64px;}
|
54
56
|
.social-share-button-google_plus { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) -16px -32px no-repeat; background-size:64px 64px;}
|
55
57
|
.social-share-button-kaixin001 { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) -32px -32px no-repeat; background-size:64px 64px;}
|
56
|
-
.social-share-button-
|
57
|
-
.social-share-button-
|
58
|
-
.social-share-button-
|
59
|
-
.social-share-button-
|
60
|
-
.social-share-button-
|
61
|
-
.social-share-button-
|
62
|
-
}
|
58
|
+
.social-share-button-plurk { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -48px 0px no-repeat; background-size:64px 64px; }
|
59
|
+
.social-share-button-qq { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) -48px 16px no-repeat; background-size:64px 64px;}
|
60
|
+
.social-share-button-renren { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) -48px -32px no-repeat; background-size:64px 64px;}
|
61
|
+
.social-share-button-tqq { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) 0px -48 no-repeat; background-size:64px 64px;}
|
62
|
+
.social-share-button-tumblr { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) -16px -48px no-repeat; background-size:64px 64px;}
|
63
|
+
.social-share-button-twitter { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) -32px -48px no-repeat; background-size:64px 64px;}
|
64
|
+
.social-share-button-weibo { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) -48px -48px no-repeat; background-size:64px 64px;}
|
65
|
+
}
|
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)
|
2
|
+
config.allow_sites = %w(twitter facebook google_plus weibo douban tqq renren qq kaixin001 baidu google_bookmark delicious huaban tumblr plurk)
|
3
3
|
end
|
@@ -5,7 +5,7 @@ module SocialShareButton
|
|
5
5
|
extra_data = {}
|
6
6
|
rel = opts[:rel]
|
7
7
|
html = []
|
8
|
-
html << "<div class='social-share-button' data-title='#{title}' data-img='#{opts[:image]}' data-url='#{opts[:url]}'>"
|
8
|
+
html << "<div class='social-share-button' data-title='#{h title}' data-img='#{opts[:image]}' data-url='#{opts[:url]}'>"
|
9
9
|
|
10
10
|
SocialShareButton.config.allow_sites.each do |name|
|
11
11
|
extra_data = opts.select { |k, _| k.to_s.start_with?('data') } if name.eql?('tumblr')
|
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.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -68,7 +68,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
68
68
|
version: '0'
|
69
69
|
requirements: []
|
70
70
|
rubyforge_project:
|
71
|
-
rubygems_version: 2.0.
|
71
|
+
rubygems_version: 2.0.3
|
72
72
|
signing_key:
|
73
73
|
specification_version: 4
|
74
74
|
summary: Helper for add social share feature in your Rails app. Twitter, Facebook,
|