social-share-button 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 725c9eb00296ec6faf293f6694c1b79a52f1d9e8
4
- data.tar.gz: c9d3dcb3a333d2418086195bcc99d6ff2474b8a4
3
+ metadata.gz: 465fd429bf5f39014d9f33c9509e412a59c7d6ff
4
+ data.tar.gz: 987cc9c1ef85f72ada0f7bd31f24933c09aacc49
5
5
  SHA512:
6
- metadata.gz: 980994dc1be7443750f11e2a8c14721641e613418a43a5af7ab3bc9ee0de0ec9d06b5aabb0db16937dd103b1fe2a92f892d1a2b971b70b1dd243f55da4a01ece
7
- data.tar.gz: b71bc70ad56e517d6d8077452af6d30e0c4d69faa5a846e56ebb15779e0f0e7d533216104bc03364209e3bed4f823da3746d131b676593e5392a88fb319af455
6
+ metadata.gz: 8d6421ea69c2e1d6b277c20b719a74d2415b6686448dd7486c695a35c33ff5c984264147cda9d753fedb7b6bf29885733cd97d62e6b2167c29192c24fec68777
7
+ data.tar.gz: 9bbf2b5bf04d498b6b2420284ed54a245d4646855269e3e428cf01425a9be09268ceb8d057c7cef5cbb4cc0523397827d7cbb22b99d5d673462bba53b99e3cdc
data/Changelogs.md CHANGED
@@ -1,3 +1,11 @@
1
+ == 0.1.7
2
+
3
+ * Add desc support;
4
+
5
+ == 0.1.5
6
+
7
+ * Add Tumblr;
8
+
1
9
  == 0.1.4
2
10
 
3
11
  * Add Plurk support;
data/README.md CHANGED
@@ -84,6 +84,11 @@ You can also specify the URL that it links to:
84
84
  <%= social_share_button_tag(@post.title, :url => "http://myapp.com/foo/bar") %>
85
85
  ```
86
86
 
87
+
88
+ ```erb
89
+ <%= social_share_button_tag(@post.title, :url => "http://myapp.com/foo/bar", :image => "http://foo.bar/images/a.jpg", desc: "The summary of page") %>
90
+ ```
91
+
87
92
  For the Tumblr there are an extra settings, prefixed with :'data-*'
88
93
  ```erb
89
94
  <%= social_share_button_tag(@post.title, :image => "https://raw.github.com/vkulpa/social-share-button/master/lib/assets/images/sprites/social-share-button/tumblr.png", :'data-type' => 'photo') %>
@@ -5,9 +5,13 @@ window.SocialShareButton =
5
5
 
6
6
  share : (el) ->
7
7
  site = $(el).data('site')
8
- title = encodeURIComponent($(el).parent().data('title') || '')
9
- img = encodeURIComponent($(el).parent().data("img") || '')
10
- url = encodeURIComponent($(el).parent().data("url") || '')
8
+ $parent = $(el).parent()
9
+ title = encodeURIComponent($parent.data('title') || '')
10
+ img = encodeURIComponent($parent.data("img") || '')
11
+ url = encodeURIComponent($parent.data("url") || '')
12
+ via = encodeURIComponent($parent.data("via") || '')
13
+ desc = encodeURIComponent($parent.data("desc") || ' ')
14
+
11
15
  if url.length == 0
12
16
  url = encodeURIComponent(location.href)
13
17
  switch site
@@ -16,21 +20,21 @@ window.SocialShareButton =
16
20
  when "weibo"
17
21
  SocialShareButton.openUrl("http://service.weibo.com/share/share.php?url=#{url}&type=3&pic=#{img}&title=#{title}")
18
22
  when "twitter"
19
- SocialShareButton.openUrl("https://twitter.com/home?status=#{title}: #{url}")
23
+ SocialShareButton.openUrl("https://twitter.com/intent/tweet?url=#{url}&text=#{title}&via=#{via}")
20
24
  when "douban"
21
- SocialShareButton.openUrl("http://shuo.douban.com/!service/share?href=#{url}&name=#{title}&image=#{img}")
25
+ SocialShareButton.openUrl("http://shuo.douban.com/!service/share?href=#{url}&name=#{title}&image=#{img}&sel=#{desc}")
22
26
  when "facebook"
23
27
  SocialShareButton.openUrl("http://www.facebook.com/sharer.php?u=#{url}")
24
28
  when "qq"
25
- SocialShareButton.openUrl("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=#{url}&title=#{title}&pics=#{img}")
29
+ SocialShareButton.openUrl("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=#{url}&title=#{title}&pics=#{img}&summary=#{desc}")
26
30
  when "tqq"
27
31
  SocialShareButton.openUrl("http://share.v.t.qq.com/index.php?c=share&a=index&url=#{url}&title=#{title}&pic=#{img}")
28
32
  when "baidu"
29
- SocialShareButton.openUrl("http://hi.baidu.com/pub/show/share?url=#{url}&title=#{title}&content=")
33
+ SocialShareButton.openUrl("http://hi.baidu.com/pub/show/share?url=#{url}&title=#{title}&content=#{desc}")
30
34
  when "kaixin001"
31
35
  SocialShareButton.openUrl("http://www.kaixin001.com/rest/records.php?url=#{url}&content=#{title}&style=11&pic=#{img}")
32
36
  when "renren"
33
- SocialShareButton.openUrl("http://widget.renren.com/dialog/share?resourceUrl=#{url}&srcUrl=#{url}&title=#{title}&pic=#{img}&description=")
37
+ SocialShareButton.openUrl("http://widget.renren.com/dialog/share?resourceUrl=#{url}&srcUrl=#{url}&title=#{title}&pic=#{img}&description=#{desc}")
34
38
  when "google_plus"
35
39
  SocialShareButton.openUrl("https://plus.google.com/share?url=#{url}")
36
40
  when "google_bookmark"
@@ -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='#{h 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]}' data-desc='#{opts[:desc]}'>"
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.6"
2
+ VERSION = "0.1.7"
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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-08 00:00:00.000000000 Z
11
+ date: 2014-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails