bootstrap-switch-rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e706b7076307718425514c0685bde92b25c4fcca
4
+ data.tar.gz: a756f9d5cdaf7ac9100e9219b104771e83e32405
5
+ SHA512:
6
+ metadata.gz: 13d09c70dc6e4aed31539f12aedc68ed169b0909562e4711d87400fe4c45af5ebfcbc59399616393b768953e21898641d57126eea43b3327d55460223c88c917
7
+ data.tar.gz: 199be4799c241ea6e11c2344897228bed42b259474b328b34008386780f1d5f022e13e6d14411e043161dd096c96e4e5fc54f0873b74251a0167fd190d243a97
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in genericons.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Manuel van Rijn
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,53 @@
1
+ # bootstrap-switch-rails [![Gem Version](https://badge.fury.io/rb/bootstrap-switch-rails.png)](http://badge.fury.io/rb/bootstrap-switch-rails)
2
+
3
+ bootstrap-switch-rails provides the [bootstrap-switch](https://github.com/nostalgiaz/bootstrap-switch)
4
+ plugin as a Rails engine to use it within the asset pipeline.
5
+
6
+ ## Installation
7
+
8
+ Add this to your Gemfile:
9
+
10
+ ```ruby
11
+ gem "bootstrap-switch-rails"
12
+ ```
13
+
14
+ and run `bundle install`.
15
+
16
+ ## Usage
17
+
18
+ In your `application.js`, include the following:
19
+
20
+ ```js
21
+ //= require bootstrap-switch
22
+ ```
23
+
24
+ In your `application.css`, include the following:
25
+
26
+ ```css
27
+ *= require bootstrap-switch
28
+ ```
29
+
30
+ ## Examples
31
+
32
+ See the [demo page of Mattia Larentis](http://www.larentis.eu/switch/) for examples how to use the plugin
33
+
34
+ ## Changes
35
+
36
+ | Version | Notes |
37
+ |---------+---------------------------------------------------------------------------|
38
+ | 0.1.0 | Initial release |
39
+
40
+ ## License
41
+
42
+ * The [bootstrap-switch](http://genericons.com/) plugin is licensed under the
43
+ [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
44
+ * The [bootstrap-switch-rails](https://github.com/manuelvanrijn/bootstrap-switch-rails) project is
45
+ licensed under the [MIT License](http://opensource.org/licenses/mit-license.html)
46
+
47
+ ## Contributing
48
+
49
+ 1. Fork it
50
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
51
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
52
+ 4. Push to the branch (`git push origin my-new-feature`)
53
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'bootstrap-switch-rails/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "bootstrap-switch-rails"
8
+ spec.version = Bootstrap::Switch::Rails::VERSION
9
+ spec.authors = ["Manuel van Rijn"]
10
+ spec.email = ["manuel@manuelles.nl"]
11
+ spec.description = %q{A small gem for putting bootstrap-switch into the Rails asset pipeline}
12
+ spec.summary = %q{an asset gemification of the bootstrap-switch plugin}
13
+ spec.homepage = "https://github.com/manuelvanrijn/bootstrap-switch-rails"
14
+ spec.license = "MIT, Apache License v2.0"
15
+
16
+ spec.files = `git ls-files`.split($/)
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_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ end
@@ -0,0 +1,14 @@
1
+ require "rails"
2
+ require "bootstrap-switch-rails/version"
3
+
4
+ module Bootstrap
5
+ module Switch
6
+ module Rails
7
+ if ::Rails.version < "3.1"
8
+ require "bootstrap-switch-rails/railtie"
9
+ else
10
+ require "bootstrap-switch-rails/engine"
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,8 @@
1
+ module Bootstrap
2
+ module Switch
3
+ module Rails
4
+ class Engine < ::Rails::Engine
5
+ end
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ module Bootstrap
2
+ module Switch
3
+ module Rails
4
+ class Railtie < ::Rails::Railtie; end
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Bootstrap
2
+ module Switch
3
+ module Rails
4
+ VERSION = "0.1.0"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,238 @@
1
+ /* ============================================================
2
+ * bootstrapSwitch v1.2 by Larentis Mattia @spiritualGuru
3
+ * http://www.larentis.eu/switch/
4
+ * ============================================================
5
+ * Licensed under the Apache License, Version 2.0
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ * ============================================================ */
8
+
9
+ !function ($) {
10
+ "use strict";
11
+
12
+ $.fn['bootstrapSwitch'] = function (method) {
13
+ var methods = {
14
+ init: function () {
15
+ return this.each(function () {
16
+ var $element = $(this)
17
+ , $div
18
+ , $switchLeft
19
+ , $switchRight
20
+ , $label
21
+ , myClasses = ""
22
+ , classes = $element.attr('class')
23
+ , color
24
+ , moving
25
+ , onLabel = "ON"
26
+ , offLabel = "OFF";
27
+
28
+ $.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) {
29
+ if (classes.indexOf(el) >= 0)
30
+ myClasses = el;
31
+ });
32
+
33
+ $element.addClass('has-switch');
34
+
35
+ if ($element.data('on') !== undefined)
36
+ color = "switch-" + $element.data('on');
37
+
38
+ if ($element.data('on-label') !== undefined)
39
+ onLabel = $element.data('on-label');
40
+
41
+ if ($element.data('off-label') !== undefined)
42
+ offLabel = $element.data('off-label');
43
+
44
+ $switchLeft = $('<span>')
45
+ .addClass("switch-left")
46
+ .addClass(myClasses)
47
+ .addClass(color)
48
+ .html(onLabel);
49
+
50
+ color = '';
51
+ if ($element.data('off') !== undefined)
52
+ color = "switch-" + $element.data('off');
53
+
54
+ $switchRight = $('<span>')
55
+ .addClass("switch-right")
56
+ .addClass(myClasses)
57
+ .addClass(color)
58
+ .html(offLabel);
59
+
60
+ $label = $('<label>')
61
+ .html("&nbsp;")
62
+ .addClass(myClasses)
63
+ .attr('for', $element.find('input').attr('id'));
64
+
65
+ $div = $element.find(':checkbox').wrap($('<div>')).parent().data('animated', false);
66
+
67
+ if ($element.data('animated') !== false)
68
+ $div.addClass('switch-animate').data('animated', true);
69
+
70
+ $div
71
+ .append($switchLeft)
72
+ .append($label)
73
+ .append($switchRight);
74
+
75
+ $element.find('>div').addClass(
76
+ $element.find('input').is(':checked') ? 'switch-on' : 'switch-off'
77
+ );
78
+
79
+ if ($element.find('input').is(':disabled'))
80
+ $(this).addClass('deactivate');
81
+
82
+ var changeStatus = function ($this) {
83
+ $this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
84
+ };
85
+
86
+ $element.on('keydown', function (e) {
87
+ if (e.keyCode === 32) {
88
+ e.stopImmediatePropagation();
89
+ e.preventDefault();
90
+ changeStatus($(e.target).find('span:first'));
91
+ }
92
+ });
93
+
94
+ $switchLeft.on('click', function (e) {
95
+ changeStatus($(this));
96
+ });
97
+
98
+ $switchRight.on('click', function (e) {
99
+ changeStatus($(this));
100
+ });
101
+
102
+ $element.find('input').on('change', function (e) {
103
+ var $element = $(this).parent();
104
+
105
+ e.preventDefault();
106
+ e.stopImmediatePropagation();
107
+
108
+ $element.css('left', '');
109
+
110
+ if ($(this).is(':checked'))
111
+ $element.removeClass('switch-off').addClass('switch-on');
112
+ else $element.removeClass('switch-on').addClass('switch-off');
113
+
114
+ if ($element.data('animated') !== false)
115
+ $element.addClass("switch-animate");
116
+
117
+ $element.parent().trigger('switch-change', {'el': $(this), 'value': $(this).is(':checked')})
118
+ });
119
+
120
+ $element.find('label').on('mousedown touchstart', function (e) {
121
+ var $this = $(this);
122
+ moving = false;
123
+
124
+ e.preventDefault();
125
+ e.stopImmediatePropagation();
126
+
127
+ $this.closest('div').removeClass('switch-animate');
128
+
129
+ if ($this.closest('.switch').is('.deactivate'))
130
+ $this.unbind('click');
131
+ else {
132
+ $this.on('mousemove touchmove', function (e) {
133
+ var $element = $(this).closest('.switch')
134
+ , relativeX = (e.pageX || e.originalEvent.targetTouches[0].pageX) - $element.offset().left
135
+ , percent = (relativeX / $element.width()) * 100
136
+ , left = 25
137
+ , right = 75;
138
+
139
+ moving = true;
140
+
141
+ if (percent < left)
142
+ percent = left;
143
+ else if (percent > right)
144
+ percent = right;
145
+
146
+ $element.find('>div').css('left', (percent - right) + "%")
147
+ });
148
+
149
+ $this.on('click touchend', function (e) {
150
+ var $this = $(this)
151
+ , $target = $(e.target)
152
+ , $myCheckBox = $target.siblings('input');
153
+
154
+ e.stopImmediatePropagation();
155
+ e.preventDefault();
156
+
157
+ $this.unbind('mouseleave');
158
+
159
+ if (moving)
160
+ $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25));
161
+ else $myCheckBox.prop("checked", !$myCheckBox.is(":checked"));
162
+
163
+ moving = false;
164
+ $myCheckBox.trigger('change');
165
+ });
166
+
167
+ $this.on('mouseleave', function (e) {
168
+ var $this = $(this)
169
+ , $myCheckBox = $this.siblings('input');
170
+
171
+ e.preventDefault();
172
+ e.stopImmediatePropagation();
173
+
174
+ $this.unbind('mouseleave');
175
+ $this.trigger('mouseup');
176
+
177
+ $myCheckBox.prop('checked', !(parseInt($this.parent().css('left')) < -25)).trigger('change');
178
+ });
179
+
180
+ $this.on('mouseup', function (e) {
181
+ e.stopImmediatePropagation();
182
+ e.preventDefault();
183
+
184
+ $(this).unbind('mousemove');
185
+ });
186
+ }
187
+ });
188
+ }
189
+ );
190
+ },
191
+ toggleActivation: function () {
192
+ $(this).toggleClass('deactivate');
193
+ },
194
+ isActive: function () {
195
+ return !$(this).hasClass('deactivate');
196
+ },
197
+ setActive: function (active) {
198
+ if (active)
199
+ $(this).removeClass('deactivate');
200
+ else $(this).addClass('deactivate');
201
+ },
202
+ toggleState: function (skipOnChange) {
203
+ var $input = $(this).find('input:checkbox');
204
+ $input.prop('checked', !$input.is(':checked')).trigger('change', skipOnChange);
205
+ },
206
+ setState: function (value, skipOnChange) {
207
+ $(this).find('input:checkbox').prop('checked', value).trigger('change', skipOnChange);
208
+ },
209
+ status: function () {
210
+ return $(this).find('input:checkbox').is(':checked');
211
+ },
212
+ destroy: function () {
213
+ var $div = $(this).find('div')
214
+ , $checkbox;
215
+
216
+ $div.find(':not(input:checkbox)').remove();
217
+
218
+ $checkbox = $div.children();
219
+ $checkbox.unwrap().unwrap();
220
+
221
+ $checkbox.unbind('change');
222
+
223
+ return $checkbox;
224
+ }
225
+ };
226
+
227
+ if (methods[method])
228
+ return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
229
+ else if (typeof method === 'object' || !method)
230
+ return methods.init.apply(this, arguments);
231
+ else
232
+ $.error('Method ' + method + ' does not exist!');
233
+ };
234
+ }(jQuery);
235
+
236
+ $(function () {
237
+ $('.switch')['bootstrapSwitch']();
238
+ });
@@ -0,0 +1,352 @@
1
+ /* ============================================================
2
+ * bootstrapSwitch v1.2 by Larentis Mattia @spiritualGuru
3
+ * http://www.larentis.eu/switch/
4
+ * ============================================================
5
+ * Licensed under the Apache License, Version 2.0
6
+ * http://www.apache.org/licenses/LICENSE-2.0
7
+ * ============================================================ */
8
+ .has-switch {
9
+ display: inline-block;
10
+ cursor: pointer;
11
+ -webkit-border-radius: 5px;
12
+ -moz-border-radius: 5px;
13
+ border-radius: 5px;
14
+ border: 1px solid;
15
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
16
+ position: relative;
17
+ text-align: left;
18
+ overflow: hidden;
19
+ line-height: 8px;
20
+ -webkit-user-select: none;
21
+ -moz-user-select: none;
22
+ -ms-user-select: none;
23
+ -o-user-select: none;
24
+ user-select: none;
25
+ min-width: 100px;
26
+ }
27
+ .has-switch.switch-mini {
28
+ min-width: 72px;
29
+ }
30
+ .has-switch.switch-small {
31
+ min-width: 80px;
32
+ }
33
+ .has-switch.switch-large {
34
+ min-width: 120px;
35
+ }
36
+ .has-switch.deactivate {
37
+ opacity: 0.5;
38
+ filter: alpha(opacity=50);
39
+ cursor: default !important;
40
+ }
41
+ .has-switch.deactivate label,
42
+ .has-switch.deactivate span {
43
+ cursor: default !important;
44
+ }
45
+ .has-switch > div {
46
+ display: inline-block;
47
+ width: 150%;
48
+ position: relative;
49
+ top: 0;
50
+ }
51
+ .has-switch > div.switch-animate {
52
+ -webkit-transition: left 0.5s;
53
+ -moz-transition: left 0.5s;
54
+ -o-transition: left 0.5s;
55
+ transition: left 0.5s;
56
+ }
57
+ .has-switch > div.switch-off {
58
+ left: -49%;
59
+ }
60
+ .has-switch > div.switch-on {
61
+ left: 0%;
62
+ }
63
+ .has-switch input[type=checkbox] {
64
+ display: none;
65
+ }
66
+ .has-switch span,
67
+ .has-switch label {
68
+ -webkit-box-sizing: border-box;
69
+ -moz-box-sizing: border-box;
70
+ box-sizing: border-box;
71
+ cursor: pointer;
72
+ position: relative;
73
+ display: inline-block;
74
+ height: 100%;
75
+ padding-bottom: 4px;
76
+ padding-top: 4px;
77
+ font-size: 14px;
78
+ line-height: 20px;
79
+ }
80
+ .has-switch span.switch-mini,
81
+ .has-switch label.switch-mini {
82
+ padding-bottom: 4px;
83
+ padding-top: 4px;
84
+ font-size: 10px;
85
+ line-height: 9px;
86
+ }
87
+ .has-switch span.switch-small,
88
+ .has-switch label.switch-small {
89
+ padding-bottom: 3px;
90
+ padding-top: 3px;
91
+ font-size: 12px;
92
+ line-height: 18px;
93
+ }
94
+ .has-switch span.switch-large,
95
+ .has-switch label.switch-large {
96
+ padding-bottom: 9px;
97
+ padding-top: 9px;
98
+ font-size: 16px;
99
+ line-height: normal;
100
+ }
101
+ .has-switch label {
102
+ margin-top: -1px;
103
+ margin-bottom: -1px;
104
+ z-index: 100;
105
+ width: 34%;
106
+ border-left: 1px solid #cccccc;
107
+ border-right: 1px solid #cccccc;
108
+ color: #ffffff;
109
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
110
+ background-color: #f5f5f5;
111
+ background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
112
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
113
+ background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
114
+ background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
115
+ background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
116
+ background-repeat: repeat-x;
117
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
118
+ border-color: #e6e6e6 #e6e6e6 #bfbfbf;
119
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
120
+ *background-color: #e6e6e6;
121
+ /* Darken IE7 buttons by default so they stand out more given they won't have borders */
122
+
123
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
124
+ }
125
+ .has-switch label:hover,
126
+ .has-switch label:focus,
127
+ .has-switch label:active,
128
+ .has-switch label.active,
129
+ .has-switch label.disabled,
130
+ .has-switch label[disabled] {
131
+ color: #ffffff;
132
+ background-color: #e6e6e6;
133
+ *background-color: #d9d9d9;
134
+ }
135
+ .has-switch label:active,
136
+ .has-switch label.active {
137
+ background-color: #cccccc \9;
138
+ }
139
+ .has-switch span {
140
+ text-align: center;
141
+ z-index: 1;
142
+ width: 33%;
143
+ }
144
+ .has-switch span.switch-left {
145
+ -webkit-border-top-left-radius: 4px;
146
+ -moz-border-radius-topleft: 4px;
147
+ border-top-left-radius: 4px;
148
+ -webkit-border-bottom-left-radius: 4px;
149
+ -moz-border-radius-bottomleft: 4px;
150
+ border-bottom-left-radius: 4px;
151
+ }
152
+ .has-switch span.switch-right {
153
+ color: #333333;
154
+ text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
155
+ background-color: #f0f0f0;
156
+ background-image: -moz-linear-gradient(top, #e6e6e6, #ffffff);
157
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#ffffff));
158
+ background-image: -webkit-linear-gradient(top, #e6e6e6, #ffffff);
159
+ background-image: -o-linear-gradient(top, #e6e6e6, #ffffff);
160
+ background-image: linear-gradient(to bottom, #e6e6e6, #ffffff);
161
+ background-repeat: repeat-x;
162
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0);
163
+ border-color: #ffffff #ffffff #d9d9d9;
164
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
165
+ *background-color: #ffffff;
166
+ /* Darken IE7 buttons by default so they stand out more given they won't have borders */
167
+
168
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
169
+ }
170
+ .has-switch span.switch-right:hover,
171
+ .has-switch span.switch-right:focus,
172
+ .has-switch span.switch-right:active,
173
+ .has-switch span.switch-right.active,
174
+ .has-switch span.switch-right.disabled,
175
+ .has-switch span.switch-right[disabled] {
176
+ color: #333333;
177
+ background-color: #ffffff;
178
+ *background-color: #f2f2f2;
179
+ }
180
+ .has-switch span.switch-right:active,
181
+ .has-switch span.switch-right.active {
182
+ background-color: #e6e6e6 \9;
183
+ }
184
+ .has-switch span.switch-primary,
185
+ .has-switch span.switch-left {
186
+ color: #ffffff;
187
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
188
+ background-color: #005fcc;
189
+ background-image: -moz-linear-gradient(top, #0044cc, #0088cc);
190
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0044cc), to(#0088cc));
191
+ background-image: -webkit-linear-gradient(top, #0044cc, #0088cc);
192
+ background-image: -o-linear-gradient(top, #0044cc, #0088cc);
193
+ background-image: linear-gradient(to bottom, #0044cc, #0088cc);
194
+ background-repeat: repeat-x;
195
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0044cc', endColorstr='#ff0088cc', GradientType=0);
196
+ border-color: #0088cc #0088cc #005580;
197
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
198
+ *background-color: #0088cc;
199
+ /* Darken IE7 buttons by default so they stand out more given they won't have borders */
200
+
201
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
202
+ }
203
+ .has-switch span.switch-primary:hover,
204
+ .has-switch span.switch-left:hover,
205
+ .has-switch span.switch-primary:focus,
206
+ .has-switch span.switch-left:focus,
207
+ .has-switch span.switch-primary:active,
208
+ .has-switch span.switch-left:active,
209
+ .has-switch span.switch-primary.active,
210
+ .has-switch span.switch-left.active,
211
+ .has-switch span.switch-primary.disabled,
212
+ .has-switch span.switch-left.disabled,
213
+ .has-switch span.switch-primary[disabled],
214
+ .has-switch span.switch-left[disabled] {
215
+ color: #ffffff;
216
+ background-color: #0088cc;
217
+ *background-color: #0077b3;
218
+ }
219
+ .has-switch span.switch-primary:active,
220
+ .has-switch span.switch-left:active,
221
+ .has-switch span.switch-primary.active,
222
+ .has-switch span.switch-left.active {
223
+ background-color: #006699 \9;
224
+ }
225
+ .has-switch span.switch-info {
226
+ color: #ffffff;
227
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
228
+ background-color: #41a7c5;
229
+ background-image: -moz-linear-gradient(top, #2f96b4, #5bc0de);
230
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#2f96b4), to(#5bc0de));
231
+ background-image: -webkit-linear-gradient(top, #2f96b4, #5bc0de);
232
+ background-image: -o-linear-gradient(top, #2f96b4, #5bc0de);
233
+ background-image: linear-gradient(to bottom, #2f96b4, #5bc0de);
234
+ background-repeat: repeat-x;
235
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff2f96b4', endColorstr='#ff5bc0de', GradientType=0);
236
+ border-color: #5bc0de #5bc0de #28a1c5;
237
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
238
+ *background-color: #5bc0de;
239
+ /* Darken IE7 buttons by default so they stand out more given they won't have borders */
240
+
241
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
242
+ }
243
+ .has-switch span.switch-info:hover,
244
+ .has-switch span.switch-info:focus,
245
+ .has-switch span.switch-info:active,
246
+ .has-switch span.switch-info.active,
247
+ .has-switch span.switch-info.disabled,
248
+ .has-switch span.switch-info[disabled] {
249
+ color: #ffffff;
250
+ background-color: #5bc0de;
251
+ *background-color: #46b8da;
252
+ }
253
+ .has-switch span.switch-info:active,
254
+ .has-switch span.switch-info.active {
255
+ background-color: #31b0d5 \9;
256
+ }
257
+ .has-switch span.switch-success {
258
+ color: #ffffff;
259
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
260
+ background-color: #58b058;
261
+ background-image: -moz-linear-gradient(top, #51a351, #62c462);
262
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#51a351), to(#62c462));
263
+ background-image: -webkit-linear-gradient(top, #51a351, #62c462);
264
+ background-image: -o-linear-gradient(top, #51a351, #62c462);
265
+ background-image: linear-gradient(to bottom, #51a351, #62c462);
266
+ background-repeat: repeat-x;
267
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff51a351', endColorstr='#ff62c462', GradientType=0);
268
+ border-color: #62c462 #62c462 #3b9e3b;
269
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
270
+ *background-color: #62c462;
271
+ /* Darken IE7 buttons by default so they stand out more given they won't have borders */
272
+
273
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
274
+ }
275
+ .has-switch span.switch-success:hover,
276
+ .has-switch span.switch-success:focus,
277
+ .has-switch span.switch-success:active,
278
+ .has-switch span.switch-success.active,
279
+ .has-switch span.switch-success.disabled,
280
+ .has-switch span.switch-success[disabled] {
281
+ color: #ffffff;
282
+ background-color: #62c462;
283
+ *background-color: #4fbd4f;
284
+ }
285
+ .has-switch span.switch-success:active,
286
+ .has-switch span.switch-success.active {
287
+ background-color: #42b142 \9;
288
+ }
289
+ .has-switch span.switch-warning {
290
+ color: #ffffff;
291
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
292
+ background-color: #f9a123;
293
+ background-image: -moz-linear-gradient(top, #f89406, #fbb450);
294
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f89406), to(#fbb450));
295
+ background-image: -webkit-linear-gradient(top, #f89406, #fbb450);
296
+ background-image: -o-linear-gradient(top, #f89406, #fbb450);
297
+ background-image: linear-gradient(to bottom, #f89406, #fbb450);
298
+ background-repeat: repeat-x;
299
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff89406', endColorstr='#fffbb450', GradientType=0);
300
+ border-color: #fbb450 #fbb450 #f89406;
301
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
302
+ *background-color: #fbb450;
303
+ /* Darken IE7 buttons by default so they stand out more given they won't have borders */
304
+
305
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
306
+ }
307
+ .has-switch span.switch-warning:hover,
308
+ .has-switch span.switch-warning:focus,
309
+ .has-switch span.switch-warning:active,
310
+ .has-switch span.switch-warning.active,
311
+ .has-switch span.switch-warning.disabled,
312
+ .has-switch span.switch-warning[disabled] {
313
+ color: #ffffff;
314
+ background-color: #fbb450;
315
+ *background-color: #faa937;
316
+ }
317
+ .has-switch span.switch-warning:active,
318
+ .has-switch span.switch-warning.active {
319
+ background-color: #fa9f1e \9;
320
+ }
321
+ .has-switch span.switch-danger {
322
+ color: #ffffff;
323
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
324
+ background-color: #d14641;
325
+ background-image: -moz-linear-gradient(top, #bd362f, #ee5f5b);
326
+ background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#bd362f), to(#ee5f5b));
327
+ background-image: -webkit-linear-gradient(top, #bd362f, #ee5f5b);
328
+ background-image: -o-linear-gradient(top, #bd362f, #ee5f5b);
329
+ background-image: linear-gradient(to bottom, #bd362f, #ee5f5b);
330
+ background-repeat: repeat-x;
331
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffbd362f', endColorstr='#ffee5f5b', GradientType=0);
332
+ border-color: #ee5f5b #ee5f5b #e51d18;
333
+ border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
334
+ *background-color: #ee5f5b;
335
+ /* Darken IE7 buttons by default so they stand out more given they won't have borders */
336
+
337
+ filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
338
+ }
339
+ .has-switch span.switch-danger:hover,
340
+ .has-switch span.switch-danger:focus,
341
+ .has-switch span.switch-danger:active,
342
+ .has-switch span.switch-danger.active,
343
+ .has-switch span.switch-danger.disabled,
344
+ .has-switch span.switch-danger[disabled] {
345
+ color: #ffffff;
346
+ background-color: #ee5f5b;
347
+ *background-color: #ec4844;
348
+ }
349
+ .has-switch span.switch-danger:active,
350
+ .has-switch span.switch-danger.active {
351
+ background-color: #e9322d \9;
352
+ }
metadata ADDED
@@ -0,0 +1,84 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bootstrap-switch-rails
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Manuel van Rijn
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-03-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '1.3'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '1.3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: A small gem for putting bootstrap-switch into the Rails asset pipeline
42
+ email:
43
+ - manuel@manuelles.nl
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - .gitignore
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - bootstrap-switch-rails.gemspec
54
+ - lib/bootstrap-switch-rails.rb
55
+ - lib/bootstrap-switch-rails/engine.rb
56
+ - lib/bootstrap-switch-rails/railtie.rb
57
+ - lib/bootstrap-switch-rails/version.rb
58
+ - vendor/assets/javascripts/bootstrap-switch.js
59
+ - vendor/assets/stylesheets/bootstrap-switch.css
60
+ homepage: https://github.com/manuelvanrijn/bootstrap-switch-rails
61
+ licenses:
62
+ - MIT, Apache License v2.0
63
+ metadata: {}
64
+ post_install_message:
65
+ rdoc_options: []
66
+ require_paths:
67
+ - lib
68
+ required_ruby_version: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ requirements: []
79
+ rubyforge_project:
80
+ rubygems_version: 2.0.0
81
+ signing_key:
82
+ specification_version: 4
83
+ summary: an asset gemification of the bootstrap-switch plugin
84
+ test_files: []