Skip to content

Commit

Permalink
Fix wechat typo (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
songjiayang authored and huacnlee committed Sep 22, 2016
1 parent 51f2b96 commit 0210e97
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 37 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
== 0.5.0

* Fix QRCode WeChat typo error.

== 0.4.0

* QRCode for Wechat share.
* QRCode for WeChat share.

== 0.3.4

Expand All @@ -11,7 +15,7 @@
* New SVG icon, new style.
* Removed `tqq renren kaixin001 baidu plurk` support.
* Share with popup window.
* Add Weixin (Weichat).
* Add Weixin (WeChat).

== 0.2.1

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This is a gem to helper you quick create a share feature in you Rails apps.
* Pinterest
* Email
* LinkedIn
* Weichat (Weixin)
* WeChat (Weixin)
* Vkontakte

## Screenshot
Expand Down Expand Up @@ -64,7 +64,7 @@ You need add require css,js file in your app assets files:

```
#= require social-share-button
#= require social_share_button/weichat # if you need use Weichat
#= require social_share_button/wechat # if you need use WeChat
```

`app/assets/stylesheets/application.scss`
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions app/assets/javascripts/social-share-button.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ window.SocialShareButton =
SocialShareButton.openUrl("https://www.linkedin.com/shareArticle?mini=true&url=#{url}&title=#{title}&summary=#{desc}")
when "vkontakte"
SocialShareButton.openUrl("http://vk.com/share.php?url=#{url}&title=#{title}&image=#{img}")
when "weichat"
throw new Error("You should require social-share-button/weichat to your application.js") unless window.SocialShareWeichatButton
window.SocialShareWeichatButton.qrcode
when "wechat"
throw new Error("You should require social-share-button/wechat to your application.js") unless window.SocialShareWeChatButton
window.SocialShareWeChatButton.qrcode
header: $(el).attr('title')
footer: $(el).data('weichat-footer')
footer: $(el).data('wechat-footer')

when "tumblr"
get_tumblr_extra = (param) ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
#= require jquery.qrcode.min

window.SocialShareWeichatButton =
window.SocialShareWeChatButton =
init: (opts={}) ->
$wDialog = "<div id='ss-weichat-dialog' class='ss-weichat-dialog'>
<div class='weichat-popup-header'>
$wDialog = "<div id='ss-wechat-dialog' class='ss-wechat-dialog'>
<div class='wechat-popup-header'>
<span>#{opts.header}</span>
<a href='#' onclick='return false;' class='weichat-popup-close'>×</a>
<a href='#' onclick='return false;' class='wechat-popup-close'>×</a>
</div>
<div id='ss-weichat-dialog-qr' class='weichat-dialog-qr'></div>
<div class='weichat-popup-footer'>
<div id='ss-wechat-dialog-qr' class='wechat-dialog-qr'></div>
<div class='wechat-popup-footer'>
#{opts.footer}
</div>
</div>"

$("body").append($wDialog)

bindEvents: ()->
$wContainer = $("#ss-weichat-dialog")
$wContainer.find(".weichat-popup-close").on "click", (e) ->
$wContainer = $("#ss-wechat-dialog")
$wContainer.find(".wechat-popup-close").on "click", (e) ->
$wContainer.hide()

qrcode: (opts={}) ->
unless $("#ss-weichat-dialog").length
unless $("#ss-wechat-dialog").length
@init(opts)
@bindEvents()

$wBody = $('#ss-weichat-dialog-qr')
$wBody = $('#ss-wechat-dialog-qr')
$wBody.empty()
$wBody.qrcode
width: 200
height: 200
text: location.href

$wContainer = $("#ss-weichat-dialog")
$wContainer = $("#ss-wechat-dialog")
top = ($(window).height() - $wContainer.height()) / 2
top = 100 if top < 100
left = ($(window).width() - $wContainer.width()) / 2
Expand Down
10 changes: 5 additions & 5 deletions app/assets/stylesheets/social-share-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ $size: 18px;
}

@each $site in twitter, facebook, google_bookmark, google_plus, weibo, qq,
delicious, linkedin, tumblr, pinterest, douban, weichat, vkontakte, email {
delicious, linkedin, tumblr, pinterest, douban, wechat, vkontakte, email {
.ssb-#{$site} {
background-image: image-url('social-share-button/#{$site}.svg');
}
}
}

.ss-weichat-dialog {
.ss-wechat-dialog {
width: 270px;
height: 300px;
position: fixed;
Expand All @@ -29,12 +29,12 @@ $size: 18px;
font-size: 12px;
line-height: 1.2em;

.weichat-dialog-qr {
.wechat-dialog-qr {
text-align: center;
margin: 10px 0px;
}

.weichat-popup-close {
.wechat-popup-close {
width: 16px;
height: 16px;
position: absolute;
Expand All @@ -45,7 +45,7 @@ $size: 18px;
font-size: 16px;
}

.weichat-popup-footer {
.wechat-popup-footer {
text-align: left;
line-height: 22px;
color: #666;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SocialShareButton.configure do |config|
config.allow_sites = %w(twitter facebook google_plus weibo qq douban google_bookmark delicious tumblr pinterest email linkedin weichat vkontakte)
config.allow_sites = %w(twitter facebook google_plus weibo qq douban google_bookmark delicious tumblr pinterest email linkedin wechat vkontakte)
end
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ en:
pinterest: Pinterest
email: Email
linkedin: Linkedin
weichat: Weichat
weichat_footer: Open your Weichat, click "Discover" button then click the "Scan QR Code" menu.
wechat: WeChat
wechat_footer: Open your WeChat, click "Discover" button then click the "Scan QR Code" menu.
vkontakte: Vkontakte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ fr:
pinterest: Pinterest
email: Email
linkedin: Linkedin
weichat: Weichat
weichat_footer: Open your Weichat, click "Discover" button then click the "Scan QR Code" menu.
wechat: WeChat
wechat_footer: Open your WeChat, click "Discover" button then click the "Scan QR Code" menu.
vkontakte: Vkontakte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
pinterest: Pinterest
email: Email
linkedin: Linkedin
weichat: 微信
weichat_footer: 打开微信,点击底部的“发现”,<br/> 使用“扫一扫”即可将网页分享至朋友圈。
wechat: 微信
wechat_footer: 打开微信,点击底部的“发现”,<br/> 使用“扫一扫”即可将网页分享至朋友圈。
vkontakte: Vkontakte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
pinterest: Pinterest
email: Email
linkedin: Linkedin
weichat: 微信
weichat_footer: 打開微信,點擊底部的“發現”,<br/> 使用“掃一掃”即可將網頁分享至朋友圈。
wechat: 微信
wechat_footer: 打開微信,點擊底部的“發現”,<br/> 使用“掃一掃”即可將網頁分享至朋友圈。
vkontakte: Vkontakte
2 changes: 1 addition & 1 deletion lib/social_share_button/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Config
# - pinterest
# - email
# - linkedin
# - weichat
# - wechat
# - vkontakte
attr_accessor :allow_sites

Expand Down
2 changes: 1 addition & 1 deletion lib/social_share_button/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def social_share_button_tag(title = "", opts = {})
extra_data = opts.select { |k, _| k.to_s.start_with?('data') } if name.eql?('tumblr')
special_data = opts.select { |k, _| k.to_s.start_with?('data-' + name) }

special_data["data-weichat-footer"] = t "social_share_button.weichat_footer" if name == "weichat"
special_data["data-wechat-footer"] = t "social_share_button.wechat_footer" if name == "wechat"

link_title = t "social_share_button.share_to", :name => t("social_share_button.#{name.downcase}")
html << link_to("", "#", { :rel => ["nofollow", rel],
Expand Down
2 changes: 1 addition & 1 deletion lib/social_share_button/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module SocialShareButton
VERSION = '0.4.0'
VERSION = '0.5.0'
end

0 comments on commit 0210e97

Please sign in to comment.