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 +4 -4
- data/Changelogs.md +8 -0
- data/README.md +5 -0
- data/app/assets/javascripts/social-share-button.coffee +12 -8
- data/lib/social_share_button/helper.rb +1 -1
- data/lib/social_share_button/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 465fd429bf5f39014d9f33c9509e412a59c7d6ff
|
4
|
+
data.tar.gz: 987cc9c1ef85f72ada0f7bd31f24933c09aacc49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d6421ea69c2e1d6b277c20b719a74d2415b6686448dd7486c695a35c33ff5c984264147cda9d753fedb7b6bf29885733cd97d62e6b2167c29192c24fec68777
|
7
|
+
data.tar.gz: 9bbf2b5bf04d498b6b2420284ed54a245d4646855269e3e428cf01425a9be09268ceb8d057c7cef5cbb4cc0523397827d7cbb22b99d5d673462bba53b99e3cdc
|
data/Changelogs.md
CHANGED
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
|
-
|
9
|
-
|
10
|
-
|
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/
|
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')
|
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.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-
|
11
|
+
date: 2014-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|