Skip to content

Commit

Permalink
Merge branch 'master' of github.com:huacnlee/social-share-button
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Oct 5, 2016
2 parents e73cc0f + 6077bef commit 8951520
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This is a gem to helper you quick create a share feature in you Rails apps.
* Vkontakte
* Xing
* Reddit
* Hacker News (Y Combinator)

## Screenshot

Expand Down
69 changes: 69 additions & 0 deletions app/assets/images/social-share-button/hacker_news.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions app/assets/javascripts/social-share-button.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,6 @@ window.SocialShareButton =

when "reddit"
SocialShareButton.openUrl("http://www.reddit.com/submit?url=#{url}&newwindow=1", 555, 400)
when "hacker_news"
SocialShareButton.openUrl("http://news.ycombinator.com/submitlink?u=#{url}&t=#{title}", 770, 500)
false
3 changes: 2 additions & 1 deletion app/assets/stylesheets/social-share-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ $size: 18px;
}

@each $site in twitter, facebook, google_bookmark, google_plus, weibo, qq,
delicious, linkedin, tumblr, pinterest, douban, wechat, vkontakte, xing, email, reddit {
delicious, linkedin, tumblr, pinterest, douban, wechat, vkontakte,
xing, email, reddit, hacker_news {
.ssb-#{$site} {
background-image: image-url('social-share-button/#{$site}.svg');
}
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 wechat vkontakte xing)
config.allow_sites = %w(twitter facebook google_plus weibo qq douban google_bookmark delicious tumblr pinterest email linkedin wechat vkontakte xing reddit hacker_news)
end
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ en:
vkontakte: Vkontakte
xing: Xing
reddit: Reddit
hacker_news: Hacker News
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ fr:
vkontakte: Vkontakte
xing: Xing
reddit: Reddit
hacker_news: Hacker News
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
vkontakte: Vkontakte
xing: Xing
reddit: Reddit
hacker_news: Hacker News
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
vkontakte: Vkontakte
xing: Xing
reddit: Reddit
hacker_news: Hacker News
2 changes: 2 additions & 0 deletions lib/social_share_button/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class Config
# - linkedin
# - wechat
# - vkontakte
# - Xing
# - reddit
# - hacker_news
attr_accessor :allow_sites

def initialize
Expand Down

0 comments on commit 8951520

Please sign in to comment.