fa-checkbox 0.0.2

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 458c5680e2e26039efda8ed418e1dc5fa78e80b5
4
+ data.tar.gz: 78cafae0a61174c82d06ad41d92ac930323e627c
5
+ SHA512:
6
+ metadata.gz: 27e853690d1d2e3be21d23a9351a110c57eb4b10f719f478df32ce3b39748631160d38285f6cbbff3ddb53efa668881da1249a540bcf9d0d7aa5e714839c75ef
7
+ data.tar.gz: 18662f70ae272ca1cf3e3fd20fb642afb39cf3b585a459e155895e4d8a1b9c468b49be1e1d22608aa1ddb207f5726f5d73aa76010c57a9cf5fa56bd88bca4bbe
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ *.gem
2
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in fa-checkbox.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Dmitry Klimensky
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,50 @@
1
+ # fa-checkbox
2
+
3
+ A simple Ruby On Rails gem to replace standard browser's checkboxes and radio buttons with [Font Awesome][1] icons.
4
+
5
+ ## Dependencies
6
+
7
+ This gem has a dependency to the [font-awesome-rails][2] gem and makes [Font Awesome][1] and [font-awesome-rails][2] available in your application implicitly.
8
+
9
+ ## Installation
10
+
11
+ Add this to your Gemfile:
12
+
13
+ gem 'fa-checkbox'
14
+
15
+ and run `bundle install`.
16
+
17
+ ## Usage
18
+
19
+ In your application.css, include the css file:
20
+
21
+ ```css
22
+ /*
23
+ *= require fa-checkbox
24
+ */
25
+ ```
26
+
27
+ to make it picked up by the asset pipline. Restart your webserver if it was running.
28
+
29
+ ### Disable in fa-checkbox for older browsers if needed
30
+
31
+ If you support some old browsers that make trouble with custom `@font-face` fonts, you can disable `fa-checkbox` by conditional inclusion of `fa-checkbox-revert.css`. You need to make it available to your application by pre-compiling it first. Add this line to `confic/initializers/assets.rb` or another your environment initialization file:
32
+
33
+ ```ruby
34
+ Rails.application.config.assets.precompile += %w(fa-checkbox-revert.css)
35
+ ```
36
+
37
+ And included it to your application layout depending on your conditions. For example, for IE8 and below:
38
+
39
+ ```html
40
+ <!--[if lt IE 9]>
41
+ <%= stylesheet_link_tag 'fa-checkbox-revert', media: all %>
42
+ <!--<![endif]-->
43
+ ```
44
+
45
+ ## Caution
46
+
47
+ Make sure that all labels in your application are linked to their checkboxes and radio buttons with `<label for='...'>` attribute properly. Otherwise they will not react to you clicks.
48
+
49
+ [1]: http://fortawesome.github.io/Font-Awesome/icons/
50
+ [2]: https://github.com/bokmann/font-awesome-rails
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,24 @@
1
+ input[type=checkbox], input[type=radio] {
2
+ display: inline-block;
3
+ }
4
+
5
+ input[type=checkbox] + label:before, input[type=radio] + label:before {
6
+ font-family: inherit;
7
+ width: 0;
8
+ }
9
+
10
+ input[type=checkbox] + label:before {
11
+ content: "";
12
+ }
13
+
14
+ input[type=checkbox]:checked + label:before {
15
+ content: "";
16
+ }
17
+
18
+ input[type=radio] + label:before {
19
+ content: "";
20
+ }
21
+
22
+ input[type=radio]:checked + label:before {
23
+ content: "";
24
+ }
@@ -0,0 +1,31 @@
1
+ /*= require font-awesome */
2
+
3
+ input[type=checkbox], input[type=radio] {
4
+ display:none;
5
+ }
6
+
7
+ input[type=checkbox] + label:before, input[type=radio] + label:before {
8
+ font-family: FontAwesome;
9
+ display: inline-block;
10
+ width: 1.3em;
11
+ }
12
+
13
+ input[type=checkbox]:disabled + label:before, input[type=radio]:disabled + label:before {
14
+ color: #999999;
15
+ }
16
+
17
+ input[type=checkbox] + label:before {
18
+ content: "\f096";
19
+ }
20
+
21
+ input[type=checkbox]:checked + label:before {
22
+ content: "\f046";
23
+ }
24
+
25
+ input[type=radio] + label:before {
26
+ content: "\f10c";
27
+ }
28
+
29
+ input[type=radio]:checked + label:before {
30
+ content: "\f192";
31
+ }
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'fa-checkbox/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "fa-checkbox"
8
+ spec.version = FaCheckbox::VERSION
9
+ spec.authors = ["Dmitry Klimensky"]
10
+ spec.email = ["klimensky@gmail.com"]
11
+ spec.summary = %q{Font Awesome checkboxes and radio buttons in Rails applications.}
12
+ spec.description = %q{This gem replaces standard checkboxes and radio buttons with Font Awesome characters making them look the same across all browsers.}
13
+ spec.homepage = "https://github.com/dmkl/fa-checkbox"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency 'font-awesome-rails', '>= 3.0'
22
+ end
@@ -0,0 +1,2 @@
1
+ require "fa-checkbox/version"
2
+ require "fa-checkbox/engine" if defined?(::Rails)
@@ -0,0 +1,6 @@
1
+ module FaCheckbox
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,3 @@
1
+ module FaCheckbox
2
+ VERSION = "0.0.2"
3
+ end
metadata ADDED
@@ -0,0 +1,70 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fa-checkbox
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Dmitry Klimensky
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-07-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: font-awesome-rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '3.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '3.0'
27
+ description: This gem replaces standard checkboxes and radio buttons with Font Awesome
28
+ characters making them look the same across all browsers.
29
+ email:
30
+ - klimensky@gmail.com
31
+ executables: []
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - ".gitignore"
36
+ - Gemfile
37
+ - LICENSE.txt
38
+ - README.md
39
+ - Rakefile
40
+ - app/assets/stylesheets/fa-checkbox-revert.css
41
+ - app/assets/stylesheets/fa-checkbox.css
42
+ - fa-checkbox.gemspec
43
+ - lib/fa-checkbox.rb
44
+ - lib/fa-checkbox/engine.rb
45
+ - lib/fa-checkbox/version.rb
46
+ homepage: https://github.com/dmkl/fa-checkbox
47
+ licenses:
48
+ - MIT
49
+ metadata: {}
50
+ post_install_message:
51
+ rdoc_options: []
52
+ require_paths:
53
+ - lib
54
+ required_ruby_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '0'
64
+ requirements: []
65
+ rubyforge_project:
66
+ rubygems_version: 2.2.2
67
+ signing_key:
68
+ specification_version: 4
69
+ summary: Font Awesome checkboxes and radio buttons in Rails applications.
70
+ test_files: []