social-share-button 1.1.0 → 1.2.0

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
- SHA1:
3
- metadata.gz: 46a5d6a7247115dde4ce77e78fd9d301dcf2fb99
4
- data.tar.gz: f47b1c60d8c3e521e0cdcc6bda0712f1317fa4cd
2
+ SHA256:
3
+ metadata.gz: 7fb0d48d54bf21bb0da56e7973f240a94c64f45e510b20646df667b9c52ac168
4
+ data.tar.gz: 8bc2c37e819b095055ec53e1d41be886754f71f5e65639ca8cffb8ec5275db6b
5
5
  SHA512:
6
- metadata.gz: 876b82000a7397c07cf9c56ea687001c77d5647287eb0fd04ad158839bd6c9421d749d5ec69ce78b4b6f0cac1c98cd72b5fd22f2d17abcd98f84f86423e1a4b2
7
- data.tar.gz: 93c8531ee33742efd10a20967e30d6e1df21687f39ca6a7704d71c5809e6133f8b5bfe57a0c2ddf8a72c9597e8c522bd2bbd73a6cc813605a5bc81ed1f9344a0
6
+ metadata.gz: 76295db42df9c0c5b21c5e6fe331dd1852c0c4e39e9e3fdd6387648e5f0444f3fab6850f77872f5af7e7a89253a20b60e2c50b52e22de687a84900aa7c327b00
7
+ data.tar.gz: 1595b1fc360d0d34a396d377019e25ad1c2e7ee3c009edc727323952dd0ca61a9d3999eda3fd2cb21de682ff434e22b06f9e285917cd0b949b0cd6db89051bef
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ 1.2.0
2
+ -----
3
+
4
+ - Adds social share on WhatsApp (#170)
5
+
1
6
  1.1.0
2
7
  -----
3
8
 
data/README.md CHANGED
@@ -25,6 +25,7 @@ This is a gem to helper you quick create a share feature in you Rails apps.
25
25
  * Reddit
26
26
  * Hacker News
27
27
  * Telegram
28
+ * WhatsApp
28
29
 
29
30
  ## Screenshot
30
31
 
@@ -61,6 +62,8 @@ SocialShareButton.configure do |config|
61
62
  end
62
63
  ```
63
64
 
65
+ More site names you can visit https://github.com/huacnlee/social-share-button/blob/master/lib/social_share_button/config.rb#L33 to found it.
66
+
64
67
  ## Usage
65
68
 
66
69
  You need add require css,js file in your app assets files:
@@ -140,6 +143,22 @@ Here are the mapping of attributes depending on you data-type parameter
140
143
  | quote | title | data-quote |
141
144
  | | | data-source |
142
145
 
146
+ ## Facebook
147
+
148
+ A couple of gotchas for Facebook only:
149
+
150
+ ### Facebook needs the description added
151
+
152
+ ```
153
+ <%= social_share_button_tag('Share to Facebook', :url => course_path(@course), desc: @course.name) %>
154
+ ```
155
+ This will add the required ```data-desc``` element, and Facebook will then accept the request.
156
+
157
+ ### Testing from localhost will not work
158
+
159
+ You will need to test from a live site or Facebook will reject it; localhost will not work.
160
+
161
+
143
162
  ## How to change icon size?
144
163
 
145
164
  Yes, you can override social-share-button base css to change the icon size.
@@ -0,0 +1,10 @@
1
+ <svg width="256px" height="256px" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
2
+ <desc>WhatsApp</desc>
3
+ <defs></defs>
4
+ <g id="whatsapp" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <rect id="bg" fill="#57BA63" x="0" y="0" width="256" height="256" rx="40"></rect>
6
+ <g id="Shape" transform="translate(58.000000, 58.000000)" fill="#FFFFFF">
7
+ <path d="M71.2724475,136.394222 C59.2215576,136.394222 47.9002222,133.314222 38.0504454,127.908666 L0,140 L12.4039994,103.410223 C6.1475556,93.1326657 2.54333205,81.0802212 2.54333205,68.1971109 C2.54333205,30.5324424 33.3137774,0 71.2740021,0 C109.229559,0 140,30.5324424 140,68.1971109 C140,105.861779 109.231113,136.394222 71.2724475,136.394222 Z M71.0000021,11 C39.0161515,11 13,36.7945829 13,68.5 C13,81.0813905 17.1049385,92.733024 24.0469509,102.213136 L16.8020247,123.566402 L39.0895382,116.488687 C48.2487489,122.496244 59.219188,126 71.0000021,126 C102.979163,126 129,100.206976 129,68.501559 C129,36.7961419 102.979163,11 71.0000021,11 Z M105.75822,83.6071414 C105.338032,82.9152786 104.222686,82.4973758 102.55275,81.6662107 C100.878182,80.8350455 92.6505531,76.809237 91.1196504,76.2566724 C89.5841162,75.7025651 88.4672219,75.4224136 87.3534194,77.0878375 C86.2396127,78.7532614 83.0325986,82.4973758 82.0547376,83.6071414 C81.0784204,84.718458 80.1036513,84.8577603 78.4306276,84.0250442 C76.7591477,83.1938791 71.3677812,81.4371379 64.9753794,75.7706673 C60.0026527,71.3625498 56.6442462,65.9205114 55.6694771,64.2535407 C54.6931599,62.5896594 55.5659729,61.690392 56.4032567,60.8623248 C57.1555791,60.1162895 58.0762804,58.919843 58.9135642,57.9493797 C59.750848,56.9773654 60.0289147,56.2855026 60.5850441,55.174186 C61.1442611,54.0644162 60.8646547,53.0939529 60.4460107,52.25969 C60.0273709,51.4285248 56.6797754,43.2437971 55.2863623,39.912945 C53.8929492,36.5851908 52.5010799,37.1393023 51.5232189,37.1393023 C50.5469018,37.1393023 49.4315554,37 48.3162049,37 C47.2008543,37 45.3872576,37.416356 43.8532631,39.0802331 C42.3208166,40.7456612 38,44.7699228 38,52.9531038 C38,61.1378316 43.9922964,69.0455057 44.8311241,70.1537245 C45.666864,71.2619433 56.4017129,88.6034173 73.4084646,95.2635704 C90.4214,101.922177 90.4214,99.7010943 93.4893807,99.4240365 C96.5527298,99.1469828 103.383854,95.4013259 104.781903,91.5179134 C106.173772,87.631403 106.173772,84.300551 105.75822,83.6071414 Z"></path>
8
+ </g>
9
+ </g>
10
+ </svg>
@@ -98,4 +98,9 @@ window.SocialShareButton =
98
98
  SocialShareButton.openUrl("http://news.ycombinator.com/submitlink?u=#{url}&t=#{title}", 770, 500)
99
99
  when "telegram"
100
100
  SocialShareButton.openUrl("https://telegram.me/share/url?text=#{title}&url=#{url}")
101
+ when "whatsapp_app"
102
+ whatsapp_app_url = "whatsapp://send?text=#{title}&url=#{url}"
103
+ window.open(whatsapp_app_url, '_top')
104
+ when "whatsapp_web"
105
+ SocialShareButton.openUrl("https://web.whatsapp.com/send?text=#{title}&url=#{url}")
101
106
  false
@@ -83,6 +83,11 @@
83
83
  background-image: url(<%= asset_path('social-share-button/telegram.svg') %>);
84
84
  }
85
85
 
86
+ .social-share-button .ssb-whatsapp_app,
87
+ .social-share-button .ssb-whatsapp_web {
88
+ background-image: url(<%= asset_path('social-share-button/whatsapp.svg') %>);
89
+ }
90
+
86
91
  .ss-wechat-dialog {
87
92
  width: 300px;
88
93
  position: fixed;
@@ -21,3 +21,4 @@ de:
21
21
  reddit: Reddit
22
22
  hacker_news: Hacker News
23
23
  telegram: Telegram
24
+ whatsapp: WhatsApp
@@ -21,3 +21,4 @@ en:
21
21
  reddit: Reddit
22
22
  hacker_news: Hacker News
23
23
  telegram: Telegram
24
+ whatsapp: WhatsApp
@@ -21,3 +21,4 @@ es:
21
21
  reddit: Reddit
22
22
  hacker_news: Hacker News
23
23
  telegram: Telegram
24
+ whatsapp: WhatsApp
@@ -21,3 +21,4 @@ fr:
21
21
  reddit: Reddit
22
22
  hacker_news: Hacker News
23
23
  telegram: Telegram
24
+ whatsapp: WhatsApp
@@ -0,0 +1,24 @@
1
+ ja:
2
+ social_share_button:
3
+ share_to: "%{name}でシェアする"
4
+ weibo: Sina Weibo
5
+ twitter: Twitter
6
+ facebook: Facebook
7
+ douban: Douban
8
+ qq: Qzone
9
+ delicious: Delicious
10
+ google_plus: Google+
11
+ google_bookmark: Google Bookmark
12
+ tumblr: Tumblr
13
+ pinterest: Pinterest
14
+ email: Email
15
+ linkedin: Linkedin
16
+ wechat: WeChat
17
+ wechat_footer: WeChatを開き、「発見」ボタンをクリックし、「QRコードのスキャン」をクリックしてください。
18
+ vkontakte: Vkontakte
19
+ odnoklassniki: Odnoklassniki
20
+ xing: Xing
21
+ reddit: Reddit
22
+ hacker_news: Hacker News
23
+ telegram: Telegram
24
+ whatsapp: WhatsApp
@@ -0,0 +1,24 @@
1
+ en:
2
+ social_share_button:
3
+ share_to: Share to %{name}
4
+ weibo: Sina Weibo
5
+ twitter: Twitter
6
+ facebook: Facebook
7
+ douban: Douban
8
+ qq: Qzone
9
+ delicious: Delicious
10
+ google_plus: Google+
11
+ google_bookmark: Google Bookmark
12
+ tumblr: Tumblr
13
+ pinterest: Pinterest
14
+ email: Email
15
+ linkedin: Linkedin
16
+ wechat: WeChat
17
+ wechat_footer: Abra o seu WeChat, clique no botão "Discover/Descobrir" e então clique no menu "Scan QR Code".
18
+ vkontakte: Vkontakte
19
+ odnoklassniki: Odnoklassniki
20
+ xing: Xing
21
+ reddit: Reddit
22
+ hacker_news: Hacker News
23
+ telegram: Telegram
24
+ whatsapp: WhatsApp
@@ -21,3 +21,4 @@ ru:
21
21
  reddit: Reddit
22
22
  hacker_news: Hacker News
23
23
  telegram: Telegram
24
+ whatsapp: WhatsApp
@@ -21,3 +21,4 @@ uk:
21
21
  reddit: Reddit
22
22
  hacker_news: Hacker News
23
23
  telegram: Telegram
24
+ whatsapp: WhatsApp
@@ -21,3 +21,4 @@
21
21
  reddit: Reddit
22
22
  hacker_news: Hacker News
23
23
  telegram: Telegram
24
+ whatsapp: WhatsApp
@@ -21,3 +21,4 @@
21
21
  reddit: Reddit
22
22
  hacker_news: Hacker News
23
23
  telegram: Telegram
24
+ whatsapp: WhatsApp
@@ -1,5 +1,5 @@
1
1
  SocialShareButton.configure do |config|
2
2
  config.allow_sites = %w(twitter facebook google_plus weibo qq douban google_bookmark
3
3
  delicious tumblr pinterest email linkedin wechat vkontakte
4
- xing reddit hacker_news telegram odnoklassniki)
4
+ xing reddit hacker_news telegram odnoklassniki whatsapp_app whatsapp_web)
5
5
  end
@@ -28,6 +28,8 @@ module SocialShareButton
28
28
  # - reddit
29
29
  # - hacker_news
30
30
  # - telegram
31
+ # - whatsapp_app
32
+ # - whatsapp_web
31
33
  attr_accessor :allow_sites
32
34
 
33
35
  def initialize
@@ -1,3 +1,3 @@
1
1
  module SocialShareButton
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
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: 1.1.0
4
+ version: 1.2.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: 2017-11-29 00:00:00.000000000 Z
11
+ date: 2018-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -66,6 +66,7 @@ files:
66
66
  - app/assets/images/social-share-button/vkontakte.svg
67
67
  - app/assets/images/social-share-button/wechat.svg
68
68
  - app/assets/images/social-share-button/weibo.svg
69
+ - app/assets/images/social-share-button/whatsapp.svg
69
70
  - app/assets/images/social-share-button/xing.svg
70
71
  - app/assets/javascripts/jquery.qrcode.min.js
71
72
  - app/assets/javascripts/social-share-button.coffee
@@ -75,6 +76,8 @@ files:
75
76
  - config/locales/social_share_button.en.yml
76
77
  - config/locales/social_share_button.es.yml
77
78
  - config/locales/social_share_button.fr.yml
79
+ - config/locales/social_share_button.ja.yml
80
+ - config/locales/social_share_button.pt-BR.yml
78
81
  - config/locales/social_share_button.ru.yml
79
82
  - config/locales/social_share_button.uk.yml
80
83
  - config/locales/social_share_button.zh-CN.yml
@@ -107,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
107
110
  version: '0'
108
111
  requirements: []
109
112
  rubyforge_project:
110
- rubygems_version: 2.6.13
113
+ rubygems_version: 2.7.8
111
114
  signing_key:
112
115
  specification_version: 4
113
116
  summary: Helper for add social share feature in your Rails app. Twitter, Facebook,