bootstrap-switch 1.9.0
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.
@@ -0,0 +1 @@
|
|
1
|
+
@import "../../static/sass/bootstrap-switch";
|
@@ -0,0 +1,9 @@
|
|
1
|
+
module Bootstrap
|
2
|
+
module Switch
|
3
|
+
# This is updated via the `grunt bump` command, which has a pretty
|
4
|
+
# unflexible matching syntax.
|
5
|
+
VERSION_STRING = "'version': '1.9.0'"
|
6
|
+
# Then, just the version.
|
7
|
+
VERSION = VERSION_STRING.match(/\d+\.\d+\.\d+/)[0]
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,177 @@
|
|
1
|
+
/* ============================================================
|
2
|
+
* bootstrapSwitch v1.8.1 by Larentis Mattia @SpiritualGuru
|
3
|
+
* http://www.larentis.eu/
|
4
|
+
*
|
5
|
+
* and Peter Stein (BdMdesigN)
|
6
|
+
* http://www.bdmdesign.org/
|
7
|
+
*
|
8
|
+
* Project site:
|
9
|
+
* http://www.bootstrap-switch.org
|
10
|
+
* ============================================================
|
11
|
+
* Licensed under the Apache License, Version 2.0
|
12
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
* ============================================================ */
|
14
|
+
@function percent_opacify($color, $amount) { @return opacify($color, $amount/100%); }
|
15
|
+
|
16
|
+
@import "deps/variables";
|
17
|
+
@import "deps/mixins";
|
18
|
+
|
19
|
+
.has-switch {
|
20
|
+
display: inline-block;
|
21
|
+
cursor: pointer;
|
22
|
+
@include border-radius(5px);
|
23
|
+
border: 1px solid;
|
24
|
+
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
|
25
|
+
position: relative;
|
26
|
+
text-align: left;
|
27
|
+
overflow: hidden;
|
28
|
+
line-height: 8px;
|
29
|
+
@include user-select(none);
|
30
|
+
vertical-align: middle;
|
31
|
+
|
32
|
+
min-width: 100px;
|
33
|
+
|
34
|
+
&.switch-mini {
|
35
|
+
min-width: 72px;
|
36
|
+
}
|
37
|
+
&.switch-mini i.switch-mini-icons {
|
38
|
+
height: 1.20em;
|
39
|
+
line-height: 9px;
|
40
|
+
vertical-align: text-top;
|
41
|
+
text-align: center;
|
42
|
+
transform: scale(0.6);
|
43
|
+
margin-top: -1px;
|
44
|
+
margin-bottom: -1px;
|
45
|
+
}
|
46
|
+
&.switch-small {
|
47
|
+
min-width: 80px;
|
48
|
+
}
|
49
|
+
|
50
|
+
&.switch-large {
|
51
|
+
min-width: 120px;
|
52
|
+
}
|
53
|
+
|
54
|
+
&.deactivate {
|
55
|
+
@include opacity(50);
|
56
|
+
cursor: default !important;
|
57
|
+
label, span {
|
58
|
+
cursor: default !important;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
> div {
|
62
|
+
display: inline-block;
|
63
|
+
width: 150%;
|
64
|
+
position: relative;
|
65
|
+
top: 0;
|
66
|
+
|
67
|
+
&.switch-animate {
|
68
|
+
@include transition(left 0.5s);
|
69
|
+
}
|
70
|
+
&.switch-off {
|
71
|
+
left: -50%;
|
72
|
+
}
|
73
|
+
&.switch-on {
|
74
|
+
left: 0%;
|
75
|
+
}
|
76
|
+
}
|
77
|
+
input[type=radio],
|
78
|
+
input[type=checkbox] {
|
79
|
+
//debug
|
80
|
+
display: none;
|
81
|
+
//position: absolute;
|
82
|
+
//margin-left: 60%;
|
83
|
+
//z-index: 123;
|
84
|
+
}
|
85
|
+
|
86
|
+
span, label {
|
87
|
+
@include box-sizing(border-box);
|
88
|
+
|
89
|
+
cursor: pointer;
|
90
|
+
position: relative;
|
91
|
+
display: inline-block;
|
92
|
+
height: 100%;
|
93
|
+
|
94
|
+
padding-bottom: 4px;
|
95
|
+
padding-top: 4px;
|
96
|
+
font-size: 14px;
|
97
|
+
line-height: 20px;
|
98
|
+
|
99
|
+
&.switch-mini {
|
100
|
+
padding-bottom: 4px;
|
101
|
+
padding-top: 4px;
|
102
|
+
font-size: 10px;
|
103
|
+
line-height: 9px;
|
104
|
+
}
|
105
|
+
|
106
|
+
&.switch-small {
|
107
|
+
padding-bottom: 3px;
|
108
|
+
padding-top: 3px;
|
109
|
+
font-size: 12px;
|
110
|
+
line-height: 18px;
|
111
|
+
}
|
112
|
+
|
113
|
+
&.switch-large {
|
114
|
+
padding-bottom: 9px;
|
115
|
+
padding-top: 9px;
|
116
|
+
font-size: 16px;
|
117
|
+
line-height: normal;
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
121
|
+
label {
|
122
|
+
text-align: center;
|
123
|
+
margin-top: -1px;
|
124
|
+
margin-bottom: -1px;
|
125
|
+
z-index: 100;
|
126
|
+
width: 34%;
|
127
|
+
border-left: 1px solid $btnBorder;
|
128
|
+
border-right: 1px solid $btnBorder;
|
129
|
+
|
130
|
+
@include buttonBackground($btnBackground, $btnBackgroundHighlight, $grayDark);
|
131
|
+
|
132
|
+
i {
|
133
|
+
color: #000;
|
134
|
+
text-shadow: 0 1px 0 #fff;
|
135
|
+
line-height: 18px;
|
136
|
+
pointer-events: none;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
|
140
|
+
span {
|
141
|
+
text-align: center;
|
142
|
+
z-index: 1;
|
143
|
+
width: 33%;
|
144
|
+
|
145
|
+
&.switch-left {
|
146
|
+
@include border-left-radius(4px);
|
147
|
+
}
|
148
|
+
|
149
|
+
&.switch-right {
|
150
|
+
@include buttonBackground($btnBackgroundHighlight, $btnBackground, $grayDark, $btnShadow);
|
151
|
+
}
|
152
|
+
|
153
|
+
&.switch-primary, &.switch-left {
|
154
|
+
@include buttonBackground($btnPrimaryBackgroundHighlight, $btnPrimaryBackground);
|
155
|
+
}
|
156
|
+
|
157
|
+
&.switch-info {
|
158
|
+
@include buttonBackground($btnInfoBackgroundHighlight, $btnInfoBackground);
|
159
|
+
}
|
160
|
+
|
161
|
+
&.switch-success {
|
162
|
+
@include buttonBackground($btnSuccessBackgroundHighlight, $btnSuccessBackground);
|
163
|
+
}
|
164
|
+
|
165
|
+
&.switch-warning {
|
166
|
+
@include buttonBackground($btnWarningBackgroundHighlight, $btnWarningBackground);
|
167
|
+
}
|
168
|
+
|
169
|
+
&.switch-danger {
|
170
|
+
@include buttonBackground($btnDangerBackgroundHighlight, $btnDangerBackground);
|
171
|
+
}
|
172
|
+
|
173
|
+
&.switch-default {
|
174
|
+
@include buttonBackground($btnBackgroundHighlight, $btnBackground, $grayDark, $btnShadow);
|
175
|
+
}
|
176
|
+
}
|
177
|
+
}
|
@@ -0,0 +1,97 @@
|
|
1
|
+
@mixin border-radius($radius) {
|
2
|
+
-webkit-border-radius: $radius;
|
3
|
+
-moz-border-radius: $radius;
|
4
|
+
border-radius: $radius;
|
5
|
+
}
|
6
|
+
|
7
|
+
@mixin border-top-left-radius($radius) {
|
8
|
+
-webkit-border-top-left-radius: $radius;
|
9
|
+
-moz-border-radius-topleft: $radius;
|
10
|
+
border-top-left-radius: $radius;
|
11
|
+
}
|
12
|
+
|
13
|
+
@mixin border-bottom-left-radius($radius) {
|
14
|
+
-webkit-border-bottom-left-radius: $radius;
|
15
|
+
-moz-border-radius-bottomleft: $radius;
|
16
|
+
border-bottom-left-radius: $radius;
|
17
|
+
}
|
18
|
+
|
19
|
+
@mixin border-left-radius($radius) {
|
20
|
+
@include border-top-left-radius($radius);
|
21
|
+
@include border-bottom-left-radius($radius);
|
22
|
+
}
|
23
|
+
|
24
|
+
// Transitions
|
25
|
+
@mixin transition($transition) {
|
26
|
+
-webkit-transition: $transition;
|
27
|
+
-moz-transition: $transition;
|
28
|
+
-o-transition: $transition;
|
29
|
+
transition: $transition;
|
30
|
+
}
|
31
|
+
|
32
|
+
// Box sizing
|
33
|
+
@mixin box-sizing($boxmodel) {
|
34
|
+
-webkit-box-sizing: $boxmodel;
|
35
|
+
-moz-box-sizing: $boxmodel;
|
36
|
+
box-sizing: $boxmodel;
|
37
|
+
}
|
38
|
+
|
39
|
+
// User select
|
40
|
+
// For selecting text on the page
|
41
|
+
@mixin user-select($select) {
|
42
|
+
-webkit-user-select: $select;
|
43
|
+
-moz-user-select: $select;
|
44
|
+
-ms-user-select: $select;
|
45
|
+
-o-user-select: $select;
|
46
|
+
user-select: $select;
|
47
|
+
}
|
48
|
+
|
49
|
+
// Opacity
|
50
|
+
@mixin opacity($opacity) {
|
51
|
+
opacity: $opacity / 100;
|
52
|
+
filter: alpha(opacity=#{$opacity});
|
53
|
+
}
|
54
|
+
|
55
|
+
// Gradient Bar Colors for buttons and alerts
|
56
|
+
@mixin gradientBar($primaryColor, $secondaryColor, $textColor: #fff, $textShadow: $textShadow) {
|
57
|
+
color: $textColor;
|
58
|
+
text-shadow: $textShadow;
|
59
|
+
@include bootstrap-filter-gradient-vertical($primaryColor, $secondaryColor);
|
60
|
+
border-color: $secondaryColor $secondaryColor darken($secondaryColor, 15%);
|
61
|
+
border-color: rgba(0, 0, 0, .1) rgba(0, 0, 0, .1) percent_opacify(rgba(0, 0, 0, .1), 15%);
|
62
|
+
}
|
63
|
+
|
64
|
+
// Gradients
|
65
|
+
@mixin bootstrap-filter-gradient-vertical($startColor: #555, $endColor: #333) {
|
66
|
+
background-color: mix($startColor, $endColor, 60%);
|
67
|
+
background-image: -moz-linear-gradient(top, $startColor, $endColor); // FF 3.6+
|
68
|
+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from($startColor), to($endColor)); // Safari 4+, Chrome 2+
|
69
|
+
background-image: -webkit-linear-gradient(top, $startColor, $endColor); // Safari 5.1+, Chrome 10+
|
70
|
+
background-image: -o-linear-gradient(top, $startColor, $endColor); // Opera 11.10
|
71
|
+
background-image: linear-gradient(to bottom, $startColor, $endColor); // Standard, IE10
|
72
|
+
background-repeat: repeat-x;$ieStartColor: ie-hex-str($startColor) !default;
|
73
|
+
$ieEndColor: ie-hex-str($endColor) !default;
|
74
|
+
|
75
|
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{$ieStartColor}', endColorstr='#{$ieEndColor}', GradientType=0); // IE9 and down
|
76
|
+
}
|
77
|
+
|
78
|
+
@mixin reset-filter() {
|
79
|
+
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
|
80
|
+
}
|
81
|
+
|
82
|
+
@mixin buttonBackground($startColor, $endColor, $textColor: #fff, $textShadow: $textShadow) { // gradientBar will set the background to a pleasing blend of these, to support IE<=9
|
83
|
+
@include gradientBar($startColor, $endColor, $textColor, $textShadow);
|
84
|
+
*background-color: $endColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */
|
85
|
+
@include reset-filter(); // in these cases the gradient won't cover the background, so we override
|
86
|
+
&:hover, &:focus, &:active, &.active, &.disabled, &[disabled] {
|
87
|
+
color: $textColor;
|
88
|
+
background-color: $endColor;
|
89
|
+
*background-color: darken($endColor, 5%);
|
90
|
+
}
|
91
|
+
|
92
|
+
// IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
|
93
|
+
&:active,
|
94
|
+
&.active {
|
95
|
+
background-color: darken($endColor, 10%) unquote("\9");
|
96
|
+
}
|
97
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
$grayDarker: #222;$grayDark: #333 !default;
|
2
|
+
$white: #fff !default;
|
3
|
+
$orange: #f89406 !default;
|
4
|
+
$bodyBackground: $white !default;
|
5
|
+
$textColor: $grayDark !default;
|
6
|
+
$textShadow: 0 -1px 0 rgba(0,0,0,.25) !default;
|
7
|
+
$linkColor: #08c !default;
|
8
|
+
$linkColorHover: darken($linkColor, 15%) !default;
|
9
|
+
$btnBackground: $white !default;
|
10
|
+
$btnBackgroundHighlight: darken($white, 10%) !default;
|
11
|
+
$btnBorder: #ccc !default;
|
12
|
+
$btnShadow: 0 1px 1px rgba(255,255,255,.75) !default;
|
13
|
+
$btnPrimaryBackground: $linkColor !default;
|
14
|
+
$btnPrimaryBackgroundHighlight: adjust-hue($btnPrimaryBackground, 20%) !default;
|
15
|
+
$btnInfoBackground: #5bc0de !default;
|
16
|
+
$btnInfoBackgroundHighlight: #2f96b4 !default;
|
17
|
+
$btnSuccessBackground: #62c462 !default;
|
18
|
+
$btnSuccessBackgroundHighlight: #51a351 !default;
|
19
|
+
$btnWarningBackground: lighten($orange, 15%) !default;
|
20
|
+
$btnWarningBackgroundHighlight: $orange !default;
|
21
|
+
$btnDangerBackground: #ee5f5b !default;
|
22
|
+
$btnDangerBackgroundHighlight: #bd362f !default;
|
23
|
+
$btnInverseBackground: #444 !default;
|
24
|
+
$btnInverseBackgroundHighlight: $grayDarker !default;
|
25
|
+
|
metadata
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bootstrap-switch
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 1
|
7
|
+
- 9
|
8
|
+
- 0
|
9
|
+
version: 1.9.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Michael Hellein
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2013-12-09 00:00:00 -05:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
type: :runtime
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
segments:
|
27
|
+
- 0
|
28
|
+
- 11
|
29
|
+
version: "0.11"
|
30
|
+
name: compass
|
31
|
+
requirement: *id001
|
32
|
+
prerelease: false
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
type: :development
|
35
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - ~>
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
segments:
|
40
|
+
- 1
|
41
|
+
- 3
|
42
|
+
version: "1.3"
|
43
|
+
name: bundler
|
44
|
+
requirement: *id002
|
45
|
+
prerelease: false
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
type: :development
|
48
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
segments:
|
53
|
+
- 0
|
54
|
+
version: "0"
|
55
|
+
name: rake
|
56
|
+
requirement: *id003
|
57
|
+
prerelease: false
|
58
|
+
description: Unofficial bootstrap switch
|
59
|
+
email:
|
60
|
+
- themichaek@gmail.com
|
61
|
+
executables: []
|
62
|
+
|
63
|
+
extensions: []
|
64
|
+
|
65
|
+
extra_rdoc_files: []
|
66
|
+
|
67
|
+
files:
|
68
|
+
- compass/stylesheets/bootstrap-switch.scss
|
69
|
+
- lib/bootstrap-switch.rb
|
70
|
+
- lib/bootstrap-switch/version.rb
|
71
|
+
- static/sass/bootstrap-switch.scss
|
72
|
+
- static/sass/deps/mixins.scss
|
73
|
+
- static/sass/deps/variables.scss
|
74
|
+
has_rdoc: true
|
75
|
+
homepage: ""
|
76
|
+
licenses:
|
77
|
+
- Apache Version 2
|
78
|
+
post_install_message:
|
79
|
+
rdoc_options: []
|
80
|
+
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
segments:
|
88
|
+
- 0
|
89
|
+
version: "0"
|
90
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
segments:
|
95
|
+
- 0
|
96
|
+
version: "0"
|
97
|
+
requirements: []
|
98
|
+
|
99
|
+
rubyforge_project:
|
100
|
+
rubygems_version: 1.3.6
|
101
|
+
signing_key:
|
102
|
+
specification_version: 3
|
103
|
+
summary: Provides a switch-style affordance for checkboxes and radios.
|
104
|
+
test_files: []
|
105
|
+
|