social-share-button 0.1.4 → 0.1.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f56a275dfd2eb1705ac0f2410eaf985bca4b11c
4
- data.tar.gz: e2559fa409688fbda3e7c147567c97ccdf378283
3
+ metadata.gz: ee1aad2c7824f2f8572ac792243562ea1c38bb8b
4
+ data.tar.gz: 8f4afb708af3f2c064032ecf5dc92d217cb00f8e
5
5
  SHA512:
6
- metadata.gz: 57388c231d9e2698f0e0cf59eaef51789494aac7ecacade8e14eac049322b1948e87140150c2fc57941c8442686acd4dc98cf3108e551d53b4cbad642ffbd91e
7
- data.tar.gz: f17ca37c6551a1c4faffd45da9bf56629c09dc4601df462f263ecee4b1b56e65f352fadab97e2cd9406b468b7b19089375fa4b22984ec8f72a106e0c0940d9cd
6
+ metadata.gz: e2a88f7b6eefbb1a157bff1d831ff1386ee6c4a551d0a3de88d878355a73648b8af3fee83a1a8b236bf03cf330ef111d27490848e7b41b909a5dff1aed62f450
7
+ data.tar.gz: df50a8d2814cfcf9f40e5bb89cc69fa6d9a480fd10029efd246d0967eb7c396f046fc6f2c43c3651307870558946dcf35f9f2444c1627c3ef80fc4ef6ade423e
data/Changelogs.md CHANGED
@@ -1,6 +1,11 @@
1
1
  == 0.1.4
2
2
 
3
- * Support Rails 4
3
+ * Add Plurk support;
4
+ * Fix Renren share link;
5
+
6
+ == 0.1.3
7
+
8
+ * Support Rails 4;
4
9
 
5
10
  == 0.1.2
6
11
 
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
 
@@ -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
- lib/assets/images/sprites/social-share-button/baidu.png (16x16)
6
- lib/assets/images/sprites/social-share-button/delicious.png (16x16)
7
- lib/assets/images/sprites/social-share-button/douban.png (16x16)
8
- lib/assets/images/sprites/social-share-button/email.png (16x16)
9
- lib/assets/images/sprites/social-share-button/facebook.png (16x16)
10
- lib/assets/images/sprites/social-share-button/flickr.png (16x16)
11
- lib/assets/images/sprites/social-share-button/google_bookmark.png (16x16)
12
- lib/assets/images/sprites/social-share-button/google_plus.png (16x16)
13
- lib/assets/images/sprites/social-share-button/kaixin001.png (16x16)
14
- lib/assets/images/sprites/social-share-button/qq.png (16x16)
15
- lib/assets/images/sprites/social-share-button/renren.png (16x16)
16
- lib/assets/images/sprites/social-share-button/tqq.png (16x16)
17
- lib/assets/images/sprites/social-share-button/tumblr.png (16x16)
18
- lib/assets/images/sprites/social-share-button/twitter.png (16x16)
19
- lib/assets/images/sprites/social-share-button/weibo.png (16x16)
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
- lib/assets/images/sprites/social-share-button.png
23
- lib/assets/stylesheets/social-share-button.scss
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-qq { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -48px 0px no-repeat }
40
- .social-share-button-renren { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -48px -16px no-repeat }
41
- .social-share-button-tqq { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -48px -32px no-repeat }
42
- .social-share-button-tumblr { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) 0px -48px no-repeat }
43
- .social-share-button-twitter { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -16px -48px no-repeat }
44
- .social-share-button-weibo { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button.png')) -32px -48px no-repeat }
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-qq { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) -48px 0px no-repeat; background-size:64px 64px;}
57
- .social-share-button-renren { 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;}
58
- .social-share-button-tqq { 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;}
59
- .social-share-button-tumblr { display:inline-block; width: 16px; height: 16px; background: url(image-path('sprites/social-share-button@2x.png')) 0px -48px no-repeat; background-size:64px 64px;}
60
- .social-share-button-twitter { 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;}
61
- .social-share-button-weibo { 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;}
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
+ }
@@ -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
@@ -14,3 +14,5 @@ en:
14
14
  google_plus: Google+
15
15
  google_bookmark: Google Bookmark
16
16
  tumblr: Tumblr
17
+ plurk: Plurk
18
+ email: Email
@@ -13,4 +13,6 @@
13
13
  renren: 人人网
14
14
  google_plus: Google+
15
15
  google_bookmark: Google 收藏
16
- tumblr: Tumblr
16
+ tumblr: Tumblr
17
+ plurk: Plurk
18
+ email: Email
@@ -13,4 +13,6 @@
13
13
  renren: 人人網
14
14
  google_plus: Google+
15
15
  google_bookmark: Google 收藏
16
- tumblr: Tumblr
16
+ tumblr: Tumblr
17
+ plurk: 噗浪
18
+ email: Email
@@ -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')
@@ -1,3 +1,3 @@
1
1
  module SocialShareButton
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
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.1.4
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-06-06 00:00:00.000000000 Z
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.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,