1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 06:38:00 +02:00

Ability to use CDN for core-defined libraries. Ability to select CDN provider.

This commit is contained in:
Lóna Lore
2017-01-08 12:02:10 +01:00
parent 3dee2dc977
commit efeeeb94a4
330 changed files with 63064 additions and 29 deletions

View File

@@ -0,0 +1,39 @@
{
"name": "bootstrap-switch",
"description": "Turn checkboxes and radio buttons in toggle switches.",
"version": "3.3.2",
"main": [
"./dist/js/bootstrap-switch.js",
"./dist/css/bootstrap3/bootstrap-switch.css"
],
"ignore": [
"docs",
"test",
"CNAME",
"coffeelint.json",
"composer.json",
"CONTRIBUTING.md",
"gulpfile.coffee",
"gulpfile.js",
"index.html",
"package.json"
],
"dependencies": {
"bootstrap": ">=2.3.2",
"jquery": ">=1.9.0"
},
"devDependencies": {
"jquery": "~2.1",
"bootstrap": "~3.3"
},
"homepage": "https://github.com/nostalgiaz/bootstrap-switch",
"_release": "3.3.2",
"_resolution": {
"type": "version",
"tag": "v3.3.2",
"commit": "ec69b5dd914dacb19cf1fa8e1be7eea6bcc7b083"
},
"_source": "https://github.com/nostalgiaz/bootstrap-switch.git",
"_target": "3.x",
"_originalSource": "bootstrap-switch"
}

View File

@@ -0,0 +1,3 @@
{
"directory": "components"
}

View File

@@ -0,0 +1,5 @@
.grunt
npm-debug.log
node_modules
components
.DS_Store

View File

@@ -0,0 +1,71 @@
# Changelog
## 3.3.2
- Fix for Flicker on initialisation [#425](https://github.com/nostalgiaz/bootstrap-switch/issues/425), [#422](https://github.com/nostalgiaz/bootstrap-switch/issues/422)
- Prevent horizontal misalignment inside modal in page with odd width [#414](https://github.com/nostalgiaz/bootstrap-switch/issues/414)
## 3.3.1
- Revert of switchChange event triggered only on falsy skip [#411](https://github.com/nostalgiaz/bootstrap-switch/issues/411)
## 3.3.0
- Fixed setting of correct state on drag from indeterminate state [#403](https://github.com/nostalgiaz/bootstrap-switch/issues/403)
- Fixed broken state changing on hidden switch [#392, [#383](https://github.com/nostalgiaz/bootstrap-switch/issues/383)
- Missing animation on first state change triggered by side click [#390](https://github.com/nostalgiaz/bootstrap-switch/issues/390)
- SwitchChange event always triggered after change event [#389](https://github.com/nostalgiaz/bootstrap-switch/issues/389)
- Skip check for transitionend event on init [#381](https://github.com/nostalgiaz/bootstrap-switch/issues/381)
- Added stopPropagation on element mousedown [#369](https://github.com/nostalgiaz/bootstrap-switch/issues/369)
- Fixed wrong descrition in documentation [#351](https://github.com/nostalgiaz/bootstrap-switch/issues/351)
## 3.2.2
- Fixed wrong rendering of switch on initialisation if element is hidden [#376](https://github.com/nostalgiaz/bootstrap-switch/issues/376)
## 3.2.1
- Hotfix for broken initialisation logic if $.support.transition is not set [#375](https://github.com/nostalgiaz/bootstrap-switch/issues/375)
## 3.2.0
- Added option and method handleWidth to set a specific width of the side handled [#341](https://github.com/nostalgiaz/bootstrap-switch/issues/341)
- Added option and method labelWidth to set a specific width of the center label [#341](https://github.com/nostalgiaz/bootstrap-switch/issues/341)
- Fixed broken toggling of side handles when switch is wrapped in a external label [#359](https://github.com/nostalgiaz/bootstrap-switch/issues/359)
- Minor refactoring all along the source code
## 3.1.0
- Added inverse option to swap the position of the left and right elements [#207](https://github.com/nostalgiaz/bootstrap-switch/issues/207)
- Fixed misalignment on Safari [#223](https://github.com/nostalgiaz/bootstrap-switch/issues/223)
- Added options toggleAnimate method
- Enhanced documentation with new examples
## 3.0.2
- Added radioAllOff option. allow a group of radio inputs to be all off [#322](https://github.com/nostalgiaz/bootstrap-switch/issues/322)
- Made HTML options overridable by JavaScript initalization options [#319](https://github.com/nostalgiaz/bootstrap-switch/issues/319)
- .form-control does not interfere anymore with the switch appearance [#318](https://github.com/nostalgiaz/bootstrap-switch/issues/318)
- Fixed triggering of two events in case of jQuery id selector [#317](https://github.com/nostalgiaz/bootstrap-switch/issues/317)
- Fixed internal switching loop when toggling with spacebar [#316](https://github.com/nostalgiaz/bootstrap-switch/issues/316)
- Fixed switch label toggling not working with radio inputs [#312](https://github.com/nostalgiaz/bootstrap-switch/issues/312)
## 3.0.1
- Added support for intermediate state [#218](https://github.com/nostalgiaz/bootstrap-switch/issues/218)
- Added change event triggered on label click [#299](https://github.com/nostalgiaz/bootstrap-switch/issues/299)
- Added onInit and onSwitchChange event as methods
## 3.0.0
- API redesign for a more intuitive use
- Entire code source rewriting focused on cleanliness and performance
- Initialization options can be passed as JavaScript object or written as data-*
- Plugin constructor publicly available from $.fn.bootstrapSwitch.Constructor
- Plugin instance publicly available calling .data('bootstrap-switch')
- Global overridable defaults options
- Improved flexibility with baseClass and wrapperClass options
- New onInit event
- Event namespacing
- Full Bootstrap 3 support
- A lot of fixed bug, as usual

View File

@@ -0,0 +1,176 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

View File

@@ -0,0 +1,75 @@
# Bootstrap Switch
[![Dependency Status](https://david-dm.org/nostalgiaz/bootstrap-switch.svg?style=flat)](https://david-dm.org/nostalgiaz/bootstrap-switch)
[![devDependency Status](https://david-dm.org/nostalgiaz/bootstrap-switch/dev-status.svg?style=flat)](https://david-dm.org/nostalgiaz/bootstrap-switch#info=devDependencies)
[![NPM Version](http://img.shields.io/npm/v/bootstrap-switch.svg?style=flat)](https://www.npmjs.org/)
Turn checkboxes and radio buttons in toggle switches.
## Contribute
Hi, Emanuele here. I am currently the sole contributor of Bootstrap Switch and have been mantaining it for quite a considerable amount of time.
The development pace is strongly affected by the personal lack of time and a missing core team behind the project.
It would be nice to have someone available for clearing the list of open issues and occasionally implementing new functionalities.
If interest, you can drop me a line or pick a bug, kill it and open a Pull Request against `develop` branch.
Many thanks.
## Demo and Documentation
- [Examples](http://www.bootstrap-switch.org/examples.html)
- [Options](http://www.bootstrap-switch.org/options.html)
- [Methods](http://www.bootstrap-switch.org/methods.html)
- [Events](http://www.bootstrap-switch.org/events.html)
## Getting started
Include the dependencies: jQuery, Bootstrap and Bootstrap Switch CSS + Javascript:
``` html
[...]
<link href="bootstrap.css" rel="stylesheet">
<link href="bootstrap-switch.css" rel="stylesheet">
<script src="jquery.js"></script>
<script src="bootstrap-switch.js"></script>
[...]
```
Add your checkbox:
```html
<input type="checkbox" name="my-checkbox" checked>
```
Initialize Bootstrap Switch on it:
```javascript
$("[name='my-checkbox']").bootstrapSwitch();
```
Enjoy.
## Less
If you want to use your bootstrap variables, include `bootstrap-switch.less` in your compilation stack. You can even choose among Bootstrap versions 2.3.2 or 3.*.* compatible source.
## AngularJs
Two custom directives are available:
- [angular-bootstrap-switch](https://github.com/frapontillo/angular-bootstrap-switch)
- [angular-toggle-switch](https://github.com/JumpLink/angular-toggle-switch)
## KnockoutJs
A Knockout binding handler is available [here](https://github.com/pauloortins/knockout-bootstrap-switch)
## NuGet
A NuGet package is available [here](https://github.com/blachniet/bootstrap-switch-nuget)
## Supported browsers
IE9+ and all the other modern browsers.
## License
Licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0

View File

@@ -0,0 +1,29 @@
{
"name": "bootstrap-switch",
"description": "Turn checkboxes and radio buttons in toggle switches.",
"version": "3.3.2",
"main": [
"./dist/js/bootstrap-switch.js",
"./dist/css/bootstrap3/bootstrap-switch.css"
],
"ignore": [
"docs",
"test",
"CNAME",
"coffeelint.json",
"composer.json",
"CONTRIBUTING.md",
"gulpfile.coffee",
"gulpfile.js",
"index.html",
"package.json"
],
"dependencies": {
"bootstrap": ">=2.3.2",
"jquery": ">=1.9.0"
},
"devDependencies": {
"jquery": "~2.1",
"bootstrap": "~3.3"
}
}

View File

@@ -0,0 +1,519 @@
/* ========================================================================
* bootstrap-switch - v3.3.2
* http://www.bootstrap-switch.org
* ========================================================================
* Copyright 2012-2013 Mattia Larentis
*
* ========================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================================
*/
.clearfix {
*zoom: 1;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
line-height: 0;
}
.clearfix:after {
clear: both;
}
.hide-text {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.input-block-level {
display: block;
width: 100%;
min-height: 30px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.bootstrap-switch {
display: inline-block;
direction: ltr;
cursor: pointer;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 1px solid;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
position: relative;
text-align: left;
overflow: hidden;
line-height: 8px;
z-index: 0;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
vertical-align: middle;
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-moz-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.bootstrap-switch .bootstrap-switch-container {
display: inline-block;
top: 0;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-o-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.bootstrap-switch .bootstrap-switch-handle-on,
.bootstrap-switch .bootstrap-switch-handle-off,
.bootstrap-switch .bootstrap-switch-label {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
cursor: pointer;
display: inline-block !important;
height: 100%;
padding-top: 4px;
padding-bottom: 4px;
padding-left: 8px;
padding-right: 8px;
font-size: 14px;
line-height: 20px;
}
.bootstrap-switch .bootstrap-switch-handle-on,
.bootstrap-switch .bootstrap-switch-handle-off {
text-align: center;
z-index: 1;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #005fcc;
background-image: -moz-linear-gradient(top, #0044cc, #0088cc);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0044cc), to(#0088cc));
background-image: -webkit-linear-gradient(top, #0044cc, #0088cc);
background-image: -o-linear-gradient(top, #0044cc, #0088cc);
background-image: linear-gradient(to bottom, #0044cc, #0088cc);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0044cc', endColorstr='#ff0088cc', GradientType=0);
border-color: #0088cc #0088cc #005580;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #0088cc;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary:hover,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary:hover,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary:focus,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary:focus,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary:active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary:active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary.active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary.active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary.disabled,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary.disabled,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary[disabled],
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary[disabled] {
color: #ffffff;
background-color: #0088cc;
*background-color: #0077b3;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary:active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary:active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary.active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary.active {
background-color: #006699 \9;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #41a7c5;
background-image: -moz-linear-gradient(top, #2f96b4, #5bc0de);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#2f96b4), to(#5bc0de));
background-image: -webkit-linear-gradient(top, #2f96b4, #5bc0de);
background-image: -o-linear-gradient(top, #2f96b4, #5bc0de);
background-image: linear-gradient(to bottom, #2f96b4, #5bc0de);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff2f96b4', endColorstr='#ff5bc0de', GradientType=0);
border-color: #5bc0de #5bc0de #28a1c5;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #5bc0de;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info:hover,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info:hover,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info:focus,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info:focus,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info:active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info:active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info.active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info.active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info.disabled,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info.disabled,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info[disabled],
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info[disabled] {
color: #ffffff;
background-color: #5bc0de;
*background-color: #46b8da;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info:active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info:active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info.active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info.active {
background-color: #31b0d5 \9;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #58b058;
background-image: -moz-linear-gradient(top, #51a351, #62c462);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#51a351), to(#62c462));
background-image: -webkit-linear-gradient(top, #51a351, #62c462);
background-image: -o-linear-gradient(top, #51a351, #62c462);
background-image: linear-gradient(to bottom, #51a351, #62c462);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff51a351', endColorstr='#ff62c462', GradientType=0);
border-color: #62c462 #62c462 #3b9e3b;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #62c462;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success:hover,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success:hover,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success:focus,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success:focus,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success:active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success:active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success.active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success.active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success.disabled,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success.disabled,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success[disabled],
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success[disabled] {
color: #ffffff;
background-color: #62c462;
*background-color: #4fbd4f;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success:active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success:active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success.active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success.active {
background-color: #42b142 \9;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #f9a123;
background-image: -moz-linear-gradient(top, #f89406, #fbb450);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f89406), to(#fbb450));
background-image: -webkit-linear-gradient(top, #f89406, #fbb450);
background-image: -o-linear-gradient(top, #f89406, #fbb450);
background-image: linear-gradient(to bottom, #f89406, #fbb450);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff89406', endColorstr='#fffbb450', GradientType=0);
border-color: #fbb450 #fbb450 #f89406;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #fbb450;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning:hover,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning:hover,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning:focus,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning:focus,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning:active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning:active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning.active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning.active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning.disabled,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning.disabled,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning[disabled],
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning[disabled] {
color: #ffffff;
background-color: #fbb450;
*background-color: #faa937;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning:active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning:active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning.active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning.active {
background-color: #fa9f1e \9;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #d14641;
background-image: -moz-linear-gradient(top, #bd362f, #ee5f5b);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#bd362f), to(#ee5f5b));
background-image: -webkit-linear-gradient(top, #bd362f, #ee5f5b);
background-image: -o-linear-gradient(top, #bd362f, #ee5f5b);
background-image: linear-gradient(to bottom, #bd362f, #ee5f5b);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffbd362f', endColorstr='#ffee5f5b', GradientType=0);
border-color: #ee5f5b #ee5f5b #e51d18;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #ee5f5b;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger:hover,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger:hover,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger:focus,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger:focus,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger:active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger:active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger.active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger.active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger.disabled,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger.disabled,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger[disabled],
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger[disabled] {
color: #ffffff;
background-color: #ee5f5b;
*background-color: #ec4844;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger:active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger:active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger.active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger.active {
background-color: #e9322d \9;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default {
color: #333333;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
background-color: #f0f0f0;
background-image: -moz-linear-gradient(top, #e6e6e6, #ffffff);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#ffffff));
background-image: -webkit-linear-gradient(top, #e6e6e6, #ffffff);
background-image: -o-linear-gradient(top, #e6e6e6, #ffffff);
background-image: linear-gradient(to bottom, #e6e6e6, #ffffff);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0);
border-color: #ffffff #ffffff #d9d9d9;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #ffffff;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default:hover,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default:hover,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default:focus,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default:focus,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default:active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default:active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default.active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default.active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default.disabled,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default.disabled,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default[disabled],
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default[disabled] {
color: #333333;
background-color: #ffffff;
*background-color: #f2f2f2;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default:active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default:active,
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default.active,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default.active {
background-color: #e6e6e6 \9;
}
.bootstrap-switch .bootstrap-switch-label {
text-align: center;
margin-top: -1px;
margin-bottom: -1px;
z-index: 100;
border-left: 1px solid #cccccc;
border-right: 1px solid #cccccc;
color: #333333;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #e6e6e6;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.bootstrap-switch .bootstrap-switch-label:hover,
.bootstrap-switch .bootstrap-switch-label:focus,
.bootstrap-switch .bootstrap-switch-label:active,
.bootstrap-switch .bootstrap-switch-label.active,
.bootstrap-switch .bootstrap-switch-label.disabled,
.bootstrap-switch .bootstrap-switch-label[disabled] {
color: #333333;
background-color: #e6e6e6;
*background-color: #d9d9d9;
}
.bootstrap-switch .bootstrap-switch-label:active,
.bootstrap-switch .bootstrap-switch-label.active {
background-color: #cccccc \9;
}
.bootstrap-switch .bootstrap-switch-handle-on {
-webkit-border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
border-top-left-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
border-bottom-left-radius: 4px;
}
.bootstrap-switch .bootstrap-switch-handle-off {
-webkit-border-top-right-radius: 4px;
-moz-border-radius-topright: 4px;
border-top-right-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
border-bottom-right-radius: 4px;
}
.bootstrap-switch input[type='radio'],
.bootstrap-switch input[type='checkbox'] {
position: absolute !important;
top: 0;
left: 0;
opacity: 0;
filter: alpha(opacity=0);
z-index: -1;
}
.bootstrap-switch input[type='radio'].form-control,
.bootstrap-switch input[type='checkbox'].form-control {
height: auto;
}
.bootstrap-switch.bootstrap-switch-mini {
min-width: 71px;
}
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label {
padding: 3px 6px;
font-size: 10px;
line-height: 9px;
}
.bootstrap-switch.bootstrap-switch-small {
min-width: 79px;
}
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label {
padding: 3px 6px;
font-size: 12px;
line-height: 18px;
}
.bootstrap-switch.bootstrap-switch-large {
min-width: 120px;
}
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label {
padding: 9px 12px;
font-size: 16px;
line-height: normal;
}
.bootstrap-switch.bootstrap-switch-disabled,
.bootstrap-switch.bootstrap-switch-readonly,
.bootstrap-switch.bootstrap-switch-indeterminate {
cursor: default !important;
}
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label {
opacity: 0.5;
filter: alpha(opacity=50);
cursor: default !important;
}
.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container {
-webkit-transition: margin-left 0.5s;
-moz-transition: margin-left 0.5s;
-o-transition: margin-left 0.5s;
transition: margin-left 0.5s;
}
.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on {
-webkit-border-top-left-radius: 0;
-moz-border-radius-topleft: 0;
border-top-left-radius: 0;
-webkit-border-bottom-left-radius: 0;
-moz-border-radius-bottomleft: 0;
border-bottom-left-radius: 0;
-webkit-border-top-right-radius: 4px;
-moz-border-radius-topright: 4px;
border-top-right-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
border-bottom-right-radius: 4px;
}
.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off {
-webkit-border-top-right-radius: 0;
-moz-border-radius-topright: 0;
border-top-right-radius: 0;
-webkit-border-bottom-right-radius: 0;
-moz-border-radius-bottomright: 0;
border-bottom-right-radius: 0;
-webkit-border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
border-top-left-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
border-bottom-left-radius: 4px;
}
.bootstrap-switch.bootstrap-switch-focused {
border-color: rgba(82, 168, 236, 0.8);
outline: 0;
outline: thin dotted \9;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82, 168, 236, .6);
-moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82, 168, 236, .6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82, 168, 236, .6);
}
.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label {
-webkit-border-top-right-radius: 4px;
-moz-border-radius-topright: 4px;
border-top-right-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
-moz-border-radius-bottomright: 4px;
border-bottom-right-radius: 4px;
}
.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label {
-webkit-border-top-left-radius: 4px;
-moz-border-radius-topleft: 4px;
border-top-left-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-bottomleft: 4px;
border-bottom-left-radius: 4px;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,196 @@
/* ========================================================================
* bootstrap-switch - v3.3.2
* http://www.bootstrap-switch.org
* ========================================================================
* Copyright 2012-2013 Mattia Larentis
*
* ========================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================================
*/
.bootstrap-switch {
display: inline-block;
direction: ltr;
cursor: pointer;
border-radius: 4px;
border: 1px solid;
border-color: #cccccc;
position: relative;
text-align: left;
overflow: hidden;
line-height: 8px;
z-index: 0;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
vertical-align: middle;
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.bootstrap-switch .bootstrap-switch-container {
display: inline-block;
top: 0;
border-radius: 4px;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
.bootstrap-switch .bootstrap-switch-handle-on,
.bootstrap-switch .bootstrap-switch-handle-off,
.bootstrap-switch .bootstrap-switch-label {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
cursor: pointer;
display: inline-block !important;
height: 100%;
padding: 6px 12px;
font-size: 14px;
line-height: 20px;
}
.bootstrap-switch .bootstrap-switch-handle-on,
.bootstrap-switch .bootstrap-switch-handle-off {
text-align: center;
z-index: 1;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-primary {
color: #fff;
background: #428bca;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-info,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-info {
color: #fff;
background: #5bc0de;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-success {
color: #fff;
background: #5cb85c;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-warning,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-warning {
background: #f0ad4e;
color: #fff;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-danger,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-danger {
color: #fff;
background: #d9534f;
}
.bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-default,
.bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default {
color: #000;
background: #eeeeee;
}
.bootstrap-switch .bootstrap-switch-label {
text-align: center;
margin-top: -1px;
margin-bottom: -1px;
z-index: 100;
color: #333333;
background: #ffffff;
}
.bootstrap-switch .bootstrap-switch-handle-on {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.bootstrap-switch .bootstrap-switch-handle-off {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.bootstrap-switch input[type='radio'],
.bootstrap-switch input[type='checkbox'] {
position: absolute !important;
top: 0;
left: 0;
opacity: 0;
filter: alpha(opacity=0);
z-index: -1;
}
.bootstrap-switch input[type='radio'].form-control,
.bootstrap-switch input[type='checkbox'].form-control {
height: auto;
}
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-mini .bootstrap-switch-label {
padding: 1px 5px;
font-size: 12px;
line-height: 1.5;
}
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-small .bootstrap-switch-label {
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
}
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-large .bootstrap-switch-label {
padding: 6px 16px;
font-size: 18px;
line-height: 1.33;
}
.bootstrap-switch.bootstrap-switch-disabled,
.bootstrap-switch.bootstrap-switch-readonly,
.bootstrap-switch.bootstrap-switch-indeterminate {
cursor: default !important;
}
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-on,
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-handle-off,
.bootstrap-switch.bootstrap-switch-disabled .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-readonly .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-indeterminate .bootstrap-switch-label {
opacity: 0.5;
filter: alpha(opacity=50);
cursor: default !important;
}
.bootstrap-switch.bootstrap-switch-animate .bootstrap-switch-container {
-webkit-transition: margin-left 0.5s;
transition: margin-left 0.5s;
}
.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-on {
border-bottom-left-radius: 0;
border-top-left-radius: 0;
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.bootstrap-switch.bootstrap-switch-inverse .bootstrap-switch-handle-off {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}
.bootstrap-switch.bootstrap-switch-focused {
border-color: #66afe9;
outline: 0;
-webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);
}
.bootstrap-switch.bootstrap-switch-on .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-off .bootstrap-switch-label {
border-bottom-right-radius: 3px;
border-top-right-radius: 3px;
}
.bootstrap-switch.bootstrap-switch-off .bootstrap-switch-label,
.bootstrap-switch.bootstrap-switch-inverse.bootstrap-switch-on .bootstrap-switch-label {
border-bottom-left-radius: 3px;
border-top-left-radius: 3px;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,710 @@
/* ========================================================================
* bootstrap-switch - v3.3.2
* http://www.bootstrap-switch.org
* ========================================================================
* Copyright 2012-2013 Mattia Larentis
*
* ========================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================================
*/
(function() {
var __slice = [].slice;
(function($, window) {
"use strict";
var BootstrapSwitch;
BootstrapSwitch = (function() {
function BootstrapSwitch(element, options) {
if (options == null) {
options = {};
}
this.$element = $(element);
this.options = $.extend({}, $.fn.bootstrapSwitch.defaults, {
state: this.$element.is(":checked"),
size: this.$element.data("size"),
animate: this.$element.data("animate"),
disabled: this.$element.is(":disabled"),
readonly: this.$element.is("[readonly]"),
indeterminate: this.$element.data("indeterminate"),
inverse: this.$element.data("inverse"),
radioAllOff: this.$element.data("radio-all-off"),
onColor: this.$element.data("on-color"),
offColor: this.$element.data("off-color"),
onText: this.$element.data("on-text"),
offText: this.$element.data("off-text"),
labelText: this.$element.data("label-text"),
handleWidth: this.$element.data("handle-width"),
labelWidth: this.$element.data("label-width"),
baseClass: this.$element.data("base-class"),
wrapperClass: this.$element.data("wrapper-class")
}, options);
this.$wrapper = $("<div>", {
"class": (function(_this) {
return function() {
var classes;
classes = ["" + _this.options.baseClass].concat(_this._getClasses(_this.options.wrapperClass));
classes.push(_this.options.state ? "" + _this.options.baseClass + "-on" : "" + _this.options.baseClass + "-off");
if (_this.options.size != null) {
classes.push("" + _this.options.baseClass + "-" + _this.options.size);
}
if (_this.options.disabled) {
classes.push("" + _this.options.baseClass + "-disabled");
}
if (_this.options.readonly) {
classes.push("" + _this.options.baseClass + "-readonly");
}
if (_this.options.indeterminate) {
classes.push("" + _this.options.baseClass + "-indeterminate");
}
if (_this.options.inverse) {
classes.push("" + _this.options.baseClass + "-inverse");
}
if (_this.$element.attr("id")) {
classes.push("" + _this.options.baseClass + "-id-" + (_this.$element.attr("id")));
}
return classes.join(" ");
};
})(this)()
});
this.$container = $("<div>", {
"class": "" + this.options.baseClass + "-container"
});
this.$on = $("<span>", {
html: this.options.onText,
"class": "" + this.options.baseClass + "-handle-on " + this.options.baseClass + "-" + this.options.onColor
});
this.$off = $("<span>", {
html: this.options.offText,
"class": "" + this.options.baseClass + "-handle-off " + this.options.baseClass + "-" + this.options.offColor
});
this.$label = $("<span>", {
html: this.options.labelText,
"class": "" + this.options.baseClass + "-label"
});
this.$element.on("init.bootstrapSwitch", (function(_this) {
return function() {
return _this.options.onInit.apply(element, arguments);
};
})(this));
this.$element.on("switchChange.bootstrapSwitch", (function(_this) {
return function() {
return _this.options.onSwitchChange.apply(element, arguments);
};
})(this));
this.$container = this.$element.wrap(this.$container).parent();
this.$wrapper = this.$container.wrap(this.$wrapper).parent();
this.$element.before(this.options.inverse ? this.$off : this.$on).before(this.$label).before(this.options.inverse ? this.$on : this.$off);
if (this.options.indeterminate) {
this.$element.prop("indeterminate", true);
}
this._init();
this._elementHandlers();
this._handleHandlers();
this._labelHandlers();
this._formHandler();
this._externalLabelHandler();
this.$element.trigger("init.bootstrapSwitch");
}
BootstrapSwitch.prototype._constructor = BootstrapSwitch;
BootstrapSwitch.prototype.state = function(value, skip) {
if (typeof value === "undefined") {
return this.options.state;
}
if (this.options.disabled || this.options.readonly) {
return this.$element;
}
if (this.options.state && !this.options.radioAllOff && this.$element.is(":radio")) {
return this.$element;
}
if (this.options.indeterminate) {
this.indeterminate(false);
}
value = !!value;
this.$element.prop("checked", value).trigger("change.bootstrapSwitch", skip);
return this.$element;
};
BootstrapSwitch.prototype.toggleState = function(skip) {
if (this.options.disabled || this.options.readonly) {
return this.$element;
}
if (this.options.indeterminate) {
this.indeterminate(false);
return this.state(true);
} else {
return this.$element.prop("checked", !this.options.state).trigger("change.bootstrapSwitch", skip);
}
};
BootstrapSwitch.prototype.size = function(value) {
if (typeof value === "undefined") {
return this.options.size;
}
if (this.options.size != null) {
this.$wrapper.removeClass("" + this.options.baseClass + "-" + this.options.size);
}
if (value) {
this.$wrapper.addClass("" + this.options.baseClass + "-" + value);
}
this._width();
this._containerPosition();
this.options.size = value;
return this.$element;
};
BootstrapSwitch.prototype.animate = function(value) {
if (typeof value === "undefined") {
return this.options.animate;
}
value = !!value;
if (value === this.options.animate) {
return this.$element;
}
return this.toggleAnimate();
};
BootstrapSwitch.prototype.toggleAnimate = function() {
this.options.animate = !this.options.animate;
this.$wrapper.toggleClass("" + this.options.baseClass + "-animate");
return this.$element;
};
BootstrapSwitch.prototype.disabled = function(value) {
if (typeof value === "undefined") {
return this.options.disabled;
}
value = !!value;
if (value === this.options.disabled) {
return this.$element;
}
return this.toggleDisabled();
};
BootstrapSwitch.prototype.toggleDisabled = function() {
this.options.disabled = !this.options.disabled;
this.$element.prop("disabled", this.options.disabled);
this.$wrapper.toggleClass("" + this.options.baseClass + "-disabled");
return this.$element;
};
BootstrapSwitch.prototype.readonly = function(value) {
if (typeof value === "undefined") {
return this.options.readonly;
}
value = !!value;
if (value === this.options.readonly) {
return this.$element;
}
return this.toggleReadonly();
};
BootstrapSwitch.prototype.toggleReadonly = function() {
this.options.readonly = !this.options.readonly;
this.$element.prop("readonly", this.options.readonly);
this.$wrapper.toggleClass("" + this.options.baseClass + "-readonly");
return this.$element;
};
BootstrapSwitch.prototype.indeterminate = function(value) {
if (typeof value === "undefined") {
return this.options.indeterminate;
}
value = !!value;
if (value === this.options.indeterminate) {
return this.$element;
}
return this.toggleIndeterminate();
};
BootstrapSwitch.prototype.toggleIndeterminate = function() {
this.options.indeterminate = !this.options.indeterminate;
this.$element.prop("indeterminate", this.options.indeterminate);
this.$wrapper.toggleClass("" + this.options.baseClass + "-indeterminate");
this._containerPosition();
return this.$element;
};
BootstrapSwitch.prototype.inverse = function(value) {
if (typeof value === "undefined") {
return this.options.inverse;
}
value = !!value;
if (value === this.options.inverse) {
return this.$element;
}
return this.toggleInverse();
};
BootstrapSwitch.prototype.toggleInverse = function() {
var $off, $on;
this.$wrapper.toggleClass("" + this.options.baseClass + "-inverse");
$on = this.$on.clone(true);
$off = this.$off.clone(true);
this.$on.replaceWith($off);
this.$off.replaceWith($on);
this.$on = $off;
this.$off = $on;
this.options.inverse = !this.options.inverse;
return this.$element;
};
BootstrapSwitch.prototype.onColor = function(value) {
var color;
color = this.options.onColor;
if (typeof value === "undefined") {
return color;
}
if (color != null) {
this.$on.removeClass("" + this.options.baseClass + "-" + color);
}
this.$on.addClass("" + this.options.baseClass + "-" + value);
this.options.onColor = value;
return this.$element;
};
BootstrapSwitch.prototype.offColor = function(value) {
var color;
color = this.options.offColor;
if (typeof value === "undefined") {
return color;
}
if (color != null) {
this.$off.removeClass("" + this.options.baseClass + "-" + color);
}
this.$off.addClass("" + this.options.baseClass + "-" + value);
this.options.offColor = value;
return this.$element;
};
BootstrapSwitch.prototype.onText = function(value) {
if (typeof value === "undefined") {
return this.options.onText;
}
this.$on.html(value);
this._width();
this._containerPosition();
this.options.onText = value;
return this.$element;
};
BootstrapSwitch.prototype.offText = function(value) {
if (typeof value === "undefined") {
return this.options.offText;
}
this.$off.html(value);
this._width();
this._containerPosition();
this.options.offText = value;
return this.$element;
};
BootstrapSwitch.prototype.labelText = function(value) {
if (typeof value === "undefined") {
return this.options.labelText;
}
this.$label.html(value);
this._width();
this.options.labelText = value;
return this.$element;
};
BootstrapSwitch.prototype.handleWidth = function(value) {
if (typeof value === "undefined") {
return this.options.handleWidth;
}
this.options.handleWidth = value;
this._width();
this._containerPosition();
return this.$element;
};
BootstrapSwitch.prototype.labelWidth = function(value) {
if (typeof value === "undefined") {
return this.options.labelWidth;
}
this.options.labelWidth = value;
this._width();
this._containerPosition();
return this.$element;
};
BootstrapSwitch.prototype.baseClass = function(value) {
return this.options.baseClass;
};
BootstrapSwitch.prototype.wrapperClass = function(value) {
if (typeof value === "undefined") {
return this.options.wrapperClass;
}
if (!value) {
value = $.fn.bootstrapSwitch.defaults.wrapperClass;
}
this.$wrapper.removeClass(this._getClasses(this.options.wrapperClass).join(" "));
this.$wrapper.addClass(this._getClasses(value).join(" "));
this.options.wrapperClass = value;
return this.$element;
};
BootstrapSwitch.prototype.radioAllOff = function(value) {
if (typeof value === "undefined") {
return this.options.radioAllOff;
}
value = !!value;
if (value === this.options.radioAllOff) {
return this.$element;
}
this.options.radioAllOff = value;
return this.$element;
};
BootstrapSwitch.prototype.onInit = function(value) {
if (typeof value === "undefined") {
return this.options.onInit;
}
if (!value) {
value = $.fn.bootstrapSwitch.defaults.onInit;
}
this.options.onInit = value;
return this.$element;
};
BootstrapSwitch.prototype.onSwitchChange = function(value) {
if (typeof value === "undefined") {
return this.options.onSwitchChange;
}
if (!value) {
value = $.fn.bootstrapSwitch.defaults.onSwitchChange;
}
this.options.onSwitchChange = value;
return this.$element;
};
BootstrapSwitch.prototype.destroy = function() {
var $form;
$form = this.$element.closest("form");
if ($form.length) {
$form.off("reset.bootstrapSwitch").removeData("bootstrap-switch");
}
this.$container.children().not(this.$element).remove();
this.$element.unwrap().unwrap().off(".bootstrapSwitch").removeData("bootstrap-switch");
return this.$element;
};
BootstrapSwitch.prototype._width = function() {
var $handles, handleWidth;
$handles = this.$on.add(this.$off);
$handles.add(this.$label).css("width", "");
handleWidth = this.options.handleWidth === "auto" ? Math.max(this.$on.width(), this.$off.width()) : this.options.handleWidth;
$handles.width(handleWidth);
this.$label.width((function(_this) {
return function(index, width) {
if (_this.options.labelWidth !== "auto") {
return _this.options.labelWidth;
}
if (width < handleWidth) {
return handleWidth;
} else {
return width;
}
};
})(this));
this._handleWidth = this.$on.outerWidth();
this._labelWidth = this.$label.outerWidth();
this.$container.width((this._handleWidth * 2) + this._labelWidth);
return this.$wrapper.width(this._handleWidth + this._labelWidth);
};
BootstrapSwitch.prototype._containerPosition = function(state, callback) {
if (state == null) {
state = this.options.state;
}
this.$container.css("margin-left", (function(_this) {
return function() {
var values;
values = [0, "-" + _this._handleWidth + "px"];
if (_this.options.indeterminate) {
return "-" + (_this._handleWidth / 2) + "px";
}
if (state) {
if (_this.options.inverse) {
return values[1];
} else {
return values[0];
}
} else {
if (_this.options.inverse) {
return values[0];
} else {
return values[1];
}
}
};
})(this));
if (!callback) {
return;
}
return setTimeout(function() {
return callback();
}, 50);
};
BootstrapSwitch.prototype._init = function() {
var init, initInterval;
init = (function(_this) {
return function() {
_this._width();
return _this._containerPosition(null, function() {
if (_this.options.animate) {
return _this.$wrapper.addClass("" + _this.options.baseClass + "-animate");
}
});
};
})(this);
if (this.$wrapper.is(":visible")) {
return init();
}
return initInterval = window.setInterval((function(_this) {
return function() {
if (_this.$wrapper.is(":visible")) {
init();
return window.clearInterval(initInterval);
}
};
})(this), 50);
};
BootstrapSwitch.prototype._elementHandlers = function() {
return this.$element.on({
"change.bootstrapSwitch": (function(_this) {
return function(e, skip) {
var state;
e.preventDefault();
e.stopImmediatePropagation();
state = _this.$element.is(":checked");
_this._containerPosition(state);
if (state === _this.options.state) {
return;
}
_this.options.state = state;
_this.$wrapper.toggleClass("" + _this.options.baseClass + "-off").toggleClass("" + _this.options.baseClass + "-on");
if (!skip) {
if (_this.$element.is(":radio")) {
$("[name='" + (_this.$element.attr('name')) + "']").not(_this.$element).prop("checked", false).trigger("change.bootstrapSwitch", true);
}
return _this.$element.trigger("switchChange.bootstrapSwitch", [state]);
}
};
})(this),
"focus.bootstrapSwitch": (function(_this) {
return function(e) {
e.preventDefault();
return _this.$wrapper.addClass("" + _this.options.baseClass + "-focused");
};
})(this),
"blur.bootstrapSwitch": (function(_this) {
return function(e) {
e.preventDefault();
return _this.$wrapper.removeClass("" + _this.options.baseClass + "-focused");
};
})(this),
"keydown.bootstrapSwitch": (function(_this) {
return function(e) {
if (!e.which || _this.options.disabled || _this.options.readonly) {
return;
}
switch (e.which) {
case 37:
e.preventDefault();
e.stopImmediatePropagation();
return _this.state(false);
case 39:
e.preventDefault();
e.stopImmediatePropagation();
return _this.state(true);
}
};
})(this)
});
};
BootstrapSwitch.prototype._handleHandlers = function() {
this.$on.on("click.bootstrapSwitch", (function(_this) {
return function(event) {
event.preventDefault();
event.stopPropagation();
_this.state(false);
return _this.$element.trigger("focus.bootstrapSwitch");
};
})(this));
return this.$off.on("click.bootstrapSwitch", (function(_this) {
return function(event) {
event.preventDefault();
event.stopPropagation();
_this.state(true);
return _this.$element.trigger("focus.bootstrapSwitch");
};
})(this));
};
BootstrapSwitch.prototype._labelHandlers = function() {
return this.$label.on({
"mousedown.bootstrapSwitch touchstart.bootstrapSwitch": (function(_this) {
return function(e) {
if (_this._dragStart || _this.options.disabled || _this.options.readonly) {
return;
}
e.preventDefault();
e.stopPropagation();
_this._dragStart = (e.pageX || e.originalEvent.touches[0].pageX) - parseInt(_this.$container.css("margin-left"), 10);
if (_this.options.animate) {
_this.$wrapper.removeClass("" + _this.options.baseClass + "-animate");
}
return _this.$element.trigger("focus.bootstrapSwitch");
};
})(this),
"mousemove.bootstrapSwitch touchmove.bootstrapSwitch": (function(_this) {
return function(e) {
var difference;
if (_this._dragStart == null) {
return;
}
e.preventDefault();
difference = (e.pageX || e.originalEvent.touches[0].pageX) - _this._dragStart;
if (difference < -_this._handleWidth || difference > 0) {
return;
}
_this._dragEnd = difference;
return _this.$container.css("margin-left", "" + _this._dragEnd + "px");
};
})(this),
"mouseup.bootstrapSwitch touchend.bootstrapSwitch": (function(_this) {
return function(e) {
var state;
if (!_this._dragStart) {
return;
}
e.preventDefault();
if (_this.options.animate) {
_this.$wrapper.addClass("" + _this.options.baseClass + "-animate");
}
if (_this._dragEnd) {
state = _this._dragEnd > -(_this._handleWidth / 2);
_this._dragEnd = false;
_this.state(_this.options.inverse ? !state : state);
} else {
_this.state(!_this.options.state);
}
return _this._dragStart = false;
};
})(this),
"mouseleave.bootstrapSwitch": (function(_this) {
return function(e) {
return _this.$label.trigger("mouseup.bootstrapSwitch");
};
})(this)
});
};
BootstrapSwitch.prototype._externalLabelHandler = function() {
var $externalLabel;
$externalLabel = this.$element.closest("label");
return $externalLabel.on("click", (function(_this) {
return function(event) {
event.preventDefault();
event.stopImmediatePropagation();
if (event.target === $externalLabel[0]) {
return _this.toggleState();
}
};
})(this));
};
BootstrapSwitch.prototype._formHandler = function() {
var $form;
$form = this.$element.closest("form");
if ($form.data("bootstrap-switch")) {
return;
}
return $form.on("reset.bootstrapSwitch", function() {
return window.setTimeout(function() {
return $form.find("input").filter(function() {
return $(this).data("bootstrap-switch");
}).each(function() {
return $(this).bootstrapSwitch("state", this.checked);
});
}, 1);
}).data("bootstrap-switch", true);
};
BootstrapSwitch.prototype._getClasses = function(classes) {
var c, cls, _i, _len;
if (!$.isArray(classes)) {
return ["" + this.options.baseClass + "-" + classes];
}
cls = [];
for (_i = 0, _len = classes.length; _i < _len; _i++) {
c = classes[_i];
cls.push("" + this.options.baseClass + "-" + c);
}
return cls;
};
return BootstrapSwitch;
})();
$.fn.bootstrapSwitch = function() {
var args, option, ret;
option = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
ret = this;
this.each(function() {
var $this, data;
$this = $(this);
data = $this.data("bootstrap-switch");
if (!data) {
$this.data("bootstrap-switch", data = new BootstrapSwitch(this, option));
}
if (typeof option === "string") {
return ret = data[option].apply(data, args);
}
});
return ret;
};
$.fn.bootstrapSwitch.Constructor = BootstrapSwitch;
return $.fn.bootstrapSwitch.defaults = {
state: true,
size: null,
animate: true,
disabled: false,
readonly: false,
indeterminate: false,
inverse: false,
radioAllOff: false,
onColor: "primary",
offColor: "default",
onText: "ON",
offText: "OFF",
labelText: "&nbsp;",
handleWidth: "auto",
labelWidth: "auto",
baseClass: "bootstrap-switch",
wrapperClass: "wrapper",
onInit: function() {},
onSwitchChange: function() {}
};
})(window.jQuery, window);
}).call(this);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,320 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Turn checkboxes and radio buttons in toggle switches.">
<meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein">
<title>Bootstrap Switch · Turn checkboxes and radio buttons in toggle switches</title>
<link href="docs/css/bootstrap.min.css" rel="stylesheet">
<link href="docs/css/highlight.css" rel="stylesheet">
<link href="dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet">
<link href="http://getbootstrap.com/assets/css/docs.min.css" rel="stylesheet">
<link href="docs/css/main.css" rel="stylesheet">
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43092768-1']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body><a href="https://github.com/nostalgiaz/bootstrap-switch" id="github"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<header role="banner" class="navbar navbar-static-top bs-docs-nav">
<div class="container">
<div class="navbar-header">
<button type="button" data-toggle="collapse" data-target="#collapse" class="navbar-toggle"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="../" class="navbar-brand">Bootstrap Switch</a>
</div>
<nav id="collapse" role="navigation" class="collapse navbar-collapse bs-navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/master.zip" data-toggle="dropdown">Download</a></li>
<li><a href="examples.html">Examples</a></li>
<li class="dropdown"><a href="#" data-toggle="dropdown">Documentation <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/options.html">Options</a></li>
<li><a href="/methods.html">Methods</a></li>
<li><a href="/events.html">Events</a></li>
<li role="presentation" class="divider"></li>
<li><a href="/documentation-2.html">Documentation (v2.0.1)</a></li>
</ul>
</li>
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
</ul>
</nav>
</div>
</header>
<main id="content" role="main">
<div id="content" class="bs-docs-header">
<div class="container">
<h1>Documentation</h1>
<p>v2.0.1</p>
</div>
</div>
<div class="container">
<div id="options">
<h2 class="page-header">Options</h2>
<div class="alert alert-warning">
<p>
All the options are accepted only using <code>data-*</code> attributes on the element.<br>
<code>checked</code>, <code>disabled</code> and <code>readonly</code> are exception to the rule, being
default HTML input attributes.<br>
Therefore, there is not any way to specify the options in JavaScript during initialization.
</p>
</div>
<table class="table table-bordered table-striped table-responsive">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Values</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>state</td>
<td>Boolean</td>
<td>The checkbox state</td>
<td>true, false</td>
<td>'checked' attribute or true</td>
</tr>
<tr>
<td>size</td>
<td>String</td>
<td>The checkbox state</td>
<td>'', 'mini', 'small', 'normal', 'large'</td>
<td>''</td>
</tr>
<tr>
<td>animate</td>
<td>Boolean</td>
<td>Animate the switch</td>
<td>true, false</td>
<td>true</td>
</tr>
<tr>
<td>disabled</td>
<td>Boolean</td>
<td>Disable state</td>
<td>true, false</td>
<td>'disabled' attribute or false</td>
</tr>
<tr>
<td>readonly</td>
<td>Boolean</td>
<td>Readonly state</td>
<td>true, false</td>
<td>'readonly' attribute or false</td>
</tr>
<tr>
<td>on</td>
<td>String</td>
<td>Color of the left side of the switch</td>
<td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
<td>null</td>
</tr>
<tr>
<td>off</td>
<td>String</td>
<td>Color of the right side of the switch</td>
<td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
<td>null</td>
</tr>
<tr>
<td>on-label</td>
<td>String</td>
<td>Text of the left side of the switch</td>
<td>String</td>
<td>'ON'</td>
</tr>
<tr>
<td>off-label</td>
<td>String</td>
<td>Text of the right side of the switch</td>
<td>String</td>
<td>'OFF'</td>
</tr>
<tr>
<td>text-label</td>
<td>String</td>
<td>Text of the center handle of the switch</td>
<td>String</td>
<td>'&amp;nbsp;'</td>
</tr>
<tr>
<td>label-icon</td>
<td>String</td>
<td>Text of the center handle of the switch. Use to include external services icons</td>
<td>String</td>
<td>null</td>
</tr>
</tbody>
</table>
</div>
<div id="methods">
<h2 class="page-header">Methods</h2>
<table class="table table-bordered table-striped table-responsive">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Accepted Values</th>
<th>Returned Values</th>
</tr>
</thead>
<tbody>
<tr>
<td>state</td>
<td>Get checkbox state</td>
<td></td>
<td>true, false</td>
</tr>
<tr>
<td>setState</td>
<td>Set checkbox state</td>
<td>(value: true, false)[, skip: true, <strong>false</strong>]</td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>toggleState</td>
<td>Toggle checkbox state</td>
<td>[skip: true, <strong>false</strong>]</td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>toggleRadioState</td>
<td>Toggle radio state</td>
<td>[skip: true, <strong>false</strong>]</td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>toggleRadioStateAllowUncheck</td>
<td>Toggle radio state allowing uncheck of the radio input</td>
<td>[uncheck: true, <strong>false</strong> | skip: true, <strong>false</strong>]</td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>setSizeClass</td>
<td>Set the size of the switch</td>
<td>'', 'mini', 'small', 'normal', 'large'</td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>setAnimated</td>
<td>Animate the switch</td>
<td>true, false</td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>isDisabled</td>
<td>Get disabled state</td>
<td></td>
<td>true, false</td>
</tr>
<tr>
<td>setDisabled</td>
<td>Set disable state</td>
<td>true, false</td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>toggleDisabled</td>
<td>Toggle disabled state</td>
<td></td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>isReadOnly</td>
<td>Get Readonly state</td>
<td></td>
<td>true, false</td>
</tr>
<tr>
<td>setReadOnly</td>
<td>Set Readonly state</td>
<td>true, false</td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>toggleReadOnly</td>
<td>Toggle readonly state</td>
<td></td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>setOnClass</td>
<td>Color of the left side of the switch</td>
<td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>setOffClass</td>
<td>Color of the right side of the switch</td>
<td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>setOnLabel</td>
<td>Text of the left side of the switch</td>
<td>String</td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>setOffLabel</td>
<td>Text of the right side of the switch</td>
<td>String</td>
<td>jQuery Object (input element)</td>
</tr>
<tr>
<td>setTextLabel</td>
<td>Text of the center handle of the switch</td>
<td>String</td>
<td>null</td>
</tr>
<tr>
<td>setTextIcon</td>
<td>Text of the center handle of the switch. Use to include external services icons</td>
<td>String</td>
<td>null</td>
</tr>
<tr>
<td>destroy</td>
<td>Destroy the instance of Bootstrap Switch</td>
<td></td>
<td>jQuery Object (input element)</td>
</tr>
</tbody>
</table>
</div>
<div id="events">
<h2 class="page-header">Events</h2>
<p>
The only event triggered it <code>switch-change</code>. It returns two parameters: <code>event</code> and
<code>data</code>.<br>
The latter is an object that include <code>el</code> (the input DOM element) and <code>value</code> (the
new input state)
</p>
</div>
</div>
</main>
<footer class="bs-docs-footer">
<div class="container">
<p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2.0</a><br>Created by <a href="https://github.com/nostalgiaz" target="_blank">Mattia Larentis</a><br>Mantained by <a href="https://github.com/lostcrew" target="_blank">Emanuele Marchi</a>
</p>
</div>
</footer>
<script src="docs/js/jquery.min.js"></script>
<script src="docs/js/bootstrap.min.js"></script>
<script src="docs/js/highlight.js"></script>
<script src="dist/js/bootstrap-switch.js"></script>
<script src="docs/js/main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,108 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Turn checkboxes and radio buttons in toggle switches.">
<meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein">
<title>Bootstrap Switch · Turn checkboxes and radio buttons in toggle switches</title>
<link href="docs/css/bootstrap.min.css" rel="stylesheet">
<link href="docs/css/highlight.css" rel="stylesheet">
<link href="dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet">
<link href="http://getbootstrap.com/assets/css/docs.min.css" rel="stylesheet">
<link href="docs/css/main.css" rel="stylesheet">
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43092768-1']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body><a href="https://github.com/nostalgiaz/bootstrap-switch" id="github"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<header role="banner" class="navbar navbar-static-top bs-docs-nav">
<div class="container">
<div class="navbar-header">
<button type="button" data-toggle="collapse" data-target="#collapse" class="navbar-toggle"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="../" class="navbar-brand">Bootstrap Switch</a>
</div>
<nav id="collapse" role="navigation" class="collapse navbar-collapse bs-navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/master.zip" data-toggle="dropdown">Download</a></li>
<li><a href="examples.html">Examples</a></li>
<li class="dropdown"><a href="#" data-toggle="dropdown">Documentation <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/options.html">Options</a></li>
<li><a href="/methods.html">Methods</a></li>
<li><a href="/events.html">Events</a></li>
<li role="presentation" class="divider"></li>
<li><a href="/documentation-2.html">Documentation (v2.0.1)</a></li>
</ul>
</li>
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
</ul>
</nav>
</div>
</header>
<main id="content" role="main">
<div id="content" class="bs-docs-header">
<div class="container">
<h1>Events</h1>
</div>
</div>
<div class="container">
<p>
All the events are namespaced, therefore always append <code>.bootstrapSwitch</code> when you
attach your handlers.<br>
You can register to the emitted events as follow:
</p>
<pre><code>$('input[name="my-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
console.log(this); // DOM element
console.log(event); // jQuery event
console.log(state); // true | false
});</code></pre>
<table class="table table-bordered table-striped table-responsive">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Parameters</th>
</tr>
</thead>
<tbody>
<tr>
<td>init</td>
<td>Triggered on initialization. 'this' refers to the DOM element.</td>
<td>event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>)</td>
</tr>
<tr>
<td>switchChange</td>
<td>Triggered on switch state change. 'this' refers to the DOM element.</td>
<td>
event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>),
state (true | false)
</td>
</tr>
</tbody>
</table>
</div>
</main>
<footer class="bs-docs-footer">
<div class="container">
<p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2.0</a><br>Created by <a href="https://github.com/nostalgiaz" target="_blank">Mattia Larentis</a><br>Mantained by <a href="https://github.com/lostcrew" target="_blank">Emanuele Marchi</a>
</p>
</div>
</footer>
<script src="docs/js/jquery.min.js"></script>
<script src="docs/js/bootstrap.min.js"></script>
<script src="docs/js/highlight.js"></script>
<script src="dist/js/bootstrap-switch.js"></script>
<script src="docs/js/main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,288 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Turn checkboxes and radio buttons in toggle switches.">
<meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein">
<title>Bootstrap Switch · Turn checkboxes and radio buttons in toggle switches</title>
<link href="docs/css/bootstrap.min.css" rel="stylesheet">
<link href="docs/css/highlight.css" rel="stylesheet">
<link href="dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet">
<link href="http://getbootstrap.com/assets/css/docs.min.css" rel="stylesheet">
<link href="docs/css/main.css" rel="stylesheet">
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43092768-1']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body><a href="https://github.com/nostalgiaz/bootstrap-switch" id="github"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<header role="banner" class="navbar navbar-static-top bs-docs-nav">
<div class="container">
<div class="navbar-header">
<button type="button" data-toggle="collapse" data-target="#collapse" class="navbar-toggle"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="../" class="navbar-brand">Bootstrap Switch</a>
</div>
<nav id="collapse" role="navigation" class="collapse navbar-collapse bs-navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/master.zip" data-toggle="dropdown">Download</a></li>
<li><a href="examples.html">Examples</a></li>
<li class="dropdown"><a href="#" data-toggle="dropdown">Documentation <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/options.html">Options</a></li>
<li><a href="/methods.html">Methods</a></li>
<li><a href="/events.html">Events</a></li>
<li role="presentation" class="divider"></li>
<li><a href="/documentation-2.html">Documentation (v2.0.1)</a></li>
</ul>
</li>
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
</ul>
</nav>
</div>
</header>
<main id="content" role="main">
<div id="content" class="bs-docs-header">
<div class="container">
<h1>Examples</h1>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-sm-6 col-lg-4">
<h2 class="h4">State</h2>
<p>
<input id="switch-state" type="checkbox" checked>
</p>
<div class="btn-group">
<button type="button" data-switch-toggle="state" class="btn btn-default">Toggle</button>
<button type="button" data-switch-set="state" data-switch-value="true" class="btn btn-default">Set true</button>
<button type="button" data-switch-set="state" data-switch-value="false" class="btn btn-default">Set false</button>
<button type="button" data-switch-get="state" class="btn btn-default">Get</button>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">Size</h2>
<p>
<input id="switch-size" type="checkbox" checked data-size="mini">
</p>
<div class="btn-group">
<button type="button" data-switch-set="size" data-switch-value="mini" class="btn btn-default">Mini</button>
<button type="button" data-switch-set="size" data-switch-value="small" class="btn btn-default">Small</button>
<button type="button" data-switch-set="size" data-switch-value="normal" class="btn btn-default">Normal</button>
<button type="button" data-switch-set="size" data-switch-value="large" class="btn btn-default">Large</button>
<button type="button" data-switch-get="size" class="btn btn-default">Get</button>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">Animate</h2>
<p>
<input id="switch-animate" type="checkbox" checked>
</p>
<p>
<button type="button" data-switch-toggle="animate" class="btn btn-default">Toggle</button>
<button type="button" data-switch-get="animate" class="btn btn-default">Get</button>
</p>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">Disabled</h2>
<p>
<input id="switch-disabled" type="checkbox" checked disabled>
</p>
<p>
<button type="button" data-switch-toggle="disabled" class="btn btn-default">Toggle</button>
<button type="button" data-switch-get="disabled" class="btn btn-default">Get</button>
</p>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">Readonly</h2>
<p>
<input id="switch-readonly" type="checkbox" checked readonly>
</p>
<p>
<button type="button" data-switch-toggle="readonly" class="btn btn-default">Toggle</button>
<button type="button" data-switch-get="readonly" class="btn btn-default">Get</button>
</p>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">Indeterminate</h2>
<p>
<input id="switch-indeterminate" type="checkbox" checked data-indeterminate="true">
</p>
<p>
<button type="button" data-switch-toggle="indeterminate" class="btn btn-default">Toggle</button>
<button type="button" data-switch-get="indeterminate" class="btn btn-default">Get</button>
</p>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">Inverse</h2>
<p>
<input id="switch-inverse" type="checkbox" checked data-inverse="true">
</p>
<p>
<button type="button" data-switch-toggle="inverse" class="btn btn-default">Toggle</button>
<button type="button" data-switch-get="inverse" class="btn btn-default">Get</button>
</p>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">On Color</h2>
<p>
<input id="switch-onColor" type="checkbox" checked data-on-color="info">
</p>
<p class="btn-group">
<div class="btn-group">
<button type="button" data-toggle="dropdown" class="btn btn-default dropdown-toggle">Set &nbsp;<span class="caret"></span></button>
<div role="menu" class="dropdown-menu">
<li><a data-switch-set="onColor" data-switch-value="primary">Primary</a></li>
<li><a data-switch-set="onColor" data-switch-value="info">Info</a></li>
<li><a data-switch-set="onColor" data-switch-value="success">Success</a></li>
<li><a data-switch-set="onColor" data-switch-value="warning">Warning</a></li>
<li><a data-switch-set="onColor" data-switch-value="default">Default</a></li>
</div>
</div>
<button type="button" data-switch-get="onColor" class="btn btn-default">Get</button>
</p>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">Off Color</h2>
<p>
<input id="switch-offColor" type="checkbox" data-off-color="warning">
</p>
<p class="btn-group">
<div class="btn-group">
<button type="button" data-toggle="dropdown" class="btn btn-default dropdown-toggle">Set &nbsp;<span class="caret"></span></button>
<div role="menu" class="dropdown-menu">
<li><a data-switch-set="offColor" data-switch-value="primary">Primary</a></li>
<li><a data-switch-set="offColor" data-switch-value="info">Info</a></li>
<li><a data-switch-set="offColor" data-switch-value="success">Success</a></li>
<li><a data-switch-set="offColor" data-switch-value="warning">Warning</a></li>
<li><a data-switch-set="offColor" data-switch-value="default">Default</a></li>
</div>
</div>
<button type="button" data-switch-get="offColor" class="btn btn-default">Get</button>
</p>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">On Text</h2>
<p>
<input id="switch-onText" type="checkbox" checked data-on-text="Yes">
</p>
<div class="row">
<div class="col-sm-6">
<input type="text" data-switch-set-value="onText" value="Yes" class="form-control">
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">Off Text</h2>
<p>
<input id="switch-offText" type="checkbox" data-off-text="No">
</p>
<div class="row">
<div class="col-sm-6">
<input type="text" data-switch-set-value="offText" value="No" class="form-control">
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">Label Text</h2>
<p>
<input id="switch-labelText" type="checkbox" data-label-text="Label">
</p>
<div class="row">
<div class="col-sm-6">
<input type="text" data-switch-set-value="labelText" class="form-control">
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">Handle Width</h2>
<p>
<input id="switch-handleWidth" type="checkbox" data-handle-width="100">
</p>
<div class="row">
<div class="col-sm-6">
<input type="number" data-switch-set-value="handleWidth" value="100" class="form-control">
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">Label Width</h2>
<p>
<input id="switch-labelWidth" type="checkbox" data-label-width="100">
</p>
<div class="row">
<div class="col-sm-6">
<input type="number" data-switch-set-value="labelWidth" value="100" class="form-control">
</div>
</div>
</div>
<div class="col-sm-6 col-lg-4">
<h2 class="h4">Create | Destroy</h2>
<p>
<input id="switch-create-destroy" type="checkbox" checked data-switch-no-init>
</p>
<div class="row">
<div class="col-sm-6">
<button type="button" data-switch-create-destroy data-destroy-text="Destroy" class="btn btn-default">Create</button>
</div>
</div>
</div>
</div><br><br>
<div class="text-center">
<h2 class="h4">Radio All Off</h2>
<div class="row">
<div class="col-sm-6">
<h3 class="h5">Disabled</h3>
<input type="radio" name="radio1" checked class="switch-radio1">
<input type="radio" name="radio1" class="switch-radio1">
<input type="radio" name="radio1" class="switch-radio1">
</div>
<div class="col-sm-6">
<h3 class="h5">Enabled</h3>
<input type="radio" name="radio2" checked data-radio-all-off="true" class="switch-radio2">
<input type="radio" name="radio2" data-radio-all-off="true" class="switch-radio2">
<input type="radio" name="radio2" data-radio-all-off="true" class="switch-radio2">
</div>
</div><br>
<hr>
<h2 class="h4">Inside Modals</h2>
<button data-toggle="modal" data-target="#modal-switch" class="btn btn-default">Open Modal</button>
<div id="modal-switch" tabindex="-1" role="dialog" aria-labelledby="modal-switch-label" class="modal fade">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" data-dismiss="modal" class="close"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
<div id="modal-switch-label" class="modal-title">Title</div>
</div>
<div class="modal-body">
<input id="switch-modal" type="checkbox" checked>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<footer class="bs-docs-footer">
<div class="container">
<p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2.0</a><br>Created by <a href="https://github.com/nostalgiaz" target="_blank">Mattia Larentis</a><br>Mantained by <a href="https://github.com/lostcrew" target="_blank">Emanuele Marchi</a>
</p>
</div>
</footer>
<script src="docs/js/jquery.min.js"></script>
<script src="docs/js/bootstrap.min.js"></script>
<script src="docs/js/highlight.js"></script>
<script src="dist/js/bootstrap-switch.js"></script>
<script src="docs/js/main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,19 @@
{
"frameworks": ["jasmine"],
"files": [
"bower_components/jquery/dist/jquery.js",
"bower_components/bootstrap/dist/js/bootstrap.js",
"test/bootstrap-switch.js",
"test/bootstrap-switch.tests.js"
],
"reporters": ["progress"],
"port": 9876,
"colors": true,
"autoWatch": true,
"browsers": ["Firefox"],
"singleRun": false,
"plugins": [
"karma-jasmine",
"karma-firefox-launcher"
]
}

View File

@@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Turn checkboxes and radio buttons in toggle switches.">
<meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein">
<title>Bootstrap Switch · Turn checkboxes and radio buttons in toggle switches</title>
<link href="docs/css/bootstrap.min.css" rel="stylesheet">
<link href="docs/css/highlight.css" rel="stylesheet">
<link href="dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet">
<link href="http://getbootstrap.com/assets/css/docs.min.css" rel="stylesheet">
<link href="docs/css/main.css" rel="stylesheet">
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43092768-1']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body><a href="https://github.com/nostalgiaz/bootstrap-switch" id="github"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<header role="banner" class="navbar navbar-static-top bs-docs-nav">
<div class="container">
<div class="navbar-header">
<button type="button" data-toggle="collapse" data-target="#collapse" class="navbar-toggle"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="../" class="navbar-brand">Bootstrap Switch</a>
</div>
<nav id="collapse" role="navigation" class="collapse navbar-collapse bs-navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/master.zip" data-toggle="dropdown">Download</a></li>
<li><a href="examples.html">Examples</a></li>
<li class="dropdown"><a href="#" data-toggle="dropdown">Documentation <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/options.html">Options</a></li>
<li><a href="/methods.html">Methods</a></li>
<li><a href="/events.html">Events</a></li>
<li role="presentation" class="divider"></li>
<li><a href="/documentation-2.html">Documentation (v2.0.1)</a></li>
</ul>
</li>
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
</ul>
</nav>
</div>
</header>
<main id="content" role="main">
</main>
<footer class="bs-docs-footer">
<div class="container">
<p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2.0</a><br>Created by <a href="https://github.com/nostalgiaz" target="_blank">Mattia Larentis</a><br>Mantained by <a href="https://github.com/lostcrew" target="_blank">Emanuele Marchi</a>
</p>
</div>
</footer>
<script src="docs/js/jquery.min.js"></script>
<script src="docs/js/bootstrap.min.js"></script>
<script src="docs/js/highlight.js"></script>
<script src="dist/js/bootstrap-switch.js"></script>
<script src="docs/js/main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,123 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Turn checkboxes and radio buttons in toggle switches.">
<meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein">
<title>Bootstrap Switch · Turn checkboxes and radio buttons in toggle switches</title>
<link href="docs/css/bootstrap.min.css" rel="stylesheet">
<link href="docs/css/highlight.css" rel="stylesheet">
<link href="dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet">
<link href="http://getbootstrap.com/assets/css/docs.min.css" rel="stylesheet">
<link href="docs/css/main.css" rel="stylesheet">
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43092768-1']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body><a href="https://github.com/nostalgiaz/bootstrap-switch" id="github"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<header role="banner" class="navbar navbar-static-top bs-docs-nav">
<div class="container">
<div class="navbar-header">
<button type="button" data-toggle="collapse" data-target="#collapse" class="navbar-toggle"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="../" class="navbar-brand">Bootstrap Switch</a>
</div>
<nav id="collapse" role="navigation" class="collapse navbar-collapse bs-navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/master.zip" data-toggle="dropdown">Download</a></li>
<li><a href="examples.html">Examples</a></li>
<li class="dropdown"><a href="#" data-toggle="dropdown">Documentation <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/options.html">Options</a></li>
<li><a href="/methods.html">Methods</a></li>
<li><a href="/events.html">Events</a></li>
<li role="presentation" class="divider"></li>
<li><a href="/documentation-2.html">Documentation (v2.0.1)</a></li>
</ul>
</li>
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
</ul>
</nav>
</div>
</header>
<main id="content" role="main">
<div id="content" class="bs-docs-header">
<div class="container">
<h1>Methods</h1>
</div>
</div>
<div class="container">
<p>In Bootstrap Switch, every option is also a method.</p>
<p>If the second parameter is omitted, the method return the current value.</p>
<p>You can invoke methods as follows:</p>
<pre><code>$('input[name="my-checkbox"]').bootstrapSwitch('state', true, true);</code></pre>
<h2>Additional Methods</h2>
<table class="table table-bordered table-striped table-responsive">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>toggleState</td>
<td>Toggle the switch state</td>
</tr>
<tr>
<td>toggleAnimate</td>
<td>Toggle the animate option</td>
</tr>
<tr>
<td>toggleDisabled</td>
<td>Toggle the disabled state</td>
</tr>
<tr>
<td>toggleReadonly</td>
<td>Toggle the readonly state</td>
</tr>
<tr>
<td>toggleIndeterminate</td>
<td>Toggle the indeterminate state</td>
</tr>
<tr>
<td>toggleInverse</td>
<td>Toggle the inverse option</td>
</tr>
<tr>
<td>destroy</td>
<td>Destroy the instance of Bootstrap Switch</td>
</tr>
</tbody>
</table>
<h2>Special Behaviours</h2>
<ul>
<li>The method <code>state</code> can receive an optional third parameter <code>skip</code>. if true, <code>switchChange</code> event is not executed. The default is false.</li>
<li>The method <code>toggleState</code> can receive an optional second parameter <code>skip</code>. if true, <code>switchChange</code> event is not executed. The default is false.</li>
<li>The method <code>wrapperClass</code> can accepts a falsy value as second parameter. If so, it resets the class to its default.</li>
</ul>
</div>
</main>
<footer class="bs-docs-footer">
<div class="container">
<p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2.0</a><br>Created by <a href="https://github.com/nostalgiaz" target="_blank">Mattia Larentis</a><br>Mantained by <a href="https://github.com/lostcrew" target="_blank">Emanuele Marchi</a>
</p>
</div>
</footer>
<script src="docs/js/jquery.min.js"></script>
<script src="docs/js/bootstrap.min.js"></script>
<script src="docs/js/highlight.js"></script>
<script src="dist/js/bootstrap-switch.js"></script>
<script src="docs/js/main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,248 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Turn checkboxes and radio buttons in toggle switches.">
<meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein">
<title>Bootstrap Switch · Turn checkboxes and radio buttons in toggle switches</title>
<link href="docs/css/bootstrap.min.css" rel="stylesheet">
<link href="docs/css/highlight.css" rel="stylesheet">
<link href="dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet">
<link href="http://getbootstrap.com/assets/css/docs.min.css" rel="stylesheet">
<link href="docs/css/main.css" rel="stylesheet">
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43092768-1']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body><a href="https://github.com/nostalgiaz/bootstrap-switch" id="github"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<header role="banner" class="navbar navbar-static-top bs-docs-nav">
<div class="container">
<div class="navbar-header">
<button type="button" data-toggle="collapse" data-target="#collapse" class="navbar-toggle"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="../" class="navbar-brand">Bootstrap Switch</a>
</div>
<nav id="collapse" role="navigation" class="collapse navbar-collapse bs-navbar-collapse">
<ul class="nav navbar-nav">
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/master.zip" data-toggle="dropdown">Download</a></li>
<li><a href="examples.html">Examples</a></li>
<li class="dropdown"><a href="#" data-toggle="dropdown">Documentation <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="/options.html">Options</a></li>
<li><a href="/methods.html">Methods</a></li>
<li><a href="/events.html">Events</a></li>
<li role="presentation" class="divider"></li>
<li><a href="/documentation-2.html">Documentation (v2.0.1)</a></li>
</ul>
</li>
<li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
</ul>
</nav>
</div>
</header>
<main id="content" role="main">
<div id="content" class="bs-docs-header">
<div class="container">
<h1>Options</h1>
</div>
</div>
<div class="container">
<table class="table table-bordered table-striped table-responsive">
<thead>
<tr>
<th>Name</th>
<th>Attribute</th>
<th>Type</th>
<th>Description</th>
<th>Values</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<td>state</td>
<td>checked</td>
<td>Boolean</td>
<td>The checkbox state</td>
<td>true, false</td>
<td>true</td>
</tr>
<tr>
<td>size</td>
<td>data-size</td>
<td>String</td>
<td>The checkbox size</td>
<td>null, 'mini', 'small', 'normal', 'large'</td>
<td>null</td>
</tr>
<tr>
<td>animate</td>
<td>data-animate</td>
<td>Boolean</td>
<td>Animate the switch</td>
<td>true, false</td>
<td>true</td>
</tr>
<tr>
<td>disabled</td>
<td>disabled</td>
<td>Boolean</td>
<td>Disable state</td>
<td>true, false</td>
<td>false</td>
</tr>
<tr>
<td>readonly</td>
<td>readonly</td>
<td>Boolean</td>
<td>Readonly state</td>
<td>true, false</td>
<td>false</td>
</tr>
<tr>
<td>indeterminate</td>
<td>data-indeterminate</td>
<td>Boolean</td>
<td>Indeterminate state</td>
<td>true, false</td>
<td>false</td>
</tr>
<tr>
<td>inverse</td>
<td>data-inverse</td>
<td>Boolean</td>
<td>Inverse switch direction</td>
<td>true, false</td>
<td>false</td>
</tr>
<tr>
<td>radioAllOff</td>
<td>data-radio-all-off</td>
<td>Boolean</td>
<td>Allow this radio button to be unchecked by the user</td>
<td>true, false</td>
<td>false</td>
</tr>
<tr>
<td>onColor</td>
<td>data-on-color</td>
<td>String</td>
<td>Color of the left side of the switch</td>
<td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
<td>'primary'</td>
</tr>
<tr>
<td>offColor</td>
<td>data-off-color</td>
<td>String</td>
<td>Color of the right side of the switch</td>
<td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
<td>'default'</td>
</tr>
<tr>
<td>onText</td>
<td>data-on-text</td>
<td>String</td>
<td>Text of the left side of the switch</td>
<td>String</td>
<td>'ON'</td>
</tr>
<tr>
<td>offText</td>
<td>data-off-text</td>
<td>String</td>
<td>Text of the right side of the switch</td>
<td>String</td>
<td>'OFF'</td>
</tr>
<tr>
<td>labelText</td>
<td>data-label-text</td>
<td>String</td>
<td>Text of the center handle of the switch</td>
<td>String</td>
<td>'&amp;nbsp;'</td>
</tr>
<tr>
<td>handleWidth</td>
<td>data-handle-width</td>
<td>String | Number</td>
<td>Width of the left and right sides in pixels</td>
<td>'auto' or Number</td>
<td>'auto'</td>
</tr>
<tr>
<td>labelWidth</td>
<td>data-label-width</td>
<td>String | Number</td>
<td>Width of the center handle in pixels</td>
<td>'auto' or Number</td>
<td>'auto'</td>
</tr>
<tr>
<td>baseClass</td>
<td>data-base-class</td>
<td>String</td>
<td>Global class prefix</td>
<td>String</td>
<td>'bootstrap-switch'</td>
</tr>
<tr>
<td>wrapperClass</td>
<td>data-wrapper-class</td>
<td>String | Array</td>
<td>Container element class(es)</td>
<td>String | Array</td>
<td>'wrapper'</td>
</tr>
<tr>
<td>onInit</td>
<td></td>
<td>Function</td>
<td>Callback function to execute on initialization</td>
<td>Function</td>
<td>
<pre><code class="javascript">function(event, state) {}</code></pre>
</td>
</tr>
<tr>
<td>onSwitchChange</td>
<td></td>
<td>Function</td>
<td>Callback function to execute on switch state change</td>
<td>Function</td>
<td>
<pre><code class="javascript">function(event, state) {}</code></pre>
</td>
</tr>
</tbody>
</table>
<h2>Global Defaults Overriding</h2>
<p>Follow the jQuery convention to override the default options of the library. For instance:</p>
<pre><code>$.fn.bootstrapSwitch.defaults.size = 'large';
$.fn.bootstrapSwitch.defaults.onColor = 'success';</code></pre>
</div>
</main>
<footer class="bs-docs-footer">
<div class="container">
<p>Code licensed under <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2.0</a><br>Created by <a href="https://github.com/nostalgiaz" target="_blank">Mattia Larentis</a><br>Mantained by <a href="https://github.com/lostcrew" target="_blank">Emanuele Marchi</a>
</p>
</div>
</footer>
<script src="docs/js/jquery.min.js"></script>
<script src="docs/js/bootstrap.min.js"></script>
<script src="docs/js/highlight.js"></script>
<script src="dist/js/bootstrap-switch.js"></script>
<script src="docs/js/main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,525 @@
do ($ = window.jQuery, window) ->
"use strict"
class BootstrapSwitch
constructor: (element, options = {}) ->
@$element = $ element
@options = $.extend {}, $.fn.bootstrapSwitch.defaults,
state: @$element.is ":checked"
size: @$element.data "size"
animate: @$element.data "animate"
disabled: @$element.is ":disabled"
readonly: @$element.is "[readonly]"
indeterminate: @$element.data "indeterminate"
inverse: @$element.data "inverse"
radioAllOff: @$element.data "radio-all-off"
onColor: @$element.data "on-color"
offColor: @$element.data "off-color"
onText: @$element.data "on-text"
offText: @$element.data "off-text"
labelText: @$element.data "label-text"
handleWidth: @$element.data "handle-width"
labelWidth: @$element.data "label-width"
baseClass: @$element.data "base-class"
wrapperClass: @$element.data "wrapper-class"
, options
@$wrapper = $ "<div>",
class: do =>
classes = ["#{@options.baseClass}"].concat @_getClasses @options.wrapperClass
classes.push if @options.state then "#{@options.baseClass}-on" else "#{@options.baseClass}-off"
classes.push "#{@options.baseClass}-#{@options.size}" if @options.size?
classes.push "#{@options.baseClass}-disabled" if @options.disabled
classes.push "#{@options.baseClass}-readonly" if @options.readonly
classes.push "#{@options.baseClass}-indeterminate" if @options.indeterminate
classes.push "#{@options.baseClass}-inverse" if @options.inverse
classes.push "#{@options.baseClass}-id-#{@$element.attr("id")}" if @$element.attr "id"
classes.join " "
@$container = $ "<div>",
class: "#{@options.baseClass}-container"
@$on = $ "<span>",
html: @options.onText,
class: "#{@options.baseClass}-handle-on #{@options.baseClass}-#{@options.onColor}"
@$off = $ "<span>",
html: @options.offText,
class: "#{@options.baseClass}-handle-off #{@options.baseClass}-#{@options.offColor}"
@$label = $ "<span>",
html: @options.labelText
class: "#{@options.baseClass}-label"
# set up events
@$element.on "init.bootstrapSwitch", => @options.onInit.apply element, arguments
@$element.on "switchChange.bootstrapSwitch", => @options.onSwitchChange.apply element, arguments
# reassign elements after dom modification
@$container = @$element.wrap(@$container).parent()
@$wrapper = @$container.wrap(@$wrapper).parent()
# insert handles and label and trigger event
@$element
.before(if @options.inverse then @$off else @$on)
.before(@$label)
.before(if @options.inverse then @$on else @$off)
# indeterminate state
@$element.prop "indeterminate", true if @options.indeterminate
# normalize handles width and set container position
@_init()
# initialise handlers
@_elementHandlers()
@_handleHandlers()
@_labelHandlers()
@_formHandler()
@_externalLabelHandler()
@$element.trigger "init.bootstrapSwitch"
_constructor: BootstrapSwitch
state: (value, skip) ->
return @options.state if typeof value is "undefined"
return @$element if @options.disabled or @options.readonly
return @$element if @options.state and not @options.radioAllOff and @$element.is ":radio"
# remove indeterminate
@indeterminate false if @options.indeterminate
value = not not value
@$element.prop("checked", value).trigger "change.bootstrapSwitch", skip
@$element
toggleState: (skip) ->
return @$element if @options.disabled or @options.readonly
if @options.indeterminate
@indeterminate false
@state true
else
@$element.prop("checked", not @options.state).trigger "change.bootstrapSwitch", skip
size: (value) ->
return @options.size if typeof value is "undefined"
@$wrapper.removeClass "#{@options.baseClass}-#{@options.size}" if @options.size?
@$wrapper.addClass "#{@options.baseClass}-#{value}" if value
@_width()
@_containerPosition()
@options.size = value
@$element
animate: (value) ->
return @options.animate if typeof value is "undefined"
value = not not value
return @$element if value is @options.animate
@toggleAnimate()
toggleAnimate: ->
@options.animate = not @options.animate
@$wrapper.toggleClass "#{@options.baseClass}-animate"
@$element
disabled: (value) ->
return @options.disabled if typeof value is "undefined"
value = not not value
return @$element if value is @options.disabled
@toggleDisabled()
toggleDisabled: ->
@options.disabled = not @options.disabled
@$element.prop "disabled", @options.disabled
@$wrapper.toggleClass "#{@options.baseClass}-disabled"
@$element
readonly: (value) ->
return @options.readonly if typeof value is "undefined"
value = not not value
return @$element if value is @options.readonly
@toggleReadonly()
toggleReadonly: ->
@options.readonly = not @options.readonly
@$element.prop "readonly", @options.readonly
@$wrapper.toggleClass "#{@options.baseClass}-readonly"
@$element
indeterminate: (value) ->
return @options.indeterminate if typeof value is "undefined"
value = not not value
return @$element if value is @options.indeterminate
@toggleIndeterminate()
toggleIndeterminate: ->
@options.indeterminate = not @options.indeterminate
@$element.prop "indeterminate", @options.indeterminate
@$wrapper.toggleClass "#{@options.baseClass}-indeterminate"
@_containerPosition()
@$element
inverse: (value) ->
return @options.inverse if typeof value is "undefined"
value = not not value
return @$element if value is @options.inverse
@toggleInverse()
toggleInverse: ->
@$wrapper.toggleClass "#{@options.baseClass}-inverse"
$on = @$on.clone true
$off = @$off.clone true
@$on.replaceWith $off
@$off.replaceWith $on
@$on = $off
@$off = $on
@options.inverse = not @options.inverse
@$element
onColor: (value) ->
color = @options.onColor
return color if typeof value is "undefined"
@$on.removeClass "#{@options.baseClass}-#{color}" if color?
@$on.addClass "#{@options.baseClass}-#{value}"
@options.onColor = value
@$element
offColor: (value) ->
color = @options.offColor
return color if typeof value is "undefined"
@$off.removeClass "#{@options.baseClass}-#{color}" if color?
@$off.addClass "#{@options.baseClass}-#{value}"
@options.offColor = value
@$element
onText: (value) ->
return @options.onText if typeof value is "undefined"
@$on.html value
@_width()
@_containerPosition()
@options.onText = value
@$element
offText: (value) ->
return @options.offText if typeof value is "undefined"
@$off.html value
@_width()
@_containerPosition()
@options.offText = value
@$element
labelText: (value) ->
return @options.labelText if typeof value is "undefined"
@$label.html value
@_width()
@options.labelText = value
@$element
handleWidth: (value) ->
return @options.handleWidth if typeof value is "undefined"
@options.handleWidth = value
@_width()
@_containerPosition()
@$element
labelWidth: (value) ->
return @options.labelWidth if typeof value is "undefined"
@options.labelWidth = value
@_width()
@_containerPosition()
@$element
baseClass: (value) ->
@options.baseClass
wrapperClass: (value) ->
return @options.wrapperClass if typeof value is "undefined"
value = $.fn.bootstrapSwitch.defaults.wrapperClass unless value
@$wrapper.removeClass @_getClasses(@options.wrapperClass).join " "
@$wrapper.addClass @_getClasses(value).join " "
@options.wrapperClass = value
@$element
radioAllOff: (value) ->
return @options.radioAllOff if typeof value is "undefined"
value = not not value
return @$element if value is @options.radioAllOff
@options.radioAllOff = value
@$element
onInit: (value) ->
return @options.onInit if typeof value is "undefined"
value = $.fn.bootstrapSwitch.defaults.onInit unless value
@options.onInit = value
@$element
onSwitchChange: (value) ->
return @options.onSwitchChange if typeof value is "undefined"
value = $.fn.bootstrapSwitch.defaults.onSwitchChange unless value
@options.onSwitchChange = value
@$element
destroy: ->
$form = @$element.closest "form"
$form.off("reset.bootstrapSwitch").removeData "bootstrap-switch" if $form.length
@$container.children().not(@$element).remove()
@$element.unwrap().unwrap().off(".bootstrapSwitch").removeData "bootstrap-switch"
@$element
_width: ->
$handles = @$on.add(@$off)
# remove width from inline style
$handles.add(@$label).css("width", "")
# save handleWidth for further label width calculation check
handleWidth = if @options.handleWidth is "auto"
then Math.max @$on.width(), @$off.width()
else @options.handleWidth
# set handles width
$handles.width handleWidth
# set label width
@$label.width (index, width) =>
return @options.labelWidth if @options.labelWidth isnt "auto"
if width < handleWidth then handleWidth else width
# get handle and label widths
@_handleWidth = @$on.outerWidth()
@_labelWidth = @$label.outerWidth()
# set container and wrapper widths
@$container.width (@_handleWidth * 2) + @_labelWidth
@$wrapper.width @_handleWidth + @_labelWidth
_containerPosition: (state = @options.state, callback) ->
@$container
.css "margin-left", =>
values = [0, "-#{@_handleWidth}px"]
return "-#{@_handleWidth / 2}px" if @options.indeterminate
if state
return if @options.inverse then values[1] else values[0]
else
return if @options.inverse then values[0] else values[1]
return unless callback
setTimeout ->
callback()
, 50
_init: ->
init = =>
@_width()
@_containerPosition null, =>
@$wrapper.addClass "#{@options.baseClass}-animate" if @options.animate
return init() if @$wrapper.is ":visible"
initInterval = window.setInterval =>
if @$wrapper.is ":visible"
init()
window.clearInterval initInterval
, 50
_elementHandlers: ->
@$element.on
"change.bootstrapSwitch": (e, skip) =>
e.preventDefault()
e.stopImmediatePropagation()
state = @$element.is ":checked"
@_containerPosition state
return if state is @options.state
@options.state = state
@$wrapper.toggleClass("#{@options.baseClass}-off").toggleClass "#{@options.baseClass}-on"
unless skip
if @$element.is ":radio"
$("[name='#{@$element.attr('name')}']")
.not(@$element)
.prop("checked", false)
.trigger "change.bootstrapSwitch", true
@$element.trigger "switchChange.bootstrapSwitch", [state]
"focus.bootstrapSwitch": (e) =>
e.preventDefault()
@$wrapper.addClass "#{@options.baseClass}-focused"
"blur.bootstrapSwitch": (e) =>
e.preventDefault()
@$wrapper.removeClass "#{@options.baseClass}-focused"
"keydown.bootstrapSwitch": (e) =>
return if not e.which or @options.disabled or @options.readonly
switch e.which
when 37
e.preventDefault()
e.stopImmediatePropagation()
@state false
when 39
e.preventDefault()
e.stopImmediatePropagation()
@state true
_handleHandlers: ->
@$on.on "click.bootstrapSwitch", (event) =>
event.preventDefault()
event.stopPropagation()
@state false
@$element.trigger "focus.bootstrapSwitch"
@$off.on "click.bootstrapSwitch", (event) =>
event.preventDefault()
event.stopPropagation()
@state true
@$element.trigger "focus.bootstrapSwitch"
_labelHandlers: ->
@$label.on
"mousedown.bootstrapSwitch touchstart.bootstrapSwitch": (e) =>
return if @_dragStart or @options.disabled or @options.readonly
e.preventDefault()
e.stopPropagation()
@_dragStart = (e.pageX or e.originalEvent.touches[0].pageX) - parseInt @$container.css("margin-left"), 10
@$wrapper.removeClass "#{@options.baseClass}-animate" if @options.animate
@$element.trigger "focus.bootstrapSwitch"
"mousemove.bootstrapSwitch touchmove.bootstrapSwitch": (e) =>
return unless @_dragStart?
e.preventDefault()
difference = (e.pageX or e.originalEvent.touches[0].pageX) - @_dragStart
return if difference < -@_handleWidth or difference > 0
@_dragEnd = difference
@$container.css "margin-left", "#{@_dragEnd}px"
"mouseup.bootstrapSwitch touchend.bootstrapSwitch": (e) =>
return unless @_dragStart
e.preventDefault()
@$wrapper.addClass "#{@options.baseClass}-animate" if @options.animate
if @_dragEnd
state = @_dragEnd > -(@_handleWidth / 2)
@_dragEnd = false
@state if @options.inverse then not state else state
else
@state not @options.state
@_dragStart = false
"mouseleave.bootstrapSwitch": (e) =>
@$label.trigger "mouseup.bootstrapSwitch"
_externalLabelHandler: ->
$externalLabel = @$element.closest("label")
$externalLabel.on "click", (event) =>
event.preventDefault()
event.stopImmediatePropagation()
# reimplement toggle state on external label only if it is not the target
@toggleState() if event.target is $externalLabel[0]
_formHandler: ->
$form = @$element.closest "form"
return if $form.data "bootstrap-switch"
$form
.on "reset.bootstrapSwitch", ->
window.setTimeout ->
$form
.find("input")
.filter( -> $(@).data "bootstrap-switch")
.each -> $(@).bootstrapSwitch "state", @checked
, 1
.data "bootstrap-switch", true
_getClasses: (classes) ->
return ["#{@options.baseClass}-#{classes}"] unless $.isArray classes
cls = []
for c in classes
cls.push "#{@options.baseClass}-#{c}"
cls
$.fn.bootstrapSwitch = (option, args...) ->
ret = @
@each ->
$this = $ @
data = $this.data "bootstrap-switch"
$this.data "bootstrap-switch", data = new BootstrapSwitch @, option unless data
ret = data[option].apply data, args if typeof option is "string"
ret
$.fn.bootstrapSwitch.Constructor = BootstrapSwitch
$.fn.bootstrapSwitch.defaults =
state: true
size: null
animate: true
disabled: false
readonly: false
indeterminate: false
inverse: false
radioAllOff: false
onColor: "primary"
offColor: "default"
onText: "ON"
offText: "OFF"
labelText: "&nbsp;"
handleWidth: "auto"
labelWidth: "auto"
baseClass: "bootstrap-switch"
wrapperClass: "wrapper"
onInit: ->
onSwitchChange: ->

View File

@@ -0,0 +1,27 @@
describe "Bootstrap Switch", ->
beforeEach ->
$.support.transition = false
$.fx.off = true
afterEach ->
$(".#{$.fn.bootstrapSwitch.defaults.baseClass}").bootstrapSwitch "destroy"
createElement = ->
$("<input>",
type: "checkbox"
class: "switch"
).appendTo "body"
getOptions = ($element) ->
$element.data("bootstrap-switch").options
it "should set the default options as element options, except state", ->
$switch = createElement().prop("checked", true).bootstrapSwitch()
expect(getOptions($switch)).toEqual $.fn.bootstrapSwitch.defaults
it "should override default options with initialization ones", ->
$switch = createElement().prop("checked", false).bootstrapSwitch()
$switch2 = createElement().bootstrapSwitch state: false
expect(getOptions($switch).state).toBe false
expect(getOptions($switch2).state).toBe false

View File

@@ -0,0 +1,193 @@
@bootstrap-switch-base: bootstrap-switch;
.@{bootstrap-switch-base} {
display: inline-block;
direction: ltr;
cursor: pointer;
.border-radius(5px);
border: 1px solid;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
position: relative;
text-align: left;
overflow: hidden;
line-height: 8px;
z-index: 0;
.user-select(none);
vertical-align: middle;
.transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s");
.@{bootstrap-switch-base}-container {
display: inline-block;
top: 0;
.border-radius(4px);
.translate3d(0, 0, 0);
}
.@{bootstrap-switch-base}-handle-on,
.@{bootstrap-switch-base}-handle-off,
.@{bootstrap-switch-base}-label {
.box-sizing(border-box);
cursor: pointer;
display: inline-block !important;
height: 100%;
padding-top: 4px;
padding-bottom: 4px;
padding-left: 8px;
padding-right: 8px;
font-size: 14px;
line-height: 20px;
}
.@{bootstrap-switch-base}-handle-on,
.@{bootstrap-switch-base}-handle-off {
text-align: center;
z-index: 1;
&.@{bootstrap-switch-base}-primary {
.buttonBackground(@btnPrimaryBackgroundHighlight, @btnPrimaryBackground);
}
&.@{bootstrap-switch-base}-info {
.buttonBackground(@btnInfoBackgroundHighlight, @btnInfoBackground);
}
&.@{bootstrap-switch-base}-success {
.buttonBackground(@btnSuccessBackgroundHighlight, @btnSuccessBackground);
}
&.@{bootstrap-switch-base}-warning {
.buttonBackground(@btnWarningBackgroundHighlight, @btnWarningBackground);
}
&.@{bootstrap-switch-base}-danger {
.buttonBackground(@btnDangerBackgroundHighlight, @btnDangerBackground);
}
&.@{bootstrap-switch-base}-default {
.buttonBackground(@btnBackgroundHighlight, @btnBackground, @grayDark, 0 1px 1px rgba(255,255,255,.75));
}
}
.@{bootstrap-switch-base}-label {
text-align: center;
margin-top: -1px;
margin-bottom: -1px;
z-index: 100;
border-left: 1px solid @btnBorder;
border-right: 1px solid @btnBorder;
.buttonBackground(@btnBackground, @btnBackgroundHighlight, @grayDark);
}
.@{bootstrap-switch-base}-handle-on {
.border-left-radius(4px);
}
.@{bootstrap-switch-base}-handle-off {
.border-right-radius(4px);
}
input[type='radio'],
input[type='checkbox'] {
position: absolute !important;
top: 0;
left: 0;
.opacity(0);
z-index: -1;
&.form-control {
height: auto;
}
}
&.@{bootstrap-switch-base}-mini {
min-width: 71px;
.@{bootstrap-switch-base}-handle-on,
.@{bootstrap-switch-base}-handle-off,
.@{bootstrap-switch-base}-label {
padding: 3px 6px;
font-size: 10px;
line-height: 9px;
}
}
&.@{bootstrap-switch-base}-small {
min-width: 79px;
.@{bootstrap-switch-base}-handle-on,
.@{bootstrap-switch-base}-handle-off,
.@{bootstrap-switch-base}-label {
padding: 3px 6px;
font-size: 12px;
line-height: 18px;
}
}
&.@{bootstrap-switch-base}-large {
min-width: 120px;
.@{bootstrap-switch-base}-handle-on,
.@{bootstrap-switch-base}-handle-off,
.@{bootstrap-switch-base}-label {
padding: 9px 12px;
font-size: 16px;
line-height: normal;
}
}
&.@{bootstrap-switch-base}-disabled,
&.@{bootstrap-switch-base}-readonly,
&.@{bootstrap-switch-base}-indeterminate {
cursor: default !important;
.@{bootstrap-switch-base}-handle-on,
.@{bootstrap-switch-base}-handle-off,
.@{bootstrap-switch-base}-label {
.opacity(50);
cursor: default !important;
}
}
&.@{bootstrap-switch-base}-animate {
.@{bootstrap-switch-base}-container {
.transition(margin-left .5s);
}
}
&.@{bootstrap-switch-base}-inverse {
.@{bootstrap-switch-base}-handle-on {
.border-left-radius(0);
.border-right-radius(4px);
}
.@{bootstrap-switch-base}-handle-off {
.border-right-radius(0);
.border-left-radius(4px);
}
}
&.@{bootstrap-switch-base}-focused {
border-color: rgba(82, 168, 236, .8);
outline: 0;
outline: thin dotted \9;
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82, 168, 236, .6)");
}
&.@{bootstrap-switch-base}-on,
&.@{bootstrap-switch-base}-inverse.@{bootstrap-switch-base}-off {
.@{bootstrap-switch-base}-label {
.border-right-radius(4px);
}
}
&.@{bootstrap-switch-base}-off,
&.@{bootstrap-switch-base}-inverse.@{bootstrap-switch-base}-on {
.@{bootstrap-switch-base}-label {
.border-left-radius(4px);
}
}
}

View File

@@ -0,0 +1,3 @@
@import "variables";
@import "mixins";
@import "bootstrap-switch";

View File

@@ -0,0 +1,702 @@
//
// Mixins
// --------------------------------------------------
// UTILITY MIXINS
// --------------------------------------------------
// Clearfix
// --------
// For clearing floats like a boss h5bp.com/q
.clearfix {
*zoom: 1;
&:before,
&:after {
display: table;
content: "";
// Fixes Opera/contenteditable bug:
// http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952
line-height: 0;
}
&:after {
clear: both;
}
}
// Webkit-style focus
// ------------------
.tab-focus() {
// Default
outline: thin dotted #333;
// Webkit
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
// Center-align a block level element
// ----------------------------------
.center-block() {
display: block;
margin-left: auto;
margin-right: auto;
}
// IE7 inline-block
// ----------------
.ie7-inline-block() {
*display: inline; /* IE7 inline-block hack */
*zoom: 1;
}
// IE7 likes to collapse whitespace on either side of the inline-block elements.
// Ems because we're attempting to match the width of a space character. Left
// version is for form buttons, which typically come after other elements, and
// right version is for icons, which come before. Applying both is ok, but it will
// mean that space between those elements will be .6em (~2 space characters) in IE7,
// instead of the 1 space in other browsers.
.ie7-restore-left-whitespace() {
*margin-left: .3em;
&:first-child {
*margin-left: 0;
}
}
.ie7-restore-right-whitespace() {
*margin-right: .3em;
}
// Sizing shortcuts
// -------------------------
.size(@height, @width) {
width: @width;
height: @height;
}
.square(@size) {
.size(@size, @size);
}
// Placeholder text
// -------------------------
.placeholder(@color: @placeholderText) {
&:-moz-placeholder {
color: @color;
}
&:-ms-input-placeholder {
color: @color;
}
&::-webkit-input-placeholder {
color: @color;
}
}
// Text overflow
// -------------------------
// Requires inline-block or block for proper styling
.text-overflow() {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
// CSS image replacement
// -------------------------
// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
.hide-text {
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
// FONTS
// --------------------------------------------------
#font {
#family {
.serif() {
font-family: @serifFontFamily;
}
.sans-serif() {
font-family: @sansFontFamily;
}
.monospace() {
font-family: @monoFontFamily;
}
}
.shorthand(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
font-size: @size;
font-weight: @weight;
line-height: @lineHeight;
}
.serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
#font > #family > .serif;
#font > .shorthand(@size, @weight, @lineHeight);
}
.sans-serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
#font > #family > .sans-serif;
#font > .shorthand(@size, @weight, @lineHeight);
}
.monospace(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
#font > #family > .monospace;
#font > .shorthand(@size, @weight, @lineHeight);
}
}
// FORMS
// --------------------------------------------------
// Block level inputs
.input-block-level {
display: block;
width: 100%;
min-height: @inputHeight; // Make inputs at least the height of their button counterpart (base line-height + padding + border)
.box-sizing(border-box); // Makes inputs behave like true block-level elements
}
// Mixin for form field states
.formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) {
// Set the text color
.control-label,
.help-block,
.help-inline {
color: @textColor;
}
// Style inputs accordingly
.checkbox,
.radio,
input,
select,
textarea {
color: @textColor;
}
input,
select,
textarea {
border-color: @borderColor;
.box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
&:focus {
border-color: darken(@borderColor, 10%);
@shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@borderColor, 20%);
.box-shadow(@shadow);
}
}
// Give a small background color for input-prepend/-append
.input-prepend .add-on,
.input-append .add-on {
color: @textColor;
background-color: @backgroundColor;
border-color: @textColor;
}
}
// CSS3 PROPERTIES
// --------------------------------------------------
// Border Radius
.border-radius(@radius) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
// Single Corner Border Radius
.border-top-left-radius(@radius) {
-webkit-border-top-left-radius: @radius;
-moz-border-radius-topleft: @radius;
border-top-left-radius: @radius;
}
.border-top-right-radius(@radius) {
-webkit-border-top-right-radius: @radius;
-moz-border-radius-topright: @radius;
border-top-right-radius: @radius;
}
.border-bottom-right-radius(@radius) {
-webkit-border-bottom-right-radius: @radius;
-moz-border-radius-bottomright: @radius;
border-bottom-right-radius: @radius;
}
.border-bottom-left-radius(@radius) {
-webkit-border-bottom-left-radius: @radius;
-moz-border-radius-bottomleft: @radius;
border-bottom-left-radius: @radius;
}
// Single Side Border Radius
.border-top-radius(@radius) {
.border-top-right-radius(@radius);
.border-top-left-radius(@radius);
}
.border-right-radius(@radius) {
.border-top-right-radius(@radius);
.border-bottom-right-radius(@radius);
}
.border-bottom-radius(@radius) {
.border-bottom-right-radius(@radius);
.border-bottom-left-radius(@radius);
}
.border-left-radius(@radius) {
.border-top-left-radius(@radius);
.border-bottom-left-radius(@radius);
}
// Drop shadows
.box-shadow(@shadow) {
-webkit-box-shadow: @shadow;
-moz-box-shadow: @shadow;
box-shadow: @shadow;
}
// Transitions
.transition(@transition) {
-webkit-transition: @transition;
-moz-transition: @transition;
-o-transition: @transition;
transition: @transition;
}
.transition-delay(@transition-delay) {
-webkit-transition-delay: @transition-delay;
-moz-transition-delay: @transition-delay;
-o-transition-delay: @transition-delay;
transition-delay: @transition-delay;
}
.transition-duration(@transition-duration) {
-webkit-transition-duration: @transition-duration;
-moz-transition-duration: @transition-duration;
-o-transition-duration: @transition-duration;
transition-duration: @transition-duration;
}
// Transformations
.rotate(@degrees) {
-webkit-transform: rotate(@degrees);
-moz-transform: rotate(@degrees);
-ms-transform: rotate(@degrees);
-o-transform: rotate(@degrees);
transform: rotate(@degrees);
}
.scale(@ratio) {
-webkit-transform: scale(@ratio);
-moz-transform: scale(@ratio);
-ms-transform: scale(@ratio);
-o-transform: scale(@ratio);
transform: scale(@ratio);
}
.translate(@x, @y) {
-webkit-transform: translate(@x, @y);
-moz-transform: translate(@x, @y);
-ms-transform: translate(@x, @y);
-o-transform: translate(@x, @y);
transform: translate(@x, @y);
}
.skew(@x, @y) {
-webkit-transform: skew(@x, @y);
-moz-transform: skew(@x, @y);
-ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885
-o-transform: skew(@x, @y);
transform: skew(@x, @y);
-webkit-backface-visibility: hidden; // See https://github.com/twbs/bootstrap/issues/5319
}
.translate3d(@x, @y, @z) {
-webkit-transform: translate3d(@x, @y, @z);
-moz-transform: translate3d(@x, @y, @z);
-o-transform: translate3d(@x, @y, @z);
transform: translate3d(@x, @y, @z);
}
// Backface visibility
// Prevent browsers from flickering when using CSS 3D transforms.
// Default value is `visible`, but can be changed to `hidden
// See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
.backface-visibility(@visibility){
-webkit-backface-visibility: @visibility;
-moz-backface-visibility: @visibility;
backface-visibility: @visibility;
}
// Background clipping
// Heads up: FF 3.6 and under need "padding" instead of "padding-box"
.background-clip(@clip) {
-webkit-background-clip: @clip;
-moz-background-clip: @clip;
background-clip: @clip;
}
// Background sizing
.background-size(@size) {
-webkit-background-size: @size;
-moz-background-size: @size;
-o-background-size: @size;
background-size: @size;
}
// Box sizing
.box-sizing(@boxmodel) {
-webkit-box-sizing: @boxmodel;
-moz-box-sizing: @boxmodel;
box-sizing: @boxmodel;
}
// User select
// For selecting text on the page
.user-select(@select) {
-webkit-user-select: @select;
-moz-user-select: @select;
-ms-user-select: @select;
-o-user-select: @select;
user-select: @select;
}
// Resize anything
.resizable(@direction) {
resize: @direction; // Options: horizontal, vertical, both
overflow: auto; // Safari fix
}
// CSS3 Content Columns
.content-columns(@columnCount, @columnGap: @gridGutterWidth) {
-webkit-column-count: @columnCount;
-moz-column-count: @columnCount;
column-count: @columnCount;
-webkit-column-gap: @columnGap;
-moz-column-gap: @columnGap;
column-gap: @columnGap;
}
// Optional hyphenation
.hyphens(@mode: auto) {
word-wrap: break-word;
-webkit-hyphens: @mode;
-moz-hyphens: @mode;
-ms-hyphens: @mode;
-o-hyphens: @mode;
hyphens: @mode;
}
// Opacity
.opacity(@opacity) {
opacity: @opacity / 100;
filter: ~"alpha(opacity=@{opacity})";
}
// BACKGROUNDS
// --------------------------------------------------
// Add an alphatransparency value to any background or border color (via Elyse Holladay)
#translucent {
.background(@color: @white, @alpha: 1) {
background-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
}
.border(@color: @white, @alpha: 1) {
border-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
.background-clip(padding-box);
}
}
// Gradient Bar Colors for buttons and alerts
.gradientBar(@primaryColor, @secondaryColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
color: @textColor;
text-shadow: @textShadow;
#gradient > .vertical(@primaryColor, @secondaryColor);
border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%);
border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
}
// Gradients
#gradient {
.horizontal(@startColor: #555, @endColor: #333) {
background-color: @endColor;
background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+
background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+
background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10
background-image: linear-gradient(to right, @startColor, @endColor); // Standard, IE10
background-repeat: repeat-x;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@startColor),argb(@endColor))); // IE9 and down
}
.vertical(@startColor: #555, @endColor: #333) {
background-color: mix(@startColor, @endColor, 60%);
background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10
background-repeat: repeat-x;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down
}
.directional(@startColor: #555, @endColor: #333, @deg: 45deg) {
background-color: @endColor;
background-repeat: repeat-x;
background-image: -moz-linear-gradient(@deg, @startColor, @endColor); // FF 3.6+
background-image: -webkit-linear-gradient(@deg, @startColor, @endColor); // Safari 5.1+, Chrome 10+
background-image: -o-linear-gradient(@deg, @startColor, @endColor); // Opera 11.10
background-image: linear-gradient(@deg, @startColor, @endColor); // Standard, IE10
}
.horizontal-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
background-color: mix(@midColor, @endColor, 80%);
background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
background-image: -webkit-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
background-image: -moz-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
background-image: -o-linear-gradient(left, @startColor, @midColor @colorStop, @endColor);
background-image: linear-gradient(to right, @startColor, @midColor @colorStop, @endColor);
background-repeat: no-repeat;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback
}
.vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
background-color: mix(@midColor, @endColor, 80%);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
background-image: -webkit-linear-gradient(@startColor, @midColor @colorStop, @endColor);
background-image: -moz-linear-gradient(top, @startColor, @midColor @colorStop, @endColor);
background-image: -o-linear-gradient(@startColor, @midColor @colorStop, @endColor);
background-image: linear-gradient(@startColor, @midColor @colorStop, @endColor);
background-repeat: no-repeat;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback
}
.radial(@innerColor: #555, @outerColor: #333) {
background-color: @outerColor;
background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@innerColor), to(@outerColor));
background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor);
background-image: -moz-radial-gradient(circle, @innerColor, @outerColor);
background-image: -o-radial-gradient(circle, @innerColor, @outerColor);
background-repeat: no-repeat;
}
.striped(@color: #555, @angle: 45deg) {
background-color: @color;
background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
background-image: -o-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
}
}
// Reset filters for IE
.reset-filter() {
filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
}
// COMPONENT MIXINS
// --------------------------------------------------
// Horizontal dividers
// -------------------------
// Dividers (basically an hr) within dropdowns and nav lists
.nav-divider(@top: #e5e5e5, @bottom: @white) {
// IE7 needs a set width since we gave a height. Restricting just
// to IE7 to keep the 1px left/right space in other browsers.
// It is unclear where IE is getting the extra space that we need
// to negative-margin away, but so it goes.
*width: 100%;
height: 1px;
margin: ((@baseLineHeight / 2) - 1) 1px; // 8px 1px
*margin: -5px 0 5px;
overflow: hidden;
background-color: @top;
border-bottom: 1px solid @bottom;
}
// Button backgrounds
// ------------------
.buttonBackground(@startColor, @endColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) {
// gradientBar will set the background to a pleasing blend of these, to support IE<=9
.gradientBar(@startColor, @endColor, @textColor, @textShadow);
*background-color: @endColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */
.reset-filter();
// in these cases the gradient won't cover the background, so we override
&:hover, &:focus, &:active, &.active, &.disabled, &[disabled] {
color: @textColor;
background-color: @endColor;
*background-color: darken(@endColor, 5%);
}
// IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
&:active,
&.active {
background-color: darken(@endColor, 10%) e("\9");
}
}
// Navbar vertical align
// -------------------------
// Vertically center elements in the navbar.
// Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin.
.navbarVerticalAlign(@elementHeight) {
margin-top: (@navbarHeight - @elementHeight) / 2;
}
// Grid System
// -----------
// Centered container element
.container-fixed() {
margin-right: auto;
margin-left: auto;
.clearfix();
}
// Table columns
.tableColumns(@columnSpan: 1) {
float: none; // undo default grid column styles
width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 16; // 16 is total padding on left and right of table cells
margin-left: 0; // undo default grid column styles
}
// Make a Grid
// Use .makeRow and .makeColumn to assign semantic layouts grid system behavior
.makeRow() {
margin-left: @gridGutterWidth * -1;
.clearfix();
}
.makeColumn(@columns: 1, @offset: 0) {
float: left;
margin-left: (@gridColumnWidth * @offset) + (@gridGutterWidth * (@offset - 1)) + (@gridGutterWidth * 2);
width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
}
// The Grid
#grid {
.core (@gridColumnWidth, @gridGutterWidth) {
.spanX (@index) when (@index > 0) {
.span@{index} { .span(@index); }
.spanX(@index - 1);
}
.spanX (0) {}
.offsetX (@index) when (@index > 0) {
.offset@{index} { .offset(@index); }
.offsetX(@index - 1);
}
.offsetX (0) {}
.offset (@columns) {
margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns + 1));
}
.span (@columns) {
width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
}
.row {
margin-left: @gridGutterWidth * -1;
.clearfix();
}
[class*="span"] {
float: left;
min-height: 1px; // prevent collapsing columns
margin-left: @gridGutterWidth;
}
// Set the container width, and override it for fixed navbars in media queries
.container,
.navbar-static-top .container,
.navbar-fixed-top .container,
.navbar-fixed-bottom .container { .span(@gridColumns); }
// generate .spanX and .offsetX
.spanX (@gridColumns);
.offsetX (@gridColumns);
}
.fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) {
.spanX (@index) when (@index > 0) {
.span@{index} { .span(@index); }
.spanX(@index - 1);
}
.spanX (0) {}
.offsetX (@index) when (@index > 0) {
.offset@{index} { .offset(@index); }
.offset@{index}:first-child { .offsetFirstChild(@index); }
.offsetX(@index - 1);
}
.offsetX (0) {}
.offset (@columns) {
margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth*2);
*margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + (@fluidGridGutterWidth*2) - (.5 / @gridRowWidth * 100 * 1%);
}
.offsetFirstChild (@columns) {
margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth);
*margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%);
}
.span (@columns) {
width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1));
*width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%);
}
.row-fluid {
width: 100%;
.clearfix();
[class*="span"] {
.input-block-level();
float: left;
margin-left: @fluidGridGutterWidth;
*margin-left: @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%);
}
[class*="span"]:first-child {
margin-left: 0;
}
// Space grid-sized controls properly if multiple per line
.controls-row [class*="span"] + [class*="span"] {
margin-left: @fluidGridGutterWidth;
}
// generate .spanX and .offsetX
.spanX (@gridColumns);
.offsetX (@gridColumns);
}
}
.input(@gridColumnWidth, @gridGutterWidth) {
.spanX (@index) when (@index > 0) {
input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index} { .span(@index); }
.spanX(@index - 1);
}
.spanX (0) {}
.span(@columns) {
width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 14;
}
input,
textarea,
.uneditable-input {
margin-left: 0; // override margin-left from core grid system
}
// Space grid-sized controls properly if multiple per line
.controls-row [class*="span"] + [class*="span"] {
margin-left: @gridGutterWidth;
}
// generate .spanX
.spanX (@gridColumns);
}
}

View File

@@ -0,0 +1,301 @@
//
// Variables
// --------------------------------------------------
// Global values
// --------------------------------------------------
// Grays
// -------------------------
@black: #000;
@grayDarker: #222;
@grayDark: #333;
@gray: #555;
@grayLight: #999;
@grayLighter: #eee;
@white: #fff;
// Accent colors
// -------------------------
@blue: #049cdb;
@blueDark: #0064cd;
@green: #46a546;
@red: #9d261d;
@yellow: #ffc40d;
@orange: #f89406;
@pink: #c3325f;
@purple: #7a43b6;
// Scaffolding
// -------------------------
@bodyBackground: @white;
@textColor: @grayDark;
// Links
// -------------------------
@linkColor: #08c;
@linkColorHover: darken(@linkColor, 15%);
// Typography
// -------------------------
@sansFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif;
@serifFontFamily: Georgia, "Times New Roman", Times, serif;
@monoFontFamily: Monaco, Menlo, Consolas, "Courier New", monospace;
@baseFontSize: 14px;
@baseFontFamily: @sansFontFamily;
@baseLineHeight: 20px;
@altFontFamily: @serifFontFamily;
@headingsFontFamily: inherit; // empty to use BS default, @baseFontFamily
@headingsFontWeight: bold; // instead of browser default, bold
@headingsColor: inherit; // empty to use BS default, @textColor
// Component sizing
// -------------------------
// Based on 14px font-size and 20px line-height
@fontSizeLarge: @baseFontSize * 1.25; // ~18px
@fontSizeSmall: @baseFontSize * 0.85; // ~12px
@fontSizeMini: @baseFontSize * 0.75; // ~11px
@paddingLarge: 11px 19px; // 44px
@paddingSmall: 2px 10px; // 26px
@paddingMini: 0 6px; // 22px
@baseBorderRadius: 4px;
@borderRadiusLarge: 6px;
@borderRadiusSmall: 3px;
// Tables
// -------------------------
@tableBackground: transparent; // overall background-color
@tableBackgroundAccent: #f9f9f9; // for striping
@tableBackgroundHover: #f5f5f5; // for hover
@tableBorder: #ddd; // table and cell border
// Buttons
// -------------------------
@btnBackground: @white;
@btnBackgroundHighlight: darken(@white, 10%);
@btnBorder: #ccc;
@btnPrimaryBackground: @linkColor;
@btnPrimaryBackgroundHighlight: spin(@btnPrimaryBackground, 20%);
@btnInfoBackground: #5bc0de;
@btnInfoBackgroundHighlight: #2f96b4;
@btnSuccessBackground: #62c462;
@btnSuccessBackgroundHighlight: #51a351;
@btnWarningBackground: lighten(@orange, 15%);
@btnWarningBackgroundHighlight: @orange;
@btnDangerBackground: #ee5f5b;
@btnDangerBackgroundHighlight: #bd362f;
@btnInverseBackground: #444;
@btnInverseBackgroundHighlight: @grayDarker;
// Forms
// -------------------------
@inputBackground: @white;
@inputBorder: #ccc;
@inputBorderRadius: @baseBorderRadius;
@inputDisabledBackground: @grayLighter;
@formActionsBackground: #f5f5f5;
@inputHeight: @baseLineHeight + 10px; // base line-height + 8px vertical padding + 2px top/bottom border
// Dropdowns
// -------------------------
@dropdownBackground: @white;
@dropdownBorder: rgba(0,0,0,.2);
@dropdownDividerTop: #e5e5e5;
@dropdownDividerBottom: @white;
@dropdownLinkColor: @grayDark;
@dropdownLinkColorHover: @white;
@dropdownLinkColorActive: @white;
@dropdownLinkBackgroundActive: @linkColor;
@dropdownLinkBackgroundHover: @dropdownLinkBackgroundActive;
// COMPONENT VARIABLES
// --------------------------------------------------
// Z-index master list
// -------------------------
// Used for a bird's eye view of components dependent on the z-axis
// Try to avoid customizing these :)
@zindexDropdown: 1000;
@zindexPopover: 1010;
@zindexTooltip: 1030;
@zindexFixedNavbar: 1030;
@zindexModalBackdrop: 1040;
@zindexModal: 1050;
// Sprite icons path
// -------------------------
@iconSpritePath: "../img/glyphicons-halflings.png";
@iconWhiteSpritePath: "../img/glyphicons-halflings-white.png";
// Input placeholder text color
// -------------------------
@placeholderText: @grayLight;
// Hr border color
// -------------------------
@hrBorder: @grayLighter;
// Horizontal forms & lists
// -------------------------
@horizontalComponentOffset: 180px;
// Wells
// -------------------------
@wellBackground: #f5f5f5;
// Navbar
// -------------------------
@navbarCollapseWidth: 979px;
@navbarCollapseDesktopWidth: @navbarCollapseWidth + 1;
@navbarHeight: 40px;
@navbarBackgroundHighlight: #ffffff;
@navbarBackground: darken(@navbarBackgroundHighlight, 5%);
@navbarBorder: darken(@navbarBackground, 12%);
@navbarText: #777;
@navbarLinkColor: #777;
@navbarLinkColorHover: @grayDark;
@navbarLinkColorActive: @gray;
@navbarLinkBackgroundHover: transparent;
@navbarLinkBackgroundActive: darken(@navbarBackground, 5%);
@navbarBrandColor: @navbarLinkColor;
// Inverted navbar
@navbarInverseBackground: #111111;
@navbarInverseBackgroundHighlight: #222222;
@navbarInverseBorder: #252525;
@navbarInverseText: @grayLight;
@navbarInverseLinkColor: @grayLight;
@navbarInverseLinkColorHover: @white;
@navbarInverseLinkColorActive: @navbarInverseLinkColorHover;
@navbarInverseLinkBackgroundHover: transparent;
@navbarInverseLinkBackgroundActive: @navbarInverseBackground;
@navbarInverseSearchBackground: lighten(@navbarInverseBackground, 25%);
@navbarInverseSearchBackgroundFocus: @white;
@navbarInverseSearchBorder: @navbarInverseBackground;
@navbarInverseSearchPlaceholderColor: #ccc;
@navbarInverseBrandColor: @navbarInverseLinkColor;
// Pagination
// -------------------------
@paginationBackground: #fff;
@paginationBorder: #ddd;
@paginationActiveBackground: #f5f5f5;
// Hero unit
// -------------------------
@heroUnitBackground: @grayLighter;
@heroUnitHeadingColor: inherit;
@heroUnitLeadColor: inherit;
// Form states and alerts
// -------------------------
@warningText: #c09853;
@warningBackground: #fcf8e3;
@warningBorder: darken(spin(@warningBackground, -10), 3%);
@errorText: #b94a48;
@errorBackground: #f2dede;
@errorBorder: darken(spin(@errorBackground, -10), 3%);
@successText: #468847;
@successBackground: #dff0d8;
@successBorder: darken(spin(@successBackground, -10), 5%);
@infoText: #3a87ad;
@infoBackground: #d9edf7;
@infoBorder: darken(spin(@infoBackground, -10), 7%);
// Tooltips and popovers
// -------------------------
@tooltipColor: #fff;
@tooltipBackground: #000;
@tooltipArrowWidth: 5px;
@tooltipArrowColor: @tooltipBackground;
@popoverBackground: #fff;
@popoverArrowWidth: 10px;
@popoverArrowColor: #fff;
@popoverTitleBackground: darken(@popoverBackground, 3%);
// Special enhancement for popovers
@popoverArrowOuterWidth: @popoverArrowWidth + 1;
@popoverArrowOuterColor: rgba(0,0,0,.25);
// GRID
// --------------------------------------------------
// Default 940px grid
// -------------------------
@gridColumns: 12;
@gridColumnWidth: 60px;
@gridGutterWidth: 20px;
@gridRowWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1));
// 1200px min
@gridColumnWidth1200: 70px;
@gridGutterWidth1200: 30px;
@gridRowWidth1200: (@gridColumns * @gridColumnWidth1200) + (@gridGutterWidth1200 * (@gridColumns - 1));
// 768px-979px
@gridColumnWidth768: 42px;
@gridGutterWidth768: 20px;
@gridRowWidth768: (@gridColumns * @gridColumnWidth768) + (@gridGutterWidth768 * (@gridColumns - 1));
// Fluid grid
// -------------------------
@fluidGridColumnWidth: percentage(@gridColumnWidth/@gridRowWidth);
@fluidGridGutterWidth: percentage(@gridGutterWidth/@gridRowWidth);
// 1200px min
@fluidGridColumnWidth1200: percentage(@gridColumnWidth1200/@gridRowWidth1200);
@fluidGridGutterWidth1200: percentage(@gridGutterWidth1200/@gridRowWidth1200);
// 768px-979px
@fluidGridColumnWidth768: percentage(@gridColumnWidth768/@gridRowWidth768);
@fluidGridGutterWidth768: percentage(@gridGutterWidth768/@gridRowWidth768);

View File

@@ -0,0 +1,193 @@
@bootstrap-switch-base: bootstrap-switch;
.@{bootstrap-switch-base} {
display: inline-block;
direction: ltr;
cursor: pointer;
border-radius: @border-radius-base;
border: 1px solid;
border-color: @btn-default-border;
position: relative;
text-align: left;
overflow: hidden;
line-height: 8px;
z-index: 0;
.user-select(none);
vertical-align: middle;
.transition(~"border-color ease-in-out .15s, box-shadow ease-in-out .15s");
.@{bootstrap-switch-base}-container {
display: inline-block;
top: 0;
border-radius: @border-radius-base;
.translate3d(0, 0, 0);
}
.@{bootstrap-switch-base}-handle-on,
.@{bootstrap-switch-base}-handle-off,
.@{bootstrap-switch-base}-label {
.box-sizing(border-box);
cursor: pointer;
display: inline-block !important;
height: 100%;
padding: @padding-base-vertical @padding-base-horizontal;
font-size: @font-size-base;
line-height: @line-height-computed;
}
.@{bootstrap-switch-base}-handle-on,
.@{bootstrap-switch-base}-handle-off {
text-align: center;
z-index: 1;
&.@{bootstrap-switch-base}-primary {
color: #fff;
background: @btn-primary-bg;
}
&.@{bootstrap-switch-base}-info {
color: #fff;
background: @btn-info-bg;
}
&.@{bootstrap-switch-base}-success {
color: #fff;
background: @btn-success-bg;
}
&.@{bootstrap-switch-base}-warning {
background: @btn-warning-bg;
color: #fff;
}
&.@{bootstrap-switch-base}-danger {
color: #fff;
background: @btn-danger-bg;
}
&.@{bootstrap-switch-base}-default {
color: #000;
background: @gray-lighter;
}
}
.@{bootstrap-switch-base}-label {
text-align: center;
margin-top: -1px;
margin-bottom: -1px;
z-index: 100;
color: @btn-default-color;
background: @btn-default-bg;
}
.@{bootstrap-switch-base}-handle-on {
.border-left-radius(@border-radius-base - 1);
}
.@{bootstrap-switch-base}-handle-off {
.border-right-radius(@border-radius-base - 1);
}
input[type='radio'],
input[type='checkbox'] {
position: absolute !important;
top: 0;
left: 0;
.opacity(0);
z-index: -1;
&.form-control {
height: auto;
}
}
&.@{bootstrap-switch-base}-mini {
.@{bootstrap-switch-base}-handle-on,
.@{bootstrap-switch-base}-handle-off,
.@{bootstrap-switch-base}-label {
padding: @padding-xs-vertical @padding-xs-horizontal;
font-size: @font-size-small;
line-height: @line-height-small;
}
}
&.@{bootstrap-switch-base}-small {
.@{bootstrap-switch-base}-handle-on,
.@{bootstrap-switch-base}-handle-off,
.@{bootstrap-switch-base}-label {
padding: @padding-small-vertical @padding-small-horizontal;
font-size: @font-size-small;
line-height: @line-height-small;
}
}
&.@{bootstrap-switch-base}-large {
.@{bootstrap-switch-base}-handle-on,
.@{bootstrap-switch-base}-handle-off,
.@{bootstrap-switch-base}-label {
padding: @padding-base-vertical @padding-large-horizontal;
font-size: @font-size-large;
line-height: @line-height-large;
}
}
&.@{bootstrap-switch-base}-disabled,
&.@{bootstrap-switch-base}-readonly,
&.@{bootstrap-switch-base}-indeterminate {
cursor: default !important;
.@{bootstrap-switch-base}-handle-on,
.@{bootstrap-switch-base}-handle-off,
.@{bootstrap-switch-base}-label {
.opacity(.5);
cursor: default !important;
}
}
&.@{bootstrap-switch-base}-animate {
.@{bootstrap-switch-base}-container {
.transition(margin-left .5s);
}
}
&.@{bootstrap-switch-base}-inverse {
.@{bootstrap-switch-base}-handle-on {
.border-left-radius(0);
.border-right-radius(@border-radius-base - 1);
}
.@{bootstrap-switch-base}-handle-off {
.border-right-radius(0);
.border-left-radius(@border-radius-base - 1);
}
}
&.@{bootstrap-switch-base}-focused {
@color-rgba: rgba(red(@input-border-focus), green(@input-border-focus), blue(@input-border-focus), .6);
border-color: @input-border-focus;
outline: 0;
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
}
&.@{bootstrap-switch-base}-on,
&.@{bootstrap-switch-base}-inverse.@{bootstrap-switch-base}-off {
.@{bootstrap-switch-base}-label {
.border-right-radius(@border-radius-base - 1);
}
}
&.@{bootstrap-switch-base}-off,
&.@{bootstrap-switch-base}-inverse.@{bootstrap-switch-base}-on {
.@{bootstrap-switch-base}-label {
.border-left-radius(@border-radius-base - 1);
}
}
}

View File

@@ -0,0 +1,3 @@
@import "variables";
@import "mixins";
@import "bootstrap-switch";

View File

@@ -0,0 +1,929 @@
//
// Mixins
// --------------------------------------------------
// Utilities
// -------------------------
// Clearfix
// Source: http://nicolasgallagher.com/micro-clearfix-hack/
//
// For modern browsers
// 1. The space content is one way to avoid an Opera bug when the
// contenteditable attribute is included anywhere else in the document.
// Otherwise it causes space to appear at the top and bottom of elements
// that are clearfixed.
// 2. The use of `table` rather than `block` is only necessary if using
// `:before` to contain the top-margins of child elements.
.clearfix() {
&:before,
&:after {
content: " "; // 1
display: table; // 2
}
&:after {
clear: both;
}
}
// WebKit-style focus
.tab-focus() {
// Default
outline: thin dotted;
// WebKit
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}
// Center-align a block level element
.center-block() {
display: block;
margin-left: auto;
margin-right: auto;
}
// Sizing shortcuts
.size(@width; @height) {
width: @width;
height: @height;
}
.square(@size) {
.size(@size; @size);
}
// Placeholder text
.placeholder(@color: @input-color-placeholder) {
&::-moz-placeholder { color: @color; // Firefox
opacity: 1; } // See https://github.com/twbs/bootstrap/pull/11526
&:-ms-input-placeholder { color: @color; } // Internet Explorer 10+
&::-webkit-input-placeholder { color: @color; } // Safari and Chrome
}
// Text overflow
// Requires inline-block or block for proper styling
.text-overflow() {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
// CSS image replacement
//
// Heads up! v3 launched with with only `.hide-text()`, but per our pattern for
// mixins being reused as classes with the same name, this doesn't hold up. As
// of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. Note
// that we cannot chain the mixins together in Less, so they are repeated.
//
// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
// Deprecated as of v3.0.1 (will be removed in v4)
.hide-text() {
font: ~"0/0" a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
// New mixin to use as of v3.0.1
.text-hide() {
.hide-text();
}
// CSS3 PROPERTIES
// --------------------------------------------------
// Single side border-radius
.border-top-radius(@radius) {
border-top-right-radius: @radius;
border-top-left-radius: @radius;
}
.border-right-radius(@radius) {
border-bottom-right-radius: @radius;
border-top-right-radius: @radius;
}
.border-bottom-radius(@radius) {
border-bottom-right-radius: @radius;
border-bottom-left-radius: @radius;
}
.border-left-radius(@radius) {
border-bottom-left-radius: @radius;
border-top-left-radius: @radius;
}
// Drop shadows
//
// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's
// supported browsers that have box shadow capabilities now support the
// standard `box-shadow` property.
.box-shadow(@shadow) {
-webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
box-shadow: @shadow;
}
// Transitions
.transition(@transition) {
-webkit-transition: @transition;
transition: @transition;
}
.transition-property(@transition-property) {
-webkit-transition-property: @transition-property;
transition-property: @transition-property;
}
.transition-delay(@transition-delay) {
-webkit-transition-delay: @transition-delay;
transition-delay: @transition-delay;
}
.transition-duration(@transition-duration) {
-webkit-transition-duration: @transition-duration;
transition-duration: @transition-duration;
}
.transition-transform(@transition) {
-webkit-transition: -webkit-transform @transition;
-moz-transition: -moz-transform @transition;
-o-transition: -o-transform @transition;
transition: transform @transition;
}
// Transformations
.rotate(@degrees) {
-webkit-transform: rotate(@degrees);
-ms-transform: rotate(@degrees); // IE9 only
transform: rotate(@degrees);
}
.scale(@ratio; @ratio-y...) {
-webkit-transform: scale(@ratio, @ratio-y);
-ms-transform: scale(@ratio, @ratio-y); // IE9 only
transform: scale(@ratio, @ratio-y);
}
.translate(@x; @y) {
-webkit-transform: translate(@x, @y);
-ms-transform: translate(@x, @y); // IE9 only
transform: translate(@x, @y);
}
.skew(@x; @y) {
-webkit-transform: skew(@x, @y);
-ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
transform: skew(@x, @y);
}
.translate3d(@x; @y; @z) {
-webkit-transform: translate3d(@x, @y, @z);
transform: translate3d(@x, @y, @z);
}
.rotateX(@degrees) {
-webkit-transform: rotateX(@degrees);
-ms-transform: rotateX(@degrees); // IE9 only
transform: rotateX(@degrees);
}
.rotateY(@degrees) {
-webkit-transform: rotateY(@degrees);
-ms-transform: rotateY(@degrees); // IE9 only
transform: rotateY(@degrees);
}
.perspective(@perspective) {
-webkit-perspective: @perspective;
-moz-perspective: @perspective;
perspective: @perspective;
}
.perspective-origin(@perspective) {
-webkit-perspective-origin: @perspective;
-moz-perspective-origin: @perspective;
perspective-origin: @perspective;
}
.transform-origin(@origin) {
-webkit-transform-origin: @origin;
-moz-transform-origin: @origin;
-ms-transform-origin: @origin; // IE9 only
transform-origin: @origin;
}
// Animations
.animation(@animation) {
-webkit-animation: @animation;
animation: @animation;
}
.animation-name(@name) {
-webkit-animation-name: @name;
animation-name: @name;
}
.animation-duration(@duration) {
-webkit-animation-duration: @duration;
animation-duration: @duration;
}
.animation-timing-function(@timing-function) {
-webkit-animation-timing-function: @timing-function;
animation-timing-function: @timing-function;
}
.animation-delay(@delay) {
-webkit-animation-delay: @delay;
animation-delay: @delay;
}
.animation-iteration-count(@iteration-count) {
-webkit-animation-iteration-count: @iteration-count;
animation-iteration-count: @iteration-count;
}
.animation-direction(@direction) {
-webkit-animation-direction: @direction;
animation-direction: @direction;
}
// Backface visibility
// Prevent browsers from flickering when using CSS 3D transforms.
// Default value is `visible`, but can be changed to `hidden`
.backface-visibility(@visibility){
-webkit-backface-visibility: @visibility;
-moz-backface-visibility: @visibility;
backface-visibility: @visibility;
}
// Box sizing
.box-sizing(@boxmodel) {
-webkit-box-sizing: @boxmodel;
-moz-box-sizing: @boxmodel;
box-sizing: @boxmodel;
}
// User select
// For selecting text on the page
.user-select(@select) {
-webkit-user-select: @select;
-moz-user-select: @select;
-ms-user-select: @select; // IE10+
user-select: @select;
}
// Resize anything
.resizable(@direction) {
resize: @direction; // Options: horizontal, vertical, both
overflow: auto; // Safari fix
}
// CSS3 Content Columns
.content-columns(@column-count; @column-gap: @grid-gutter-width) {
-webkit-column-count: @column-count;
-moz-column-count: @column-count;
column-count: @column-count;
-webkit-column-gap: @column-gap;
-moz-column-gap: @column-gap;
column-gap: @column-gap;
}
// Optional hyphenation
.hyphens(@mode: auto) {
word-wrap: break-word;
-webkit-hyphens: @mode;
-moz-hyphens: @mode;
-ms-hyphens: @mode; // IE10+
-o-hyphens: @mode;
hyphens: @mode;
}
// Opacity
.opacity(@opacity) {
opacity: @opacity;
// IE8 filter
@opacity-ie: (@opacity * 100);
filter: ~"alpha(opacity=@{opacity-ie})";
}
// GRADIENTS
// --------------------------------------------------
#gradient {
// Horizontal gradient, from left to right
//
// Creates two color stops, start and end, by specifying a color and position for each color stop.
// Color stops are not available in IE9 and below.
.horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
background-image: -webkit-linear-gradient(left, color-stop(@start-color @start-percent), color-stop(@end-color @end-percent)); // Safari 5.1-6, Chrome 10+
background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
background-repeat: repeat-x;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down
}
// Vertical gradient, from top to bottom
//
// Creates two color stops, start and end, by specifying a color and position for each color stop.
// Color stops are not available in IE9 and below.
.vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) {
background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+
background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
background-repeat: repeat-x;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down
}
.directional(@start-color: #555; @end-color: #333; @deg: 45deg) {
background-repeat: repeat-x;
background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1-6, Chrome 10+
background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
}
.horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color);
background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);
background-repeat: no-repeat;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback
}
.vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) {
background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color);
background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);
background-repeat: no-repeat;
filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback
}
.radial(@inner-color: #555; @outer-color: #333) {
background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color);
background-image: radial-gradient(circle, @inner-color, @outer-color);
background-repeat: no-repeat;
}
.striped(@color: rgba(255,255,255,.15); @angle: 45deg) {
background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);
background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);
}
}
// Reset filters for IE
//
// When you need to remove a gradient background, do not forget to use this to reset
// the IE filter for IE9 and below.
.reset-filter() {
filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
}
// Retina images
//
// Short retina mixin for setting background-image and -size
.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) {
background-image: url("@{file-1x}");
@media
only screen and (-webkit-min-device-pixel-ratio: 2),
only screen and ( min--moz-device-pixel-ratio: 2),
only screen and ( -o-min-device-pixel-ratio: 2/1),
only screen and ( min-device-pixel-ratio: 2),
only screen and ( min-resolution: 192dpi),
only screen and ( min-resolution: 2dppx) {
background-image: url("@{file-2x}");
background-size: @width-1x @height-1x;
}
}
// Responsive image
//
// Keep images from scaling beyond the width of their parents.
.img-responsive(@display: block) {
display: @display;
max-width: 100%; // Part 1: Set a maximum relative to the parent
height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
}
// COMPONENT MIXINS
// --------------------------------------------------
// Horizontal dividers
// -------------------------
// Dividers (basically an hr) within dropdowns and nav lists
.nav-divider(@color: #e5e5e5) {
height: 1px;
margin: ((@line-height-computed / 2) - 1) 0;
overflow: hidden;
background-color: @color;
}
// Panels
// -------------------------
.panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) {
border-color: @border;
& > .panel-heading {
color: @heading-text-color;
background-color: @heading-bg-color;
border-color: @heading-border;
+ .panel-collapse .panel-body {
border-top-color: @border;
}
}
& > .panel-footer {
+ .panel-collapse .panel-body {
border-bottom-color: @border;
}
}
}
// Alerts
// -------------------------
.alert-variant(@background; @border; @text-color) {
background-color: @background;
border-color: @border;
color: @text-color;
hr {
border-top-color: darken(@border, 5%);
}
.alert-link {
color: darken(@text-color, 10%);
}
}
// Tables
// -------------------------
.table-row-variant(@state; @background) {
// Exact selectors below required to override `.table-striped` and prevent
// inheritance to nested tables.
.table > thead > tr,
.table > tbody > tr,
.table > tfoot > tr {
> td.@{state},
> th.@{state},
&.@{state} > td,
&.@{state} > th {
background-color: @background;
}
}
// Hover states for `.table-hover`
// Note: this is not available for cells or rows within `thead` or `tfoot`.
.table-hover > tbody > tr {
> td.@{state}:hover,
> th.@{state}:hover,
&.@{state}:hover > td,
&.@{state}:hover > th {
background-color: darken(@background, 5%);
}
}
}
// List Groups
// -------------------------
.list-group-item-variant(@state; @background; @color) {
.list-group-item-@{state} {
color: @color;
background-color: @background;
a& {
color: @color;
.list-group-item-heading { color: inherit; }
&:hover,
&:focus {
color: @color;
background-color: darken(@background, 5%);
}
&.active,
&.active:hover,
&.active:focus {
color: #fff;
background-color: @color;
border-color: @color;
}
}
}
}
// Button variants
// -------------------------
// Easily pump out default styles, as well as :hover, :focus, :active,
// and disabled options for all buttons
.button-variant(@color; @background; @border) {
color: @color;
background-color: @background;
border-color: @border;
&:hover,
&:focus,
&:active,
&.active,
.open .dropdown-toggle& {
color: @color;
background-color: darken(@background, 8%);
border-color: darken(@border, 12%);
}
&:active,
&.active,
.open .dropdown-toggle& {
background-image: none;
}
&.disabled,
&[disabled],
fieldset[disabled] & {
&,
&:hover,
&:focus,
&:active,
&.active {
background-color: @background;
border-color: @border;
}
}
.badge {
color: @background;
background-color: @color;
}
}
// Button sizes
// -------------------------
.button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
padding: @padding-vertical @padding-horizontal;
font-size: @font-size;
line-height: @line-height;
border-radius: @border-radius;
}
// Pagination
// -------------------------
.pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) {
> li {
> a,
> span {
padding: @padding-vertical @padding-horizontal;
font-size: @font-size;
}
&:first-child {
> a,
> span {
.border-left-radius(@border-radius);
}
}
&:last-child {
> a,
> span {
.border-right-radius(@border-radius);
}
}
}
}
// Labels
// -------------------------
.label-variant(@color) {
background-color: @color;
&[href] {
&:hover,
&:focus {
background-color: darken(@color, 10%);
}
}
}
// Contextual backgrounds
// -------------------------
.bg-variant(@color) {
background-color: @color;
a&:hover {
background-color: darken(@color, 10%);
}
}
// Typography
// -------------------------
.text-emphasis-variant(@color) {
color: @color;
a&:hover {
color: darken(@color, 10%);
}
}
// Navbar vertical align
// -------------------------
// Vertically center elements in the navbar.
// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
.navbar-vertical-align(@element-height) {
margin-top: ((@navbar-height - @element-height) / 2);
margin-bottom: ((@navbar-height - @element-height) / 2);
}
// Progress bars
// -------------------------
.progress-bar-variant(@color) {
background-color: @color;
.progress-striped & {
#gradient > .striped();
}
}
// Responsive utilities
// -------------------------
// More easily include all the states for responsive-utilities.less.
.responsive-visibility() {
display: block !important;
table& { display: table; }
tr& { display: table-row !important; }
th&,
td& { display: table-cell !important; }
}
.responsive-invisibility() {
display: none !important;
}
// Grid System
// -----------
// Centered container element
.container-fixed() {
margin-right: auto;
margin-left: auto;
padding-left: (@grid-gutter-width / 2);
padding-right: (@grid-gutter-width / 2);
&:extend(.clearfix all);
}
// Creates a wrapper for a series of columns
.make-row(@gutter: @grid-gutter-width) {
margin-left: (@gutter / -2);
margin-right: (@gutter / -2);
&:extend(.clearfix all);
}
// Generate the extra small columns
.make-xs-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
float: left;
width: percentage((@columns / @grid-columns));
min-height: 1px;
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
}
.make-xs-column-offset(@columns) {
@media (min-width: @screen-xs-min) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-xs-column-push(@columns) {
@media (min-width: @screen-xs-min) {
left: percentage((@columns / @grid-columns));
}
}
.make-xs-column-pull(@columns) {
@media (min-width: @screen-xs-min) {
right: percentage((@columns / @grid-columns));
}
}
// Generate the small columns
.make-sm-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
min-height: 1px;
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
@media (min-width: @screen-sm-min) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
.make-sm-column-offset(@columns) {
@media (min-width: @screen-sm-min) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-sm-column-push(@columns) {
@media (min-width: @screen-sm-min) {
left: percentage((@columns / @grid-columns));
}
}
.make-sm-column-pull(@columns) {
@media (min-width: @screen-sm-min) {
right: percentage((@columns / @grid-columns));
}
}
// Generate the medium columns
.make-md-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
min-height: 1px;
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
@media (min-width: @screen-md-min) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
.make-md-column-offset(@columns) {
@media (min-width: @screen-md-min) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-md-column-push(@columns) {
@media (min-width: @screen-md-min) {
left: percentage((@columns / @grid-columns));
}
}
.make-md-column-pull(@columns) {
@media (min-width: @screen-md-min) {
right: percentage((@columns / @grid-columns));
}
}
// Generate the large columns
.make-lg-column(@columns; @gutter: @grid-gutter-width) {
position: relative;
min-height: 1px;
padding-left: (@gutter / 2);
padding-right: (@gutter / 2);
@media (min-width: @screen-lg-min) {
float: left;
width: percentage((@columns / @grid-columns));
}
}
.make-lg-column-offset(@columns) {
@media (min-width: @screen-lg-min) {
margin-left: percentage((@columns / @grid-columns));
}
}
.make-lg-column-push(@columns) {
@media (min-width: @screen-lg-min) {
left: percentage((@columns / @grid-columns));
}
}
.make-lg-column-pull(@columns) {
@media (min-width: @screen-lg-min) {
right: percentage((@columns / @grid-columns));
}
}
// Framework grid generation
//
// Used only by Bootstrap to generate the correct number of grid classes given
// any value of `@grid-columns`.
.make-grid-columns() {
// Common styles for all sizes of grid columns, widths 1-12
.col(@index) when (@index = 1) { // initial
@item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
.col((@index + 1), @item);
}
.col(@index, @list) when (@index =< @grid-columns) { // general; "=<" isn't a typo
@item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}";
.col((@index + 1), ~"@{list}, @{item}");
}
.col(@index, @list) when (@index > @grid-columns) { // terminal
@{list} {
position: relative;
// Prevent columns from collapsing when empty
min-height: 1px;
// Inner gutter via padding
padding-left: (@grid-gutter-width / 2);
padding-right: (@grid-gutter-width / 2);
}
}
.col(1); // kickstart it
}
.float-grid-columns(@class) {
.col(@index) when (@index = 1) { // initial
@item: ~".col-@{class}-@{index}";
.col((@index + 1), @item);
}
.col(@index, @list) when (@index =< @grid-columns) { // general
@item: ~".col-@{class}-@{index}";
.col((@index + 1), ~"@{list}, @{item}");
}
.col(@index, @list) when (@index > @grid-columns) { // terminal
@{list} {
float: left;
}
}
.col(1); // kickstart it
}
.calc-grid-column(@index, @class, @type) when (@type = width) and (@index > 0) {
.col-@{class}-@{index} {
width: percentage((@index / @grid-columns));
}
}
.calc-grid-column(@index, @class, @type) when (@type = push) {
.col-@{class}-push-@{index} {
left: percentage((@index / @grid-columns));
}
}
.calc-grid-column(@index, @class, @type) when (@type = pull) {
.col-@{class}-pull-@{index} {
right: percentage((@index / @grid-columns));
}
}
.calc-grid-column(@index, @class, @type) when (@type = offset) {
.col-@{class}-offset-@{index} {
margin-left: percentage((@index / @grid-columns));
}
}
// Basic looping in LESS
.loop-grid-columns(@index, @class, @type) when (@index >= 0) {
.calc-grid-column(@index, @class, @type);
// next iteration
.loop-grid-columns((@index - 1), @class, @type);
}
// Create grid for specific class
.make-grid(@class) {
.float-grid-columns(@class);
.loop-grid-columns(@grid-columns, @class, width);
.loop-grid-columns(@grid-columns, @class, pull);
.loop-grid-columns(@grid-columns, @class, push);
.loop-grid-columns(@grid-columns, @class, offset);
}
// Form validation states
//
// Used in forms.less to generate the form validation CSS for warnings, errors,
// and successes.
.form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) {
// Color the label and help text
.help-block,
.control-label,
.radio,
.checkbox,
.radio-inline,
.checkbox-inline {
color: @text-color;
}
// Set the border and box shadow on specific inputs to match
.form-control {
border-color: @border-color;
.box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
&:focus {
border-color: darken(@border-color, 10%);
@shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%);
.box-shadow(@shadow);
}
}
// Set validation states also for addons
.input-group-addon {
color: @text-color;
border-color: @border-color;
background-color: @background-color;
}
// Optional feedback icon
.form-control-feedback {
color: @text-color;
}
}
// Form control focus state
//
// Generate a customized focus state and for any input with the specified color,
// which defaults to the `@input-focus-border` variable.
//
// We highly encourage you to not customize the default value, but instead use
// this to tweak colors on an as-needed basis. This aesthetic change is based on
// WebKit's default styles, but applicable to a wider range of browsers. Its
// usability and accessibility should be taken into account with any change.
//
// Example usage: change the default blue border and shadow to white for better
// contrast against a dark gray background.
.form-control-focus(@color: @input-border-focus) {
@color-rgba: rgba(red(@color), green(@color), blue(@color), .6);
&:focus {
border-color: @color;
outline: 0;
.box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}");
}
}
// Form control sizing
//
// Relative text size, padding, and border-radii changes for form controls. For
// horizontal sizing, wrap controls in the predefined grid classes. `<select>`
// element gets special love because it's special, and that's a fact!
.input-size(@input-height; @padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) {
height: @input-height;
padding: @padding-vertical @padding-horizontal;
font-size: @font-size;
line-height: @line-height;
border-radius: @border-radius;
select& {
height: @input-height;
line-height: @input-height;
}
textarea&,
select[multiple]& {
height: auto;
}
}

View File

@@ -0,0 +1,829 @@
//
// Variables
// --------------------------------------------------
//== Colors
//
//## Gray and brand colors for use across Bootstrap.
@gray-darker: lighten(#000, 13.5%); // #222
@gray-dark: lighten(#000, 20%); // #333
@gray: lighten(#000, 33.5%); // #555
@gray-light: lighten(#000, 60%); // #999
@gray-lighter: lighten(#000, 93.5%); // #eee
@brand-primary: #428bca;
@brand-success: #5cb85c;
@brand-info: #5bc0de;
@brand-warning: #f0ad4e;
@brand-danger: #d9534f;
//== Scaffolding
//
// ## Settings for some of the most global styles.
//** Background color for `<body>`.
@body-bg: #fff;
//** Global text color on `<body>`.
@text-color: @gray-dark;
//** Global textual link color.
@link-color: @brand-primary;
//** Link hover color set via `darken()` function.
@link-hover-color: darken(@link-color, 15%);
//== Typography
//
//## Font, line-height, and color for body text, headings, and more.
@font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
@font-family-serif: Georgia, "Times New Roman", Times, serif;
//** Default monospace fonts for `<code>`, `<kbd>`, and `<pre>`.
@font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace;
@font-family-base: @font-family-sans-serif;
@font-size-base: 14px;
@font-size-large: ceil((@font-size-base * 1.25)); // ~18px
@font-size-small: ceil((@font-size-base * 0.85)); // ~12px
@font-size-h1: floor((@font-size-base * 2.6)); // ~36px
@font-size-h2: floor((@font-size-base * 2.15)); // ~30px
@font-size-h3: ceil((@font-size-base * 1.7)); // ~24px
@font-size-h4: ceil((@font-size-base * 1.25)); // ~18px
@font-size-h5: @font-size-base;
@font-size-h6: ceil((@font-size-base * 0.85)); // ~12px
//** Unit-less `line-height` for use in components like buttons.
@line-height-base: 1.428571429; // 20/14
//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
@line-height-computed: floor((@font-size-base * @line-height-base)); // ~20px
//** By default, this inherits from the `<body>`.
@headings-font-family: inherit;
@headings-font-weight: 500;
@headings-line-height: 1.1;
@headings-color: inherit;
//-- Iconography
//
//## Specify custom locations of the include Glyphicons icon font. Useful for those including Bootstrap via Bower.
@icon-font-path: "../fonts/";
@icon-font-name: "glyphicons-halflings-regular";
@icon-font-svg-id: "glyphicons_halflingsregular";
//== Components
//
//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).
@padding-base-vertical: 6px;
@padding-base-horizontal: 12px;
@padding-large-vertical: 10px;
@padding-large-horizontal: 16px;
@padding-small-vertical: 5px;
@padding-small-horizontal: 10px;
@padding-xs-vertical: 1px;
@padding-xs-horizontal: 5px;
@line-height-large: 1.33;
@line-height-small: 1.5;
@border-radius-base: 4px;
@border-radius-large: 6px;
@border-radius-small: 3px;
//** Global color for active items (e.g., navs or dropdowns).
@component-active-color: #fff;
//** Global background color for active items (e.g., navs or dropdowns).
@component-active-bg: @brand-primary;
//** Width of the `border` for generating carets that indicator dropdowns.
@caret-width-base: 4px;
//** Carets increase slightly in size for larger components.
@caret-width-large: 5px;
//== Tables
//
//## Customizes the `.table` component with basic values, each used across all table variations.
//** Padding for `<th>`s and `<td>`s.
@table-cell-padding: 8px;
//** Padding for cells in `.table-condensed`.
@table-condensed-cell-padding: 5px;
//** Default background color used for all tables.
@table-bg: transparent;
//** Background color used for `.table-striped`.
@table-bg-accent: #f9f9f9;
//** Background color used for `.table-hover`.
@table-bg-hover: #f5f5f5;
@table-bg-active: @table-bg-hover;
//** Border color for table and cell borders.
@table-border-color: #ddd;
//== Buttons
//
//## For each of Bootstrap's buttons, define text, background and border color.
@btn-font-weight: normal;
@btn-default-color: #333;
@btn-default-bg: #fff;
@btn-default-border: #ccc;
@btn-primary-color: #fff;
@btn-primary-bg: @brand-primary;
@btn-primary-border: darken(@btn-primary-bg, 5%);
@btn-success-color: #fff;
@btn-success-bg: @brand-success;
@btn-success-border: darken(@btn-success-bg, 5%);
@btn-info-color: #fff;
@btn-info-bg: @brand-info;
@btn-info-border: darken(@btn-info-bg, 5%);
@btn-warning-color: #fff;
@btn-warning-bg: @brand-warning;
@btn-warning-border: darken(@btn-warning-bg, 5%);
@btn-danger-color: #fff;
@btn-danger-bg: @brand-danger;
@btn-danger-border: darken(@btn-danger-bg, 5%);
@btn-link-disabled-color: @gray-light;
//== Forms
//
//##
//** `<input>` background color
@input-bg: #fff;
//** `<input disabled>` background color
@input-bg-disabled: @gray-lighter;
//** Text color for `<input>`s
@input-color: @gray;
//** `<input>` border color
@input-border: #ccc;
//** `<input>` border radius
@input-border-radius: @border-radius-base;
//** Border color for inputs on focus
@input-border-focus: #66afe9;
//** Placeholder text color
@input-color-placeholder: @gray-light;
//** Default `.form-control` height
@input-height-base: (@line-height-computed + (@padding-base-vertical * 2) + 2);
//** Large `.form-control` height
@input-height-large: (ceil(@font-size-large * @line-height-large) + (@padding-large-vertical * 2) + 2);
//** Small `.form-control` height
@input-height-small: (floor(@font-size-small * @line-height-small) + (@padding-small-vertical * 2) + 2);
@legend-color: @gray-dark;
@legend-border-color: #e5e5e5;
//** Background color for textual input addons
@input-group-addon-bg: @gray-lighter;
//** Border color for textual input addons
@input-group-addon-border-color: @input-border;
//== Dropdowns
//
//## Dropdown menu container and contents.
//** Background for the dropdown menu.
@dropdown-bg: #fff;
//** Dropdown menu `border-color`.
@dropdown-border: rgba(0,0,0,.15);
//** Dropdown menu `border-color` **for IE8**.
@dropdown-fallback-border: #ccc;
//** Divider color for between dropdown items.
@dropdown-divider-bg: #e5e5e5;
//** Dropdown link text color.
@dropdown-link-color: @gray-dark;
//** Hover color for dropdown links.
@dropdown-link-hover-color: darken(@gray-dark, 5%);
//** Hover background for dropdown links.
@dropdown-link-hover-bg: #f5f5f5;
//** Active dropdown menu item text color.
@dropdown-link-active-color: @component-active-color;
//** Active dropdown menu item background color.
@dropdown-link-active-bg: @component-active-bg;
//** Disabled dropdown menu item background color.
@dropdown-link-disabled-color: @gray-light;
//** Text color for headers within dropdown menus.
@dropdown-header-color: @gray-light;
// Note: Deprecated @dropdown-caret-color as of v3.1.0
@dropdown-caret-color: #000;
//-- Z-index master list
//
// Warning: Avoid customizing these values. They're used for a bird's eye view
// of components dependent on the z-axis and are designed to all work together.
//
// Note: These variables are not generated into the Customizer.
@zindex-navbar: 1000;
@zindex-dropdown: 1000;
@zindex-popover: 1010;
@zindex-tooltip: 1030;
@zindex-navbar-fixed: 1030;
@zindex-modal-background: 1040;
@zindex-modal: 1050;
//== Media queries breakpoints
//
//## Define the breakpoints at which your layout will change, adapting to different screen sizes.
// Extra small screen / phone
// Note: Deprecated @screen-xs and @screen-phone as of v3.0.1
@screen-xs: 480px;
@screen-xs-min: @screen-xs;
@screen-phone: @screen-xs-min;
// Small screen / tablet
// Note: Deprecated @screen-sm and @screen-tablet as of v3.0.1
@screen-sm: 768px;
@screen-sm-min: @screen-sm;
@screen-tablet: @screen-sm-min;
// Medium screen / desktop
// Note: Deprecated @screen-md and @screen-desktop as of v3.0.1
@screen-md: 992px;
@screen-md-min: @screen-md;
@screen-desktop: @screen-md-min;
// Large screen / wide desktop
// Note: Deprecated @screen-lg and @screen-lg-desktop as of v3.0.1
@screen-lg: 1200px;
@screen-lg-min: @screen-lg;
@screen-lg-desktop: @screen-lg-min;
// So media queries don't overlap when required, provide a maximum
@screen-xs-max: (@screen-sm-min - 1);
@screen-sm-max: (@screen-md-min - 1);
@screen-md-max: (@screen-lg-min - 1);
//== Grid system
//
//## Define your custom responsive grid.
//** Number of columns in the grid.
@grid-columns: 12;
//** Padding between columns. Gets divided in half for the left and right.
@grid-gutter-width: 30px;
// Navbar collapse
//** Point at which the navbar becomes uncollapsed.
@grid-float-breakpoint: @screen-sm-min;
//** Point at which the navbar begins collapsing.
@grid-float-breakpoint-max: (@grid-float-breakpoint - 1);
//== Container sizes
//
//## Define the maximum width of `.container` for different screen sizes.
// Small screen / tablet
@container-tablet: ((720px + @grid-gutter-width));
//** For `@screen-sm-min` and up.
@container-sm: @container-tablet;
// Medium screen / desktop
@container-desktop: ((940px + @grid-gutter-width));
//** For `@screen-md-min` and up.
@container-md: @container-desktop;
// Large screen / wide desktop
@container-large-desktop: ((1140px + @grid-gutter-width));
//** For `@screen-lg-min` and up.
@container-lg: @container-large-desktop;
//== Navbar
//
//##
// Basics of a navbar
@navbar-height: 50px;
@navbar-margin-bottom: @line-height-computed;
@navbar-border-radius: @border-radius-base;
@navbar-padding-horizontal: floor((@grid-gutter-width / 2));
@navbar-padding-vertical: ((@navbar-height - @line-height-computed) / 2);
@navbar-collapse-max-height: 340px;
@navbar-default-color: #777;
@navbar-default-bg: #f8f8f8;
@navbar-default-border: darken(@navbar-default-bg, 6.5%);
// Navbar links
@navbar-default-link-color: #777;
@navbar-default-link-hover-color: #333;
@navbar-default-link-hover-bg: transparent;
@navbar-default-link-active-color: #555;
@navbar-default-link-active-bg: darken(@navbar-default-bg, 6.5%);
@navbar-default-link-disabled-color: #ccc;
@navbar-default-link-disabled-bg: transparent;
// Navbar brand label
@navbar-default-brand-color: @navbar-default-link-color;
@navbar-default-brand-hover-color: darken(@navbar-default-brand-color, 10%);
@navbar-default-brand-hover-bg: transparent;
// Navbar toggle
@navbar-default-toggle-hover-bg: #ddd;
@navbar-default-toggle-icon-bar-bg: #888;
@navbar-default-toggle-border-color: #ddd;
// Inverted navbar
// Reset inverted navbar basics
@navbar-inverse-color: @gray-light;
@navbar-inverse-bg: #222;
@navbar-inverse-border: darken(@navbar-inverse-bg, 10%);
// Inverted navbar links
@navbar-inverse-link-color: @gray-light;
@navbar-inverse-link-hover-color: #fff;
@navbar-inverse-link-hover-bg: transparent;
@navbar-inverse-link-active-color: @navbar-inverse-link-hover-color;
@navbar-inverse-link-active-bg: darken(@navbar-inverse-bg, 10%);
@navbar-inverse-link-disabled-color: #444;
@navbar-inverse-link-disabled-bg: transparent;
// Inverted navbar brand label
@navbar-inverse-brand-color: @navbar-inverse-link-color;
@navbar-inverse-brand-hover-color: #fff;
@navbar-inverse-brand-hover-bg: transparent;
// Inverted navbar toggle
@navbar-inverse-toggle-hover-bg: #333;
@navbar-inverse-toggle-icon-bar-bg: #fff;
@navbar-inverse-toggle-border-color: #333;
//== Navs
//
//##
//=== Shared nav styles
@nav-link-padding: 10px 15px;
@nav-link-hover-bg: @gray-lighter;
@nav-disabled-link-color: @gray-light;
@nav-disabled-link-hover-color: @gray-light;
@nav-open-link-hover-color: #fff;
//== Tabs
@nav-tabs-border-color: #ddd;
@nav-tabs-link-hover-border-color: @gray-lighter;
@nav-tabs-active-link-hover-bg: @body-bg;
@nav-tabs-active-link-hover-color: @gray;
@nav-tabs-active-link-hover-border-color: #ddd;
@nav-tabs-justified-link-border-color: #ddd;
@nav-tabs-justified-active-link-border-color: @body-bg;
//== Pills
@nav-pills-border-radius: @border-radius-base;
@nav-pills-active-link-hover-bg: @component-active-bg;
@nav-pills-active-link-hover-color: @component-active-color;
//== Pagination
//
//##
@pagination-color: @link-color;
@pagination-bg: #fff;
@pagination-border: #ddd;
@pagination-hover-color: @link-hover-color;
@pagination-hover-bg: @gray-lighter;
@pagination-hover-border: #ddd;
@pagination-active-color: #fff;
@pagination-active-bg: @brand-primary;
@pagination-active-border: @brand-primary;
@pagination-disabled-color: @gray-light;
@pagination-disabled-bg: #fff;
@pagination-disabled-border: #ddd;
//== Pager
//
//##
@pager-bg: @pagination-bg;
@pager-border: @pagination-border;
@pager-border-radius: 15px;
@pager-hover-bg: @pagination-hover-bg;
@pager-active-bg: @pagination-active-bg;
@pager-active-color: @pagination-active-color;
@pager-disabled-color: @pagination-disabled-color;
//== Jumbotron
//
//##
@jumbotron-padding: 30px;
@jumbotron-color: inherit;
@jumbotron-bg: @gray-lighter;
@jumbotron-heading-color: inherit;
@jumbotron-font-size: ceil((@font-size-base * 1.5));
//== Form states and alerts
//
//## Define colors for form feedback states and, by default, alerts.
@state-success-text: #3c763d;
@state-success-bg: #dff0d8;
@state-success-border: darken(spin(@state-success-bg, -10), 5%);
@state-info-text: #31708f;
@state-info-bg: #d9edf7;
@state-info-border: darken(spin(@state-info-bg, -10), 7%);
@state-warning-text: #8a6d3b;
@state-warning-bg: #fcf8e3;
@state-warning-border: darken(spin(@state-warning-bg, -10), 5%);
@state-danger-text: #a94442;
@state-danger-bg: #f2dede;
@state-danger-border: darken(spin(@state-danger-bg, -10), 5%);
//== Tooltips
//
//##
//** Tooltip max width
@tooltip-max-width: 200px;
//** Tooltip text color
@tooltip-color: #fff;
//** Tooltip background color
@tooltip-bg: #000;
@tooltip-opacity: .9;
//** Tooltip arrow width
@tooltip-arrow-width: 5px;
//** Tooltip arrow color
@tooltip-arrow-color: @tooltip-bg;
//== Popovers
//
//##
//** Popover body background color
@popover-bg: #fff;
//** Popover maximum width
@popover-max-width: 276px;
//** Popover border color
@popover-border-color: rgba(0,0,0,.2);
//** Popover fallback border color
@popover-fallback-border-color: #ccc;
//** Popover title background color
@popover-title-bg: darken(@popover-bg, 3%);
//** Popover arrow width
@popover-arrow-width: 10px;
//** Popover arrow color
@popover-arrow-color: #fff;
//** Popover outer arrow width
@popover-arrow-outer-width: (@popover-arrow-width + 1);
//** Popover outer arrow color
@popover-arrow-outer-color: fadein(@popover-border-color, 5%);
//** Popover outer arrow fallback color
@popover-arrow-outer-fallback-color: darken(@popover-fallback-border-color, 20%);
//== Labels
//
//##
//** Default label background color
@label-default-bg: @gray-light;
//** Primary label background color
@label-primary-bg: @brand-primary;
//** Success label background color
@label-success-bg: @brand-success;
//** Info label background color
@label-info-bg: @brand-info;
//** Warning label background color
@label-warning-bg: @brand-warning;
//** Danger label background color
@label-danger-bg: @brand-danger;
//** Default label text color
@label-color: #fff;
//** Default text color of a linked label
@label-link-hover-color: #fff;
//== Modals
//
//##
//** Padding applied to the modal body
@modal-inner-padding: 20px;
//** Padding applied to the modal title
@modal-title-padding: 15px;
//** Modal title line-height
@modal-title-line-height: @line-height-base;
//** Background color of modal content area
@modal-content-bg: #fff;
//** Modal content border color
@modal-content-border-color: rgba(0,0,0,.2);
//** Modal content border color **for IE8**
@modal-content-fallback-border-color: #999;
//** Modal backdrop background color
@modal-backdrop-bg: #000;
//** Modal backdrop opacity
@modal-backdrop-opacity: .5;
//** Modal header border color
@modal-header-border-color: #e5e5e5;
//** Modal footer border color
@modal-footer-border-color: @modal-header-border-color;
@modal-lg: 900px;
@modal-md: 600px;
@modal-sm: 300px;
//== Alerts
//
//## Define alert colors, border radius, and padding.
@alert-padding: 15px;
@alert-border-radius: @border-radius-base;
@alert-link-font-weight: bold;
@alert-success-bg: @state-success-bg;
@alert-success-text: @state-success-text;
@alert-success-border: @state-success-border;
@alert-info-bg: @state-info-bg;
@alert-info-text: @state-info-text;
@alert-info-border: @state-info-border;
@alert-warning-bg: @state-warning-bg;
@alert-warning-text: @state-warning-text;
@alert-warning-border: @state-warning-border;
@alert-danger-bg: @state-danger-bg;
@alert-danger-text: @state-danger-text;
@alert-danger-border: @state-danger-border;
//== Progress bars
//
//##
//** Background color of the whole progress component
@progress-bg: #f5f5f5;
//** Progress bar text color
@progress-bar-color: #fff;
//** Default progress bar color
@progress-bar-bg: @brand-primary;
//** Success progress bar color
@progress-bar-success-bg: @brand-success;
//** Warning progress bar color
@progress-bar-warning-bg: @brand-warning;
//** Danger progress bar color
@progress-bar-danger-bg: @brand-danger;
//** Info progress bar color
@progress-bar-info-bg: @brand-info;
//== List group
//
//##
//** Background color on `.list-group-item`
@list-group-bg: #fff;
//** `.list-group-item` border color
@list-group-border: #ddd;
//** List group border radius
@list-group-border-radius: @border-radius-base;
//** Background color of single list elements on hover
@list-group-hover-bg: #f5f5f5;
//** Text color of active list elements
@list-group-active-color: @component-active-color;
//** Background color of active list elements
@list-group-active-bg: @component-active-bg;
//** Border color of active list elements
@list-group-active-border: @list-group-active-bg;
@list-group-active-text-color: lighten(@list-group-active-bg, 40%);
@list-group-link-color: #555;
@list-group-link-heading-color: #333;
//== Panels
//
//##
@panel-bg: #fff;
@panel-body-padding: 15px;
@panel-border-radius: @border-radius-base;
//** Border color for elements within panels
@panel-inner-border: #ddd;
@panel-footer-bg: #f5f5f5;
@panel-default-text: @gray-dark;
@panel-default-border: #ddd;
@panel-default-heading-bg: #f5f5f5;
@panel-primary-text: #fff;
@panel-primary-border: @brand-primary;
@panel-primary-heading-bg: @brand-primary;
@panel-success-text: @state-success-text;
@panel-success-border: @state-success-border;
@panel-success-heading-bg: @state-success-bg;
@panel-info-text: @state-info-text;
@panel-info-border: @state-info-border;
@panel-info-heading-bg: @state-info-bg;
@panel-warning-text: @state-warning-text;
@panel-warning-border: @state-warning-border;
@panel-warning-heading-bg: @state-warning-bg;
@panel-danger-text: @state-danger-text;
@panel-danger-border: @state-danger-border;
@panel-danger-heading-bg: @state-danger-bg;
//== Thumbnails
//
//##
//** Padding around the thumbnail image
@thumbnail-padding: 4px;
//** Thumbnail background color
@thumbnail-bg: @body-bg;
//** Thumbnail border color
@thumbnail-border: #ddd;
//** Thumbnail border radius
@thumbnail-border-radius: @border-radius-base;
//** Custom text color for thumbnail captions
@thumbnail-caption-color: @text-color;
//** Padding around the thumbnail caption
@thumbnail-caption-padding: 9px;
//== Wells
//
//##
@well-bg: #f5f5f5;
@well-border: darken(@well-bg, 7%);
//== Badges
//
//##
@badge-color: #fff;
//** Linked badge text color on hover
@badge-link-hover-color: #fff;
@badge-bg: @gray-light;
//** Badge text color in active nav link
@badge-active-color: @link-color;
//** Badge background color in active nav link
@badge-active-bg: #fff;
@badge-font-weight: bold;
@badge-line-height: 1;
@badge-border-radius: 10px;
//== Breadcrumbs
//
//##
@breadcrumb-padding-vertical: 8px;
@breadcrumb-padding-horizontal: 15px;
//** Breadcrumb background color
@breadcrumb-bg: #f5f5f5;
//** Breadcrumb text color
@breadcrumb-color: #ccc;
//** Text color of current page in the breadcrumb
@breadcrumb-active-color: @gray-light;
//** Textual separator for between breadcrumb elements
@breadcrumb-separator: "/";
//== Carousel
//
//##
@carousel-text-shadow: 0 1px 2px rgba(0,0,0,.6);
@carousel-control-color: #fff;
@carousel-control-width: 15%;
@carousel-control-opacity: .5;
@carousel-control-font-size: 20px;
@carousel-indicator-active-bg: #fff;
@carousel-indicator-border-color: #fff;
@carousel-caption-color: #fff;
//== Close
//
//##
@close-font-weight: bold;
@close-color: #000;
@close-text-shadow: 0 1px 0 #fff;
//== Code
//
//##
@code-color: #c7254e;
@code-bg: #f9f2f4;
@kbd-color: #fff;
@kbd-bg: #333;
@pre-bg: #f5f5f5;
@pre-color: @gray-dark;
@pre-border-color: #ccc;
@pre-scrollable-max-height: 340px;
//== Type
//
//##
//** Text muted color
@text-muted: @gray-light;
//** Abbreviations and acronyms border color
@abbr-border-color: @gray-light;
//** Headings small color
@headings-small-color: @gray-light;
//** Blockquote small color
@blockquote-small-color: @gray-light;
//** Blockquote font size
@blockquote-font-size: (@font-size-base * 1.25);
//** Blockquote border color
@blockquote-border-color: @gray-lighter;
//** Page header border color
@page-header-border-color: @gray-lighter;
//== Miscellaneous
//
//##
//** Horizontal line color.
@hr-border: @gray-lighter;
//** Horizontal offset for forms and lists.
@component-offset-horizontal: 180px;