-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f6b87e
commit fcf0ceb
Showing
15 changed files
with
209 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ pkg | |
# | ||
# For MacOS: | ||
# | ||
#.DS_Store | ||
.DS_Store | ||
|
||
# For TextMate | ||
#*.tmproj | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,8 @@ | ||
source "http://rubygems.org" | ||
# Add dependencies required to use your gem here. | ||
# Example: | ||
# gem "activesupport", ">= 2.3.5" | ||
|
||
# Add dependencies to develop your gem here. | ||
# Include everything needed to run rake, tests, features, etc. | ||
group :development do | ||
gem "rspec", "~> 2.8.0" | ||
gem "rdoc", "~> 3.12" | ||
gem "bundler", "~> 1.0.0" | ||
gem "jeweler", "~> 1.8.4" | ||
gem "rcov", ">= 0" | ||
gem "rspec", ">= 2.8.0" | ||
gem "rdoc", ">= 3.12" | ||
gem "bundler","> 1.0.0" | ||
gem "jeweler",">= 1.8.4" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
diff-lcs (1.1.3) | ||
git (1.2.5) | ||
jeweler (1.8.4) | ||
bundler (~> 1.0) | ||
git (>= 1.2.5) | ||
rake | ||
rdoc | ||
json (1.7.5) | ||
rake (0.9.2.2) | ||
rdoc (3.12) | ||
json (~> 1.4) | ||
rspec (2.11.0) | ||
rspec-core (~> 2.11.0) | ||
rspec-expectations (~> 2.11.0) | ||
rspec-mocks (~> 2.11.0) | ||
rspec-core (2.11.1) | ||
rspec-expectations (2.11.3) | ||
diff-lcs (~> 1.1.3) | ||
rspec-mocks (2.11.2) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
bundler (> 1.0.0) | ||
jeweler (>= 1.8.4) | ||
rdoc (>= 3.12) | ||
rspec (>= 2.8.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.0.0 | ||
0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module CssStarRatings | ||
module Rails | ||
class Engine < ::Rails::Engine | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<fieldset class="rating"> | ||
<legend>Please rate:</legend> | ||
<input type="radio" id="star5" name="rating" value="5" /><label for="star5" title="Rocks!">5 stars</label> | ||
<input type="radio" id="star4" name="rating" value="4" /><label for="star4" title="Pretty good">4 stars</label> | ||
<input type="radio" id="star3" name="rating" value="3" /><label for="star3" title="Meh">3 stars</label> | ||
<input type="radio" id="star2" name="rating" value="2" /><label for="star2" title="Kinda bad">2 stars</label> | ||
<input type="radio" id="star1" name="rating" value="1" /><label for="star1" title="Sucks big time">1 star</label> | ||
</fieldset> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="rating"> | ||
<a href="#">●</a> | ||
<a href="#">●</a> | ||
<a href="#">●</a> | ||
<a href="#">●</a> | ||
<a href="#">●</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div class="rating"> | ||
<input name="myrating" type="radio" value="5"><span>☆</span> | ||
<input name="myrating" type="radio" value="4"><span>☆</span> | ||
<input name="myrating" type="radio" value="3"><span>☆</span> | ||
<input name="myrating" type="radio" value="2"><span>☆</span> | ||
<input name="myrating" type="radio" value="1"><span>☆</span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,5 @@ | ||
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) | ||
$LOAD_PATH.unshift(File.dirname(__FILE__)) | ||
require 'rspec' | ||
require 'css-star-ratings' | ||
|
||
# Requires supporting files with custom matchers and macros, etc, | ||
# in ./support/ and its subdirectories. | ||
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} | ||
|
||
RSpec.configure do |config| | ||
|
||
RSpec.configure do |config| | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
.rating { | ||
float:left; | ||
} | ||
|
||
/* :not(:checked) is a filter, so that browsers that don’t support :checked don’t | ||
follow these rules. Every browser that supports :checked also supports :not(), so | ||
it doesn’t make the test unnecessarily selective */ | ||
.rating:not(:checked) > input { | ||
position:absolute; | ||
top:-9999px; | ||
clip:rect(0,0,0,0); | ||
} | ||
|
||
.rating:not(:checked) > label { | ||
float:right; | ||
width:1em; | ||
padding:0 .1em; | ||
overflow:hidden; | ||
white-space:nowrap; | ||
cursor:pointer; | ||
font-size:200%; | ||
line-height:1.2; | ||
color:#ddd; | ||
text-shadow:1px 1px #bbb, 2px 2px #666, .1em .1em .2em rgba(0,0,0,.5); | ||
} | ||
|
||
.rating:not(:checked) > label:before { | ||
content: '★ '; | ||
} | ||
|
||
.rating > input:checked ~ label { | ||
color: #f70; | ||
text-shadow:1px 1px #c60, 2px 2px #940, .1em .1em .2em rgba(0,0,0,.5); | ||
} | ||
|
||
.rating:not(:checked) > label:hover, | ||
.rating:not(:checked) > label:hover ~ label { | ||
color: gold; | ||
text-shadow:1px 1px goldenrod, 2px 2px #B57340, .1em .1em .2em rgba(0,0,0,.5); | ||
} | ||
|
||
.rating > input:checked + label:hover, | ||
.rating > input:checked + label:hover ~ label, | ||
.rating > input:checked ~ label:hover, | ||
.rating > input:checked ~ label:hover ~ label, | ||
.rating > label:hover ~ input:checked ~ label { | ||
color: #ea0; | ||
text-shadow:1px 1px goldenrod, 2px 2px #B57340, .1em .1em .2em rgba(0,0,0,.5); | ||
} | ||
|
||
.rating > label:active { | ||
position:relative; | ||
top:2px; | ||
left:2px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
Ratings Stars | ||
(with as little code as possible) | ||
*/ | ||
.rating { | ||
direction: rtl; | ||
text-align: center; | ||
} | ||
|
||
.rating a { | ||
display: inline-block; | ||
position: relative; | ||
font-size: 1.5em; | ||
width: 1.1em; | ||
text-decoration: none; | ||
color: grey; | ||
} | ||
.rating a:hover, | ||
.rating a:hover ~ a { | ||
color: transparent; | ||
} | ||
.rating a:hover:before, | ||
.rating a:hover ~ a:before { | ||
content: "\2605"; | ||
font-size: 1.2em; | ||
position: absolute; | ||
left: 0; | ||
margin-top: -25%; | ||
margin-left: -10%; | ||
color: gold; | ||
} | ||
|
||
.rating a:active:before, | ||
.rating a:active ~ a:before { | ||
color: red; | ||
} | ||
|
||
|
||
body { padding: 100px; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
Ratings Stars | ||
(with as little code as possible) | ||
*/ | ||
.rating { | ||
unicode-bidi: bidi-override; | ||
direction: rtl; | ||
text-align: center; | ||
} | ||
.rating > span { | ||
display: inline-block; | ||
position: relative; | ||
width: 1.1em; | ||
} | ||
.rating > *:hover, | ||
.rating > *:hover ~ span, | ||
.rating:not(:hover) > input:checked ~ span { | ||
color: transparent; | ||
} | ||
.rating > *:hover:before, | ||
.rating > *:hover ~ span:before, | ||
.rating:not(:hover) > input:checked ~ span:before { | ||
content: "\2605"; | ||
position: absolute; | ||
left: 0; | ||
color: gold; | ||
} | ||
|
||
.rating > input { | ||
margin-left:-1.1em; | ||
margin-right:0; | ||
top:3px; | ||
width:1.1em; | ||
height:1.1em; | ||
position:relative; | ||
z-index:2; | ||
opacity:0; | ||
} |