social-share-button-srules 0.1.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 +7 -0
- data/CHANGELOG.md +204 -0
- data/README.md +182 -0
- data/app/assets/images/social-share-button/delicious.svg +13 -0
- data/app/assets/images/social-share-button/douban.svg +8 -0
- data/app/assets/images/social-share-button/email.svg +8 -0
- data/app/assets/images/social-share-button/facebook.svg +8 -0
- data/app/assets/images/social-share-button/google_bookmark.svg +8 -0
- data/app/assets/images/social-share-button/google_plus.svg +10 -0
- data/app/assets/images/social-share-button/hacker_news.svg +69 -0
- data/app/assets/images/social-share-button/linkedin.svg +8 -0
- data/app/assets/images/social-share-button/odnoklassniki.svg +1 -0
- data/app/assets/images/social-share-button/pinterest.svg +8 -0
- data/app/assets/images/social-share-button/qq.svg +8 -0
- data/app/assets/images/social-share-button/reddit.svg +6 -0
- data/app/assets/images/social-share-button/telegram.svg +12 -0
- data/app/assets/images/social-share-button/tumblr.svg +8 -0
- data/app/assets/images/social-share-button/twitter.svg +8 -0
- data/app/assets/images/social-share-button/vkontakte.svg +23 -0
- data/app/assets/images/social-share-button/wechat.svg +8 -0
- data/app/assets/images/social-share-button/weibo.svg +10 -0
- data/app/assets/images/social-share-button/whatsapp.svg +10 -0
- data/app/assets/images/social-share-button/xing.svg +79 -0
- data/app/assets/javascripts/jquery.qrcode.min.js +28 -0
- data/app/assets/javascripts/social-share-button.coffee +110 -0
- data/app/assets/javascripts/social-share-button/wechat.coffee +44 -0
- data/app/assets/stylesheets/social-share-button.css.erb +127 -0
- data/config/locales/social_share_button.de.yml +24 -0
- data/config/locales/social_share_button.en.yml +24 -0
- data/config/locales/social_share_button.es.yml +24 -0
- data/config/locales/social_share_button.fr.yml +24 -0
- data/config/locales/social_share_button.ja.yml +24 -0
- data/config/locales/social_share_button.pt-BR.yml +24 -0
- data/config/locales/social_share_button.ru.yml +24 -0
- data/config/locales/social_share_button.uk.yml +24 -0
- data/config/locales/social_share_button.zh-CN.yml +24 -0
- data/config/locales/social_share_button.zh-TW.yml +24 -0
- data/lib/generators/social_share_button/install_generator.rb +12 -0
- data/lib/generators/social_share_button/templates/config/initializers/social_share_button.rb +5 -0
- data/lib/social-share-button.rb +19 -0
- data/lib/social_share_button/config.rb +38 -0
- data/lib/social_share_button/engine.rb +6 -0
- data/lib/social_share_button/helper.rb +29 -0
- data/lib/social_share_button/railtie.rb +6 -0
- data/lib/social_share_button/version.rb +3 -0
- metadata +118 -0
@@ -0,0 +1,127 @@
|
|
1
|
+
.social-share-button .ssb-icon {
|
2
|
+
background-position: center center;
|
3
|
+
background-repeat: no-repeat;
|
4
|
+
background-size: 18px 18px;
|
5
|
+
display: inline-block;
|
6
|
+
height: 18px;
|
7
|
+
width: 18px;
|
8
|
+
}
|
9
|
+
|
10
|
+
.social-share-button .ssb-twitter {
|
11
|
+
background-image: url(<%= asset_path('social-share-button/twitter.svg') %>);
|
12
|
+
}
|
13
|
+
|
14
|
+
.social-share-button .ssb-facebook {
|
15
|
+
background-image: url(<%= asset_path('social-share-button/facebook.svg') %>);
|
16
|
+
}
|
17
|
+
|
18
|
+
.social-share-button .ssb-google_bookmark {
|
19
|
+
background-image: url(<%= asset_path('social-share-button/google_bookmark.svg') %>);
|
20
|
+
}
|
21
|
+
|
22
|
+
.social-share-button .ssb-google_plus {
|
23
|
+
background-image: url(<%= asset_path('social-share-button/google_plus.svg') %>);
|
24
|
+
}
|
25
|
+
|
26
|
+
.social-share-button .ssb-weibo {
|
27
|
+
background-image: url(<%= asset_path('social-share-button/weibo.svg') %>);
|
28
|
+
}
|
29
|
+
|
30
|
+
.social-share-button .ssb-qq {
|
31
|
+
background-image: url(<%= asset_path('social-share-button/qq.svg') %>);
|
32
|
+
}
|
33
|
+
|
34
|
+
.social-share-button .ssb-delicious {
|
35
|
+
background-image: url(<%= asset_path('social-share-button/delicious.svg') %>);
|
36
|
+
}
|
37
|
+
|
38
|
+
.social-share-button .ssb-linkedin {
|
39
|
+
background-image: url(<%= asset_path('social-share-button/linkedin.svg') %>);
|
40
|
+
}
|
41
|
+
|
42
|
+
.social-share-button .ssb-tumblr {
|
43
|
+
background-image: url(<%= asset_path('social-share-button/tumblr.svg') %>);
|
44
|
+
}
|
45
|
+
|
46
|
+
.social-share-button .ssb-pinterest {
|
47
|
+
background-image: url(<%= asset_path('social-share-button/pinterest.svg') %>);
|
48
|
+
}
|
49
|
+
|
50
|
+
.social-share-button .ssb-douban {
|
51
|
+
background-image: url(<%= asset_path('social-share-button/douban.svg') %>);
|
52
|
+
}
|
53
|
+
|
54
|
+
.social-share-button .ssb-wechat {
|
55
|
+
background-image: url(<%= asset_path('social-share-button/wechat.svg') %>);
|
56
|
+
}
|
57
|
+
|
58
|
+
.social-share-button .ssb-vkontakte {
|
59
|
+
background-image: url(<%= asset_path('social-share-button/vkontakte.svg') %>);
|
60
|
+
}
|
61
|
+
|
62
|
+
.social-share-button .ssb-odnoklassniki {
|
63
|
+
background-image: url(<%= asset_path('social-share-button/odnoklassniki.svg') %>);
|
64
|
+
}
|
65
|
+
|
66
|
+
.social-share-button .ssb-xing {
|
67
|
+
background-image: url(<%= asset_path('social-share-button/xing.svg') %>);
|
68
|
+
}
|
69
|
+
|
70
|
+
.social-share-button .ssb-email {
|
71
|
+
background-image: url(<%= asset_path('social-share-button/email.svg') %>);
|
72
|
+
}
|
73
|
+
|
74
|
+
.social-share-button .ssb-reddit {
|
75
|
+
background-image: url(<%= asset_path('social-share-button/reddit.svg') %>);
|
76
|
+
}
|
77
|
+
|
78
|
+
.social-share-button .ssb-hacker_news {
|
79
|
+
background-image: url(<%= asset_path('social-share-button/hacker_news.svg') %>);
|
80
|
+
}
|
81
|
+
|
82
|
+
.social-share-button .ssb-telegram {
|
83
|
+
background-image: url(<%= asset_path('social-share-button/telegram.svg') %>);
|
84
|
+
}
|
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
|
+
|
91
|
+
.ss-wechat-dialog {
|
92
|
+
width: 300px;
|
93
|
+
position: fixed;
|
94
|
+
background: #fff;
|
95
|
+
padding: 15px;
|
96
|
+
border-radius: 3px;
|
97
|
+
box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
|
98
|
+
z-index: 11001;
|
99
|
+
font-size: 14px;
|
100
|
+
line-height: 1.2em;
|
101
|
+
}
|
102
|
+
|
103
|
+
.ss-wechat-dialog .wechat-popup-header {
|
104
|
+
font-weight: bold;
|
105
|
+
}
|
106
|
+
|
107
|
+
.ss-wechat-dialog .wechat-dialog-qr {
|
108
|
+
text-align: center;
|
109
|
+
margin: 25px 0;
|
110
|
+
}
|
111
|
+
|
112
|
+
.ss-wechat-dialog .wechat-popup-close {
|
113
|
+
width: 16px;
|
114
|
+
height: 16px;
|
115
|
+
position: absolute;
|
116
|
+
right: 10px;
|
117
|
+
top: 10px;
|
118
|
+
color: #999;
|
119
|
+
text-decoration: none;
|
120
|
+
font-size: 16px;
|
121
|
+
}
|
122
|
+
|
123
|
+
.ss-wechat-dialog .wechat-popup-footer {
|
124
|
+
text-align: left;
|
125
|
+
line-height: 22px;
|
126
|
+
color: #666;
|
127
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
de:
|
2
|
+
social_share_button:
|
3
|
+
share_to: Teilen via %{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: Öffnen Sie Ihr WeChat, tippen auf "Discover" und dann im "Scan QR Code" Menü.
|
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: Open your WeChat, click "Discover" button then click the "Scan QR Code" menu.
|
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
|
+
es:
|
2
|
+
social_share_button:
|
3
|
+
share_to: Compartir vía %{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: Correo electrónico
|
15
|
+
linkedin: Linkedin
|
16
|
+
wechat: WeChat
|
17
|
+
wechat_footer: Abra su WeChat, haga clic en el botón "Descubrir" y luego haga clic en el menú "Escanear código 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
|
+
fr:
|
2
|
+
social_share_button:
|
3
|
+
share_to: Partager sur %{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: Open your WeChat, click "Discover" button then click the "Scan QR Code" menu.
|
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
|
+
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
|
@@ -0,0 +1,24 @@
|
|
1
|
+
ru:
|
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, нажмите кнопку "Discover", затем выберите "Scan QR Code".
|
18
|
+
vkontakte: Вконтакте
|
19
|
+
odnoklassniki: Однокласники
|
20
|
+
xing: Xing
|
21
|
+
reddit: Reddit
|
22
|
+
hacker_news: Hacker News
|
23
|
+
telegram: Telegram
|
24
|
+
whatsapp: WhatsApp
|
@@ -0,0 +1,24 @@
|
|
1
|
+
uk:
|
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, натисніть кнопку "Discover", потім виберіть "Scan QR Code".
|
18
|
+
vkontakte: Вконтакте
|
19
|
+
odnoklassniki: Однокласники
|
20
|
+
xing: Xing
|
21
|
+
reddit: Reddit
|
22
|
+
hacker_news: Hacker News
|
23
|
+
telegram: Telegram
|
24
|
+
whatsapp: WhatsApp
|
@@ -0,0 +1,24 @@
|
|
1
|
+
'zh-CN':
|
2
|
+
social_share_button:
|
3
|
+
share_to: 分享到 %{name}
|
4
|
+
weibo: 新浪微博
|
5
|
+
twitter: Twitter
|
6
|
+
facebook: Facebook
|
7
|
+
douban: 豆瓣
|
8
|
+
qq: QQ 空间
|
9
|
+
delicious: Delicious
|
10
|
+
google_plus: Google+
|
11
|
+
google_bookmark: Google 收藏
|
12
|
+
tumblr: Tumblr
|
13
|
+
pinterest: Pinterest
|
14
|
+
email: Email
|
15
|
+
linkedin: Linkedin
|
16
|
+
wechat: 微信
|
17
|
+
wechat_footer: 打开微信,点击底部的 “发现”,<br/> 使用 “扫一扫” 即可将网页分享至朋友圈。
|
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
|
+
'zh-TW':
|
2
|
+
social_share_button:
|
3
|
+
share_to: 分享到 %{name}
|
4
|
+
weibo: 新浪微博
|
5
|
+
twitter: Twitter
|
6
|
+
facebook: Facebook
|
7
|
+
douban: 豆瓣
|
8
|
+
qq: QQ 空間
|
9
|
+
delicious: Delicious
|
10
|
+
google_plus: Google+
|
11
|
+
google_bookmark: Google 收藏
|
12
|
+
tumblr: Tumblr
|
13
|
+
pinterest: Pinterest
|
14
|
+
email: Email
|
15
|
+
linkedin: Linkedin
|
16
|
+
wechat: 微信
|
17
|
+
wechat_footer: 打開微信,點擊底部的 “發現”,<br/> 使用 “掃一掃” 即可將網頁分享至朋友圈。
|
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,12 @@
|
|
1
|
+
module SocialShareButton
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < ::Rails::Generators::Base
|
4
|
+
desc "Copy SocialShareButton default files"
|
5
|
+
source_root File.expand_path('../templates', __FILE__)
|
6
|
+
|
7
|
+
def copy_config
|
8
|
+
directory 'config'
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require "social_share_button/version"
|
2
|
+
require "social_share_button/config"
|
3
|
+
require "social_share_button/helper"
|
4
|
+
|
5
|
+
I18n.load_path += Dir.glob( File.dirname(__FILE__) + "lib/locales/*.{rb,yml}" )
|
6
|
+
|
7
|
+
module SocialShareButton
|
8
|
+
module Rails
|
9
|
+
if ::Rails.version < "3.1"
|
10
|
+
require "social_share_button/railtie"
|
11
|
+
else
|
12
|
+
require "social_share_button/engine"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
ActiveSupport.on_load(:action_view) do
|
18
|
+
include SocialShareButton::Helper
|
19
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
module SocialShareButton
|
2
|
+
class << self
|
3
|
+
attr_accessor :config
|
4
|
+
def configure
|
5
|
+
yield self.config ||= Config.new
|
6
|
+
end
|
7
|
+
end
|
8
|
+
|
9
|
+
class Config
|
10
|
+
# enable social sites to share,
|
11
|
+
# * site support:
|
12
|
+
# - twitter
|
13
|
+
# - facebook
|
14
|
+
# - google_plus
|
15
|
+
# - weibo
|
16
|
+
# - qq
|
17
|
+
# - douban
|
18
|
+
# - google_bookmark
|
19
|
+
# - delicious
|
20
|
+
# - tumblr
|
21
|
+
# - pinterest
|
22
|
+
# - email
|
23
|
+
# - linkedin
|
24
|
+
# - wechat
|
25
|
+
# - vkontakte
|
26
|
+
# - odnoklassniki
|
27
|
+
# - Xing
|
28
|
+
# - reddit
|
29
|
+
# - hacker_news
|
30
|
+
# - telegram
|
31
|
+
# - whatsapp_app
|
32
|
+
# - whatsapp_web
|
33
|
+
attr_accessor :allow_sites
|
34
|
+
|
35
|
+
def initialize
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|