social_share 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +19 -3
- data/app/assets/stylesheets/social_share/index.css.erb +30 -9
- data/lib/social_share/helper.rb +4 -4
- data/lib/social_share/version.rb +1 -1
- data/social_share.gemspec +2 -1
- metadata +5 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 770d97fd46f0866c2dfc09abb69ce635fa5fa785
|
4
|
+
data.tar.gz: 00be652ef19e285d2743b7f08370f808b97595e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 429a758ec7fd91a251183e0cddf3f27820386d38fd879fff540fc9560f6f851b1a671398177eb4ea8d12aaf8f0741488758cc4b7dec09ded564366f48cb980b8
|
7
|
+
data.tar.gz: bdc6f3baaf50789a13cf429e3e96ef4aff68e2ce686b482348e829a8918cb6e9ecc46cf35c7338cfdf6686718027be4a374eb80e605c007763b4b78398582f62
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# SocialShare
|
2
2
|
|
3
|
-
|
3
|
+
Easy helper methods for adding custom social share buttons (Facebook, Twitter, and Google+) to your Rails app.
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -20,11 +20,27 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
|
23
|
+
**in application.js**
|
24
|
+
|
25
|
+
```javascript
|
26
|
+
//= require 'social_share'
|
27
|
+
```
|
28
|
+
|
29
|
+
**in application.css**
|
30
|
+
|
31
|
+
```css
|
32
|
+
*= require social_share
|
33
|
+
```
|
34
|
+
|
35
|
+
The `social_share` method takes a title, a url, and an optional services argument (defaults to Facebook and Twitter).
|
36
|
+
|
37
|
+
```ruby
|
38
|
+
<%= social_share(@video.title, video_path(@video), [:facebook, :twitter, :google_plus]) %>
|
39
|
+
```
|
24
40
|
|
25
41
|
## Contributing
|
26
42
|
|
27
|
-
1. Fork it ( https://github.com/
|
43
|
+
1. Fork it ( https://github.com/ldewald/social_share/fork )
|
28
44
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
45
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
46
|
4. Push to the branch (`git push origin my-new-feature`)
|
@@ -1,35 +1,56 @@
|
|
1
1
|
.social-share a {
|
2
2
|
background-color: gray;
|
3
3
|
border-radius: 2px;
|
4
|
-
color:
|
4
|
+
color: #FFF;
|
5
5
|
display: inline-block;
|
6
|
-
font-size:
|
7
|
-
height:
|
8
|
-
line-height:
|
6
|
+
font-size: 21px;
|
7
|
+
height: 32px;
|
8
|
+
line-height: 32px;
|
9
9
|
text-align: center;
|
10
|
-
width:
|
10
|
+
width: 32px;
|
11
|
+
}
|
12
|
+
|
13
|
+
.social-share a:hover, .social-share a:active, .social-share a:visited, .social-share a:focus {
|
14
|
+
color: #FFF;
|
15
|
+
text-decoration: none;
|
11
16
|
}
|
12
17
|
|
13
18
|
.social-share a:not(:last-child) {
|
14
19
|
margin-right: 5px;
|
15
20
|
}
|
16
21
|
|
17
|
-
.social-share a.facebook-share-button {
|
22
|
+
.social-share a.ss-facebook-share-button {
|
18
23
|
background: #3B5999;
|
19
24
|
}
|
20
25
|
|
21
|
-
.social-share a.
|
26
|
+
.social-share a.ss-facebook-share-button:hover {
|
27
|
+
background: #224080;
|
28
|
+
}
|
29
|
+
|
30
|
+
.social-share a.ss-twitter-share-button {
|
22
31
|
background: #55ACEE;
|
23
32
|
}
|
24
33
|
|
25
|
-
.social-share a.
|
34
|
+
.social-share a.ss-twitter-share-button:hover {
|
35
|
+
background: #3C93D5;
|
36
|
+
}
|
37
|
+
|
38
|
+
.social-share a.ss-google-plus-share-button {
|
26
39
|
background: #DD4B39;
|
27
40
|
}
|
28
41
|
|
29
|
-
.social-share a.
|
42
|
+
.social-share a.ss-google-plus-share-button:hover {
|
43
|
+
background: #C43220;
|
44
|
+
}
|
45
|
+
|
46
|
+
.social-share a.ss-pinterest-share-button {
|
30
47
|
background: #C92228;
|
31
48
|
}
|
32
49
|
|
50
|
+
.social-share a.ss-pinterest-share-button:hover {
|
51
|
+
background: #B0090F;
|
52
|
+
}
|
53
|
+
|
33
54
|
/* FONTS */
|
34
55
|
|
35
56
|
@font-face {
|
data/lib/social_share/helper.rb
CHANGED
@@ -8,19 +8,19 @@ module SocialShare
|
|
8
8
|
end
|
9
9
|
|
10
10
|
def facebook_share(title, url)
|
11
|
-
link_to(tag(:span, class: 'ss-icon-facebook'), "http://www.facebook.com/sharer/sharer.php?u=#{url}&title=#{title}", class: 'facebook-share-button', title: 'Share to Facebook')
|
11
|
+
link_to(tag(:span, class: 'ss-icon-facebook'), "http://www.facebook.com/sharer/sharer.php?u=#{url}&title=#{title}", class: 'ss-facebook-share-button', title: 'Share to Facebook')
|
12
12
|
end
|
13
13
|
|
14
14
|
def twitter_share(title, url)
|
15
|
-
link_to(tag(:span, class: 'ss-icon-twitter'), "http://twitter.com/share?text=#{title}", class: 'twitter-share-button', title: 'Share to Twitter')
|
15
|
+
link_to(tag(:span, class: 'ss-icon-twitter'), "http://twitter.com/share?text=#{title}", class: 'ss-twitter-share-button', title: 'Share to Twitter')
|
16
16
|
end
|
17
17
|
|
18
18
|
def pinterest_share(title, url)
|
19
|
-
link_to(tag(:span, class: 'ss-icon-pinterest'), "http://pinterest.com/pin/create/button/?url=#{url}&description=#{title}", class: 'pinterest-share-button', title: 'Share to Pinterest')
|
19
|
+
link_to(tag(:span, class: 'ss-icon-pinterest'), "http://pinterest.com/pin/create/button/?url=#{url}&description=#{title}", class: 'ss-pinterest-share-button', title: 'Share to Pinterest')
|
20
20
|
end
|
21
21
|
|
22
22
|
def google_plus_share(title, url)
|
23
|
-
link_to(tag(:span, class: 'ss-icon-google-plus'), "http://plus.google.com/share?url=#{url}", class: 'google-plus-share-button', title: 'Share to Google Plus')
|
23
|
+
link_to(tag(:span, class: 'ss-icon-google-plus'), "http://plus.google.com/share?url=#{url}", class: 'ss-google-plus-share-button', title: 'Share to Google Plus')
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
data/lib/social_share/version.rb
CHANGED
data/social_share.gemspec
CHANGED
@@ -9,6 +9,8 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.authors = ['ldewald']
|
10
10
|
spec.email = ['laurardewald@gmail.com']
|
11
11
|
spec.summary = %q{Easy helper methods for adding custom social share buttons to your Rails app.}
|
12
|
+
spec.description = %q{Easy helper methods for adding custom social share buttons (Facebook, Twitter, Google+) to your Rails app.}
|
13
|
+
spec.homepage = 'https://github.com/ldewald/social_share'
|
12
14
|
spec.license = 'MIT'
|
13
15
|
|
14
16
|
spec.files = `git ls-files -z`.split("\x0")
|
@@ -18,5 +20,4 @@ Gem::Specification.new do |spec|
|
|
18
20
|
|
19
21
|
spec.add_development_dependency 'bundler', '~> 1.7'
|
20
22
|
spec.add_development_dependency 'rake', '~> 10.0'
|
21
|
-
spec.add_development_dependency 'rspec', '~> 10.0'
|
22
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_share
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ldewald
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,21 +38,8 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
|
-
|
42
|
-
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - "~>"
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '10.0'
|
48
|
-
type: :development
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - "~>"
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '10.0'
|
55
|
-
description:
|
41
|
+
description: Easy helper methods for adding custom social share buttons (Facebook,
|
42
|
+
Twitter, Google+) to your Rails app.
|
56
43
|
email:
|
57
44
|
- laurardewald@gmail.com
|
58
45
|
executables: []
|
@@ -74,7 +61,7 @@ files:
|
|
74
61
|
- lib/social_share/helper.rb
|
75
62
|
- lib/social_share/version.rb
|
76
63
|
- social_share.gemspec
|
77
|
-
homepage:
|
64
|
+
homepage: https://github.com/ldewald/social_share
|
78
65
|
licenses:
|
79
66
|
- MIT
|
80
67
|
metadata: {}
|