social-share-button 0.4.0 → 0.5.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/CHANGELOG.md +6 -2
- data/README.md +2 -2
- data/app/assets/images/social-share-button/{weichat.svg → wechat.svg} +1 -1
- data/app/assets/javascripts/social-share-button.coffee +4 -4
- data/app/assets/javascripts/social-share-button/{weichat.coffee → wechat.coffee} +11 -11
- data/app/assets/stylesheets/social-share-button.scss +35 -1
- 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 -2
- data/lib/generators/social_share_button/templates/config/locales/social_share_button.fr.yml +2 -2
- data/lib/generators/social_share_button/templates/config/locales/social_share_button.zh-CN.yml +2 -2
- data/lib/generators/social_share_button/templates/config/locales/social_share_button.zh-TW.yml +2 -2
- data/lib/social_share_button/config.rb +1 -1
- data/lib/social_share_button/helper.rb +1 -1
- data/lib/social_share_button/version.rb +1 -1
- metadata +4 -5
- data/app/assets/stylesheets/social-share-button/weichat.scss +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dd97baeefb3f07baa960dace3b1d4e27aa0ce1f
|
4
|
+
data.tar.gz: 2252a07b7fc893bc4a98fc8e385aa284f9063edc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2def706044feb4a99dc4cbc961fb798b39d5e31ac50a7e534d291ab8fceca97fbc9f618074bf5865469c9308ae0cc8c8cafe4e68a6d71c0b44d9e653dc8e6ad3
|
7
|
+
data.tar.gz: 04b2787745397d3936142093654fb5fc6ecf9c4a39ef5a4502b0ae90d9fec8276c83ef4c8cad17e9ba4c04b67ab603f2c815e84135d3c39619baf5d78f0cecf3
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
|
+
== 0.5.0
|
2
|
+
|
3
|
+
* Fix QRCode WeChat typo error.
|
4
|
+
|
1
5
|
== 0.4.0
|
2
6
|
|
3
|
-
* QRCode for
|
7
|
+
* QRCode for WeChat share.
|
4
8
|
|
5
9
|
== 0.3.4
|
6
10
|
|
@@ -11,7 +15,7 @@
|
|
11
15
|
* New SVG icon, new style.
|
12
16
|
* Removed `tqq renren kaixin001 baidu plurk` support.
|
13
17
|
* Share with popup window.
|
14
|
-
* Add Weixin (
|
18
|
+
* Add Weixin (WeChat).
|
15
19
|
|
16
20
|
== 0.2.1
|
17
21
|
|
data/README.md
CHANGED
@@ -18,7 +18,7 @@ This is a gem to helper you quick create a share feature in you Rails apps.
|
|
18
18
|
* Pinterest
|
19
19
|
* Email
|
20
20
|
* LinkedIn
|
21
|
-
*
|
21
|
+
* WeChat (Weixin)
|
22
22
|
* Vkontakte
|
23
23
|
|
24
24
|
## Screenshot
|
@@ -64,7 +64,7 @@ You need add require css,js file in your app assets files:
|
|
64
64
|
|
65
65
|
```
|
66
66
|
#= require social-share-button
|
67
|
-
#= require social_share_button/
|
67
|
+
#= require social_share_button/wechat # if you need use WeChat
|
68
68
|
```
|
69
69
|
|
70
70
|
`app/assets/stylesheets/application.scss`
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<svg width="256px" height="256px" viewBox="3153 111 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
2
|
-
<desc>
|
2
|
+
<desc>WeChat (Weixin)</desc>
|
3
3
|
<defs></defs>
|
4
4
|
<g id="weixin" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" transform="translate(3153.000000, 111.000000)">
|
5
5
|
<rect id="bg" fill="#44AB12" x="0" y="0" width="256" height="256" rx="40"></rect>
|
@@ -45,11 +45,11 @@ window.SocialShareButton =
|
|
45
45
|
SocialShareButton.openUrl("https://www.linkedin.com/shareArticle?mini=true&url=#{url}&title=#{title}&summary=#{desc}")
|
46
46
|
when "vkontakte"
|
47
47
|
SocialShareButton.openUrl("http://vk.com/share.php?url=#{url}&title=#{title}&image=#{img}")
|
48
|
-
when "
|
49
|
-
throw new Error("You should require social-share-button/
|
50
|
-
window.
|
48
|
+
when "wechat"
|
49
|
+
throw new Error("You should require social-share-button/wechat to your application.js") unless window.SocialShareWeChatButton
|
50
|
+
window.SocialShareWeChatButton.qrcode
|
51
51
|
header: $(el).attr('title')
|
52
|
-
footer: $(el).data('
|
52
|
+
footer: $(el).data('wechat-footer')
|
53
53
|
|
54
54
|
when "tumblr"
|
55
55
|
get_tumblr_extra = (param) ->
|
@@ -1,14 +1,14 @@
|
|
1
1
|
#= require jquery.qrcode.min
|
2
2
|
|
3
|
-
window.
|
3
|
+
window.SocialShareWeChatButton =
|
4
4
|
init: (opts={}) ->
|
5
|
-
$wDialog = "<div id='ss-
|
6
|
-
<div class='
|
5
|
+
$wDialog = "<div id='ss-wechat-dialog' class='ss-wechat-dialog'>
|
6
|
+
<div class='wechat-popup-header'>
|
7
7
|
<span>#{opts.header}</span>
|
8
|
-
<a href='#' onclick='return false;' class='
|
8
|
+
<a href='#' onclick='return false;' class='wechat-popup-close'>×</a>
|
9
9
|
</div>
|
10
|
-
<div id='ss-
|
11
|
-
<div class='
|
10
|
+
<div id='ss-wechat-dialog-qr' class='wechat-dialog-qr'></div>
|
11
|
+
<div class='wechat-popup-footer'>
|
12
12
|
#{opts.footer}
|
13
13
|
</div>
|
14
14
|
</div>"
|
@@ -16,23 +16,23 @@ window.SocialShareWeichatButton =
|
|
16
16
|
$("body").append($wDialog)
|
17
17
|
|
18
18
|
bindEvents: ()->
|
19
|
-
$wContainer = $("#ss-
|
20
|
-
$wContainer.find(".
|
19
|
+
$wContainer = $("#ss-wechat-dialog")
|
20
|
+
$wContainer.find(".wechat-popup-close").on "click", (e) ->
|
21
21
|
$wContainer.hide()
|
22
22
|
|
23
23
|
qrcode: (opts={}) ->
|
24
|
-
unless $("#ss-
|
24
|
+
unless $("#ss-wechat-dialog").length
|
25
25
|
@init(opts)
|
26
26
|
@bindEvents()
|
27
27
|
|
28
|
-
$wBody = $('#ss-
|
28
|
+
$wBody = $('#ss-wechat-dialog-qr')
|
29
29
|
$wBody.empty()
|
30
30
|
$wBody.qrcode
|
31
31
|
width: 200
|
32
32
|
height: 200
|
33
33
|
text: location.href
|
34
34
|
|
35
|
-
$wContainer = $("#ss-
|
35
|
+
$wContainer = $("#ss-wechat-dialog")
|
36
36
|
top = ($(window).height() - $wContainer.height()) / 2
|
37
37
|
top = 100 if top < 100
|
38
38
|
left = ($(window).width() - $wContainer.width()) / 2
|
@@ -11,9 +11,43 @@ $size: 18px;
|
|
11
11
|
}
|
12
12
|
|
13
13
|
@each $site in twitter, facebook, google_bookmark, google_plus, weibo, qq,
|
14
|
-
delicious, linkedin, tumblr, pinterest, douban,
|
14
|
+
delicious, linkedin, tumblr, pinterest, douban, wechat, vkontakte, email {
|
15
15
|
.ssb-#{$site} {
|
16
16
|
background-image: image-url('social-share-button/#{$site}.svg');
|
17
17
|
}
|
18
18
|
}
|
19
19
|
}
|
20
|
+
|
21
|
+
.ss-wechat-dialog {
|
22
|
+
width: 270px;
|
23
|
+
height: 300px;
|
24
|
+
position: fixed;
|
25
|
+
background: #fff;
|
26
|
+
padding: 10px;
|
27
|
+
border: solid 1px #ddd;
|
28
|
+
z-index: 11001;
|
29
|
+
font-size: 12px;
|
30
|
+
line-height: 1.2em;
|
31
|
+
|
32
|
+
.wechat-dialog-qr {
|
33
|
+
text-align: center;
|
34
|
+
margin: 10px 0px;
|
35
|
+
}
|
36
|
+
|
37
|
+
.wechat-popup-close {
|
38
|
+
width: 16px;
|
39
|
+
height: 16px;
|
40
|
+
position: absolute;
|
41
|
+
right: 0px;
|
42
|
+
top: 10px;
|
43
|
+
color: #999;
|
44
|
+
text-decoration: none;
|
45
|
+
font-size: 16px;
|
46
|
+
}
|
47
|
+
|
48
|
+
.wechat-popup-footer {
|
49
|
+
text-align: left;
|
50
|
+
line-height: 22px;
|
51
|
+
color: #666;
|
52
|
+
}
|
53
|
+
}
|
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 qq douban google_bookmark delicious tumblr pinterest email linkedin
|
2
|
+
config.allow_sites = %w(twitter facebook google_plus weibo qq douban google_bookmark delicious tumblr pinterest email linkedin wechat vkontakte)
|
3
3
|
end
|
@@ -13,6 +13,6 @@ en:
|
|
13
13
|
pinterest: Pinterest
|
14
14
|
email: Email
|
15
15
|
linkedin: Linkedin
|
16
|
-
|
17
|
-
|
16
|
+
wechat: WeChat
|
17
|
+
wechat_footer: Open your WeChat, click "Discover" button then click the "Scan QR Code" menu.
|
18
18
|
vkontakte: Vkontakte
|
@@ -13,6 +13,6 @@ fr:
|
|
13
13
|
pinterest: Pinterest
|
14
14
|
email: Email
|
15
15
|
linkedin: Linkedin
|
16
|
-
|
17
|
-
|
16
|
+
wechat: WeChat
|
17
|
+
wechat_footer: Open your WeChat, click "Discover" button then click the "Scan QR Code" menu.
|
18
18
|
vkontakte: Vkontakte
|
@@ -14,7 +14,7 @@ module SocialShareButton
|
|
14
14
|
extra_data = opts.select { |k, _| k.to_s.start_with?('data') } if name.eql?('tumblr')
|
15
15
|
special_data = opts.select { |k, _| k.to_s.start_with?('data-' + name) }
|
16
16
|
|
17
|
-
special_data["data-
|
17
|
+
special_data["data-wechat-footer"] = t "social_share_button.wechat_footer" if name == "wechat"
|
18
18
|
|
19
19
|
link_title = t "social_share_button.share_to", :name => t("social_share_button.#{name.downcase}")
|
20
20
|
html << link_to("", "#", { :rel => ["nofollow", rel],
|
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.5.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: 2016-09-
|
11
|
+
date: 2016-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -74,13 +74,12 @@ files:
|
|
74
74
|
- app/assets/images/social-share-button/tumblr.svg
|
75
75
|
- app/assets/images/social-share-button/twitter.svg
|
76
76
|
- app/assets/images/social-share-button/vkontakte.svg
|
77
|
+
- app/assets/images/social-share-button/wechat.svg
|
77
78
|
- app/assets/images/social-share-button/weibo.svg
|
78
|
-
- app/assets/images/social-share-button/weichat.svg
|
79
79
|
- app/assets/javascripts/jquery.qrcode.min.js
|
80
80
|
- app/assets/javascripts/social-share-button.coffee
|
81
|
-
- app/assets/javascripts/social-share-button/
|
81
|
+
- app/assets/javascripts/social-share-button/wechat.coffee
|
82
82
|
- app/assets/stylesheets/social-share-button.scss
|
83
|
-
- app/assets/stylesheets/social-share-button/weichat.scss
|
84
83
|
- lib/generators/social_share_button/install_generator.rb
|
85
84
|
- lib/generators/social_share_button/templates/config/initializers/social_share_button.rb
|
86
85
|
- lib/generators/social_share_button/templates/config/locales/social_share_button.en.yml
|
@@ -1,33 +0,0 @@
|
|
1
|
-
.ss-weichat-dialog {
|
2
|
-
width: 270px;
|
3
|
-
height: 300px;
|
4
|
-
position: fixed;
|
5
|
-
background: #fff;
|
6
|
-
padding: 10px;
|
7
|
-
border: solid 1px #d8d8d8;
|
8
|
-
z-index: 11001;
|
9
|
-
font-size: 12px;
|
10
|
-
line-height: 1.2em;
|
11
|
-
|
12
|
-
.weichat-dialog-qr {
|
13
|
-
text-align: center;
|
14
|
-
margin: 10px 0px;
|
15
|
-
}
|
16
|
-
|
17
|
-
.weichat-popup-close {
|
18
|
-
width: 16px;
|
19
|
-
height: 16px;
|
20
|
-
position: absolute;
|
21
|
-
right: 10px;
|
22
|
-
top: 8px;
|
23
|
-
color: #999;
|
24
|
-
text-decoration: none;
|
25
|
-
font-size: 16px;
|
26
|
-
}
|
27
|
-
|
28
|
-
.weichat-popup-footer {
|
29
|
-
text-align: left;
|
30
|
-
line-height: 22px;
|
31
|
-
color: #666;
|
32
|
-
}
|
33
|
-
}
|