rails-social-share-button 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +133 -0
  3. data/app/assets/images/rails-social-share-button/delicious.svg +13 -0
  4. data/app/assets/images/rails-social-share-button/douban.svg +8 -0
  5. data/app/assets/images/rails-social-share-button/email.svg +8 -0
  6. data/app/assets/images/rails-social-share-button/facebook.svg +8 -0
  7. data/app/assets/images/rails-social-share-button/google_bookmark.svg +8 -0
  8. data/app/assets/images/rails-social-share-button/hacker_news.svg +69 -0
  9. data/app/assets/images/rails-social-share-button/linkedin.svg +8 -0
  10. data/app/assets/images/rails-social-share-button/odnoklassniki.svg +1 -0
  11. data/app/assets/images/rails-social-share-button/pinterest.svg +8 -0
  12. data/app/assets/images/rails-social-share-button/qq.svg +8 -0
  13. data/app/assets/images/rails-social-share-button/reddit.svg +6 -0
  14. data/app/assets/images/rails-social-share-button/telegram.svg +12 -0
  15. data/app/assets/images/rails-social-share-button/tumblr.svg +8 -0
  16. data/app/assets/images/rails-social-share-button/twitter.svg +8 -0
  17. data/app/assets/images/rails-social-share-button/vkontakte.svg +23 -0
  18. data/app/assets/images/rails-social-share-button/wechat.svg +8 -0
  19. data/app/assets/images/rails-social-share-button/weibo.svg +10 -0
  20. data/app/assets/images/rails-social-share-button/whatsapp.svg +10 -0
  21. data/app/assets/images/rails-social-share-button/xing.svg +79 -0
  22. data/app/assets/javascripts/jquery.qrcode.min.js +28 -0
  23. data/app/assets/javascripts/rails-social-share-button.js +145 -0
  24. data/app/assets/javascripts/rails-social-share-button/wechat.js +50 -0
  25. data/app/assets/stylesheets/rails-social-share-button.css.erb +123 -0
  26. data/config/locales/rails_social_share_button.de.yml +23 -0
  27. data/config/locales/rails_social_share_button.en.yml +23 -0
  28. data/config/locales/rails_social_share_button.es.yml +23 -0
  29. data/config/locales/rails_social_share_button.fr.yml +23 -0
  30. data/config/locales/rails_social_share_button.ja.yml +23 -0
  31. data/config/locales/rails_social_share_button.pt-BR.yml +23 -0
  32. data/config/locales/rails_social_share_button.ru.yml +23 -0
  33. data/config/locales/rails_social_share_button.uk.yml +23 -0
  34. data/config/locales/rails_social_share_button.zh-CN.yml +23 -0
  35. data/config/locales/rails_social_share_button.zh-TW.yml +23 -0
  36. data/lib/generators/rails_social_share_button/install_generator.rb +12 -0
  37. data/lib/generators/rails_social_share_button/templates/config/initializers/rails_social_share_button.rb +5 -0
  38. data/lib/rails-social-share-button.rb +19 -0
  39. data/lib/rails_social_share_button/config.rb +36 -0
  40. data/lib/rails_social_share_button/engine.rb +6 -0
  41. data/lib/rails_social_share_button/helper.rb +29 -0
  42. data/lib/rails_social_share_button/railtie.rb +6 -0
  43. data/lib/rails_social_share_button/version.rb +1 -1
  44. metadata +46 -6
  45. data/lib/rails_social-share-button.rb +0 -9
@@ -0,0 +1,23 @@
1
+ ja:
2
+ rails_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_bookmark: Google Bookmark
11
+ tumblr: Tumblr
12
+ pinterest: Pinterest
13
+ email: Email
14
+ linkedin: Linkedin
15
+ wechat: WeChat
16
+ wechat_footer: WeChatを開き、「発見」ボタンをクリックし、「QRコードのスキャン」をクリックしてください。
17
+ vkontakte: Vkontakte
18
+ odnoklassniki: Odnoklassniki
19
+ xing: Xing
20
+ reddit: Reddit
21
+ hacker_news: Hacker News
22
+ telegram: Telegram
23
+ whatsapp: WhatsApp
@@ -0,0 +1,23 @@
1
+ en:
2
+ rails_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_bookmark: Google Bookmark
11
+ tumblr: Tumblr
12
+ pinterest: Pinterest
13
+ email: Email
14
+ linkedin: Linkedin
15
+ wechat: WeChat
16
+ wechat_footer: Abra o seu WeChat, clique no botão "Discover/Descobrir" e então clique no menu "Scan QR Code".
17
+ vkontakte: Vkontakte
18
+ odnoklassniki: Odnoklassniki
19
+ xing: Xing
20
+ reddit: Reddit
21
+ hacker_news: Hacker News
22
+ telegram: Telegram
23
+ whatsapp: WhatsApp
@@ -0,0 +1,23 @@
1
+ ru:
2
+ rails_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_bookmark: Google Bookmark
11
+ tumblr: Tumblr
12
+ pinterest: Pinterest
13
+ email: Email
14
+ linkedin: Linkedin
15
+ wechat: WeChat
16
+ wechat_footer: Откройте WeChat, нажмите кнопку "Discover", затем выберите "Scan QR Code".
17
+ vkontakte: Вконтакте
18
+ odnoklassniki: Однокласники
19
+ xing: Xing
20
+ reddit: Reddit
21
+ hacker_news: Hacker News
22
+ telegram: Telegram
23
+ whatsapp: WhatsApp
@@ -0,0 +1,23 @@
1
+ uk:
2
+ rails_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_bookmark: Google Bookmark
11
+ tumblr: Tumblr
12
+ pinterest: Pinterest
13
+ email: Email
14
+ linkedin: Linkedin
15
+ wechat: WeChat
16
+ wechat_footer: Відкрийте WeChat, натисніть кнопку "Discover", потім виберіть "Scan QR Code".
17
+ vkontakte: Вконтакте
18
+ odnoklassniki: Однокласники
19
+ xing: Xing
20
+ reddit: Reddit
21
+ hacker_news: Hacker News
22
+ telegram: Telegram
23
+ whatsapp: WhatsApp
@@ -0,0 +1,23 @@
1
+ 'zh-CN':
2
+ rails_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_bookmark: Google 收藏
11
+ tumblr: Tumblr
12
+ pinterest: Pinterest
13
+ email: Email
14
+ linkedin: Linkedin
15
+ wechat: 微信
16
+ wechat_footer: 打开微信,点击底部的 “发现”,<br/> 使用 “扫一扫” 即可将网页分享至朋友圈。
17
+ vkontakte: Vkontakte
18
+ odnoklassniki: Odnoklassniki
19
+ xing: Xing
20
+ reddit: Reddit
21
+ hacker_news: Hacker News
22
+ telegram: Telegram
23
+ whatsapp: WhatsApp
@@ -0,0 +1,23 @@
1
+ 'zh-TW':
2
+ rails_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_bookmark: Google 收藏
11
+ tumblr: Tumblr
12
+ pinterest: Pinterest
13
+ email: Email
14
+ linkedin: Linkedin
15
+ wechat: 微信
16
+ wechat_footer: 打開微信,點擊底部的 “發現”,<br/> 使用 “掃一掃” 即可將網頁分享至朋友圈。
17
+ vkontakte: Vkontakte
18
+ odnoklassniki: Odnoklassniki
19
+ xing: Xing
20
+ reddit: Reddit
21
+ hacker_news: Hacker News
22
+ telegram: Telegram
23
+ whatsapp: WhatsApp
@@ -0,0 +1,12 @@
1
+ module RailsSocialShareButton
2
+ module Generators
3
+ class InstallGenerator < ::Rails::Generators::Base
4
+ desc "Copy RailsSocialShareButton 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,5 @@
1
+ RailsSocialShareButton.configure do |config|
2
+ config.allow_sites = %w(facebook twitter google_bookmark pinterest telegram reddit tumblr
3
+ linkedin telegram whatsapp_app whatsapp_web hacker_news delicious
4
+ email vkontakte odnoklassniki xing wechat weibo qq douban)
5
+ end
@@ -0,0 +1,19 @@
1
+ require "rails_social_share_button/version"
2
+ require "rails_social_share_button/config"
3
+ require "rails_social_share_button/helper"
4
+
5
+ I18n.load_path += Dir.glob( File.dirname(__FILE__) + "lib/locales/*.{rb,yml}" )
6
+
7
+ module RailsSocialShareButton
8
+ module Rails
9
+ if ::Rails.version < "3.1"
10
+ require "rails_social_share_button/railtie"
11
+ else
12
+ require "rails_social_share_button/engine"
13
+ end
14
+ end
15
+ end
16
+
17
+ ActiveSupport.on_load(:action_view) do
18
+ include RailsSocialShareButton::Helper
19
+ end
@@ -0,0 +1,36 @@
1
+ module RailsSocialShareButton
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, site support:
11
+ # - twitter
12
+ # - facebook
13
+ # - weibo
14
+ # - qq
15
+ # - douban
16
+ # - google_bookmark
17
+ # - delicious
18
+ # - tumblr
19
+ # - pinterest
20
+ # - email
21
+ # - linkedin
22
+ # - wechat
23
+ # - vkontakte
24
+ # - odnoklassniki
25
+ # - Xing
26
+ # - reddit
27
+ # - hacker_news
28
+ # - telegram
29
+ # - whatsapp_app
30
+ # - whatsapp_web
31
+ attr_accessor :allow_sites
32
+
33
+ def initialize
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,6 @@
1
+ module RailsSocialShareButton
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,29 @@
1
+ module RailsSocialShareButton
2
+ module Helper
3
+ def rails_social_share_button_tag(title = "", opts = {})
4
+ opts[:allow_sites] ||= RailsSocialShareButton.config.allow_sites
5
+
6
+ extra_data = {}
7
+ rel = opts[:rel]
8
+ html = []
9
+ html << "<div class='rails-social-share-button' data-title='#{h title}' data-img='#{opts[:image]}'"
10
+ html << "data-url='#{opts[:url]}' data-desc='#{opts[:desc]}' data-via='#{opts[:via]}'>"
11
+
12
+ opts[:allow_sites].each do |name|
13
+ extra_data = opts.select { |k, _| k.to_s.start_with?('data') } if name.eql?('tumblr')
14
+ special_data = opts.select { |k, _| k.to_s.start_with?('data-' + name) }
15
+
16
+ special_data["data-wechat-footer"] = t "social_share_button.wechat_footer" if name == "wechat"
17
+
18
+ link_title = t "social_share_button.share_to", :name => t("social_share_button.#{name.downcase}")
19
+ html << link_to("", "#", { :rel => ["nofollow", rel],
20
+ "data-site" => name,
21
+ :class => "ssb-icon ssb-#{name}",
22
+ :onclick => "return RailsSocialShareButton.share(this);",
23
+ :title => h(link_title) }.merge(extra_data).merge(special_data))
24
+ end
25
+ html << "</div>"
26
+ raw html.join("\n")
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,6 @@
1
+ module RailsSocialShareButton
2
+ module Rails
3
+ class Railtie < ::Rails::Railtie
4
+ end
5
+ end
6
+ end
@@ -1,3 +1,3 @@
1
1
  module RailsSocialShareButton
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-social-share-button
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bunlong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-26 00:00:00.000000000 Z
11
+ date: 2019-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -53,8 +53,8 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  description: rails-social-share-button is one of the best rails helper gem​ to add
56
- social share buttons in your Rails app. Include Twitter, Facebook, Weibo, Douban,
57
- QQ, Tumblr...
56
+ social share feature in your Rails app. Such as Twitter, Facebook, Tumblr, Weibo,
57
+ Douban, QQ...
58
58
  email:
59
59
  - bunlong.van@gmail.com
60
60
  executables: []
@@ -63,7 +63,46 @@ extra_rdoc_files: []
63
63
  files:
64
64
  - CHANGELOG.md
65
65
  - README.md
66
- - lib/rails_social-share-button.rb
66
+ - app/assets/images/rails-social-share-button/delicious.svg
67
+ - app/assets/images/rails-social-share-button/douban.svg
68
+ - app/assets/images/rails-social-share-button/email.svg
69
+ - app/assets/images/rails-social-share-button/facebook.svg
70
+ - app/assets/images/rails-social-share-button/google_bookmark.svg
71
+ - app/assets/images/rails-social-share-button/hacker_news.svg
72
+ - app/assets/images/rails-social-share-button/linkedin.svg
73
+ - app/assets/images/rails-social-share-button/odnoklassniki.svg
74
+ - app/assets/images/rails-social-share-button/pinterest.svg
75
+ - app/assets/images/rails-social-share-button/qq.svg
76
+ - app/assets/images/rails-social-share-button/reddit.svg
77
+ - app/assets/images/rails-social-share-button/telegram.svg
78
+ - app/assets/images/rails-social-share-button/tumblr.svg
79
+ - app/assets/images/rails-social-share-button/twitter.svg
80
+ - app/assets/images/rails-social-share-button/vkontakte.svg
81
+ - app/assets/images/rails-social-share-button/wechat.svg
82
+ - app/assets/images/rails-social-share-button/weibo.svg
83
+ - app/assets/images/rails-social-share-button/whatsapp.svg
84
+ - app/assets/images/rails-social-share-button/xing.svg
85
+ - app/assets/javascripts/jquery.qrcode.min.js
86
+ - app/assets/javascripts/rails-social-share-button.js
87
+ - app/assets/javascripts/rails-social-share-button/wechat.js
88
+ - app/assets/stylesheets/rails-social-share-button.css.erb
89
+ - config/locales/rails_social_share_button.de.yml
90
+ - config/locales/rails_social_share_button.en.yml
91
+ - config/locales/rails_social_share_button.es.yml
92
+ - config/locales/rails_social_share_button.fr.yml
93
+ - config/locales/rails_social_share_button.ja.yml
94
+ - config/locales/rails_social_share_button.pt-BR.yml
95
+ - config/locales/rails_social_share_button.ru.yml
96
+ - config/locales/rails_social_share_button.uk.yml
97
+ - config/locales/rails_social_share_button.zh-CN.yml
98
+ - config/locales/rails_social_share_button.zh-TW.yml
99
+ - lib/generators/rails_social_share_button/install_generator.rb
100
+ - lib/generators/rails_social_share_button/templates/config/initializers/rails_social_share_button.rb
101
+ - lib/rails-social-share-button.rb
102
+ - lib/rails_social_share_button/config.rb
103
+ - lib/rails_social_share_button/engine.rb
104
+ - lib/rails_social_share_button/helper.rb
105
+ - lib/rails_social_share_button/railtie.rb
67
106
  - lib/rails_social_share_button/version.rb
68
107
  homepage: https://github.com/Bunlong/rails-social-share-button
69
108
  licenses:
@@ -88,5 +127,6 @@ rubygems_version: 3.0.1
88
127
  signing_key:
89
128
  specification_version: 4
90
129
  summary: rails-social-share-button is one of the best rails helper gem​ to add social
91
- share buttons in your Rails app. Include Twitter, Facebook, Weibo, Douban, QQ, Tumblr...
130
+ share feature in your Rails app. Such as Twitter, Facebook, Tumblr, Weibo, Douban,
131
+ QQ...
92
132
  test_files: []
@@ -1,9 +0,0 @@
1
- require "rails_social_share_button/version"
2
-
3
- module RailsSocialShareButton
4
- class ToDo
5
- def self.work_in_progress?
6
- puts "Work in progress!!"
7
- end
8
- end
9
- end