first commit

This commit is contained in:
2026-01-16 14:13:44 +08:00
commit 903ff8d495
34603 changed files with 8585054 additions and 0 deletions

16
WebRoot/node_modules/bootstrap-switch/.babelrc generated vendored Normal file
View File

@ -0,0 +1,16 @@
{
"presets": [
["env", {
"modules": "umd",
"targets": {
"browsers": ["last 2 versions"]
}
}],
"stage-2",
],
"env": {
"production": {
"presets": ["babili"]
}
}
}

60
WebRoot/node_modules/bootstrap-switch/.npmignore generated vendored Normal file
View File

@ -0,0 +1,60 @@
# Logs
logs
*.log
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# Typescript v1 declaration files
typings/
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# custom
test/
test.html

80
WebRoot/node_modules/bootstrap-switch/CHANGELOG.md generated vendored Normal file
View File

@ -0,0 +1,80 @@
# Changelog
## 3.3.4
- Fix Object.assign not working for IE <= 11 [#616](https://github.com/Bttstrp/bootstrap-switch/issues/616)
## 3.3.3
- Deprecate CoffeeScript in favour of ES6+ with Babel
- Updated and restored documentation
## 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

1
WebRoot/node_modules/bootstrap-switch/CNAME generated vendored Normal file
View File

@ -0,0 +1 @@
bootstrapswitch.com

14
WebRoot/node_modules/bootstrap-switch/CONTRIBUTING.md generated vendored Normal file
View File

@ -0,0 +1,14 @@
Prerequisites:
- Node and NPM
Flow:
- Fork the repository and checkout `master` branch
- Run `npm install` to get or update the dependencies
- Run `npm start` to build `dist/` and `docs/` directories
- Change JavaScript or LESS files in `src/` directories
- Do not commit changes to dist/ or docs/. These will only be built on merge.
- Once finished, submit a [Pull Request](https://github.com/nostalgiaz/bootstrap-switch/compare/master...master). Remember to target `master` as destination branch
Thank you.

21
WebRoot/node_modules/bootstrap-switch/LICENSE generated vendored Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2013-2015 The authors of Bootstrap Switch
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

76
WebRoot/node_modules/bootstrap-switch/README.md generated vendored Normal file
View File

@ -0,0 +1,76 @@
# Bootstrap Switch
[![Dependency Status](https://david-dm.org/Bttstrp/bootstrap-switch.svg?style=flat)](https://david-dm.org/Bttstrp/bootstrap-switch)
[![devDependency Status](https://david-dm.org/Bttstrp/bootstrap-switch/dev-status.svg?style=flat)](https://david-dm.org/Bttstrp/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 into toggle switches. Created by [Mattia Larentis](http://github.com/nostalgiaz), maintained by [Emanuele Marchi](http://github.com/lostcrew) and [Peter Stein](http://www.bdmdesign.org) with the help of the community.
To get started, check out [https://bttstrp.github.io/bootstrap-switch](https://bttstrp.github.io/bootstrap-switch)!
## Quick start
Several quick start options are available:
- Download the [latest release](https://github.com/Bttstrp/bootstrap-switch/releases/latest)
- Clone the repo: `git clone https://github.com/Bttstrp/bootstrap-switch.git`
- Install with npm: `npm install bootstrap-switch`
- Install with yarn: `yarn add bootstrap-switch`
- Install with Composer: `composer require components/bootstrap-switch`
- Install with Bower: `bower install bootstrap-switch`
- Install with NuGet: `PM> Install-Package Bootstrap.Switch` ([NuGet package](https://github.com/blachniet/bootstrap-switch-nuget))
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.
## Supported browsers
IE9+ and all the other modern browsers.
## LESS
- For Bootstrap 2 (no longer officially supported), import `src/less/bootstrap2/bootstrap-switch.less`
- For Bootstrap 3, import `src/less/bootstrap3/bootstrap-switch.less`
## Bugs and feature requests
Have a bug or a feature request? Please first search for existing and closed issues. If your problem or idea is not addressed yet, [please open a new issue](https://github.com/Bttstrp/bootstrap-switch/issues/new).
The new issue should contain both a summary of the issue and the browser/OS environment in which it occurs and a link to the playground you prefer with the reduced test case.
If suitable, include the steps required to reproduce the bug.
Please do not use the issue tracker for personal support requests: [Stack Overflow](https://stackoverflow.com/questions/tagged/bootstrap-switch) is a better place to get help.
### Known issues
- Make sure `.form-control` is not applied to the input. Bootstrap does not support that, refer to [Checkboxes and radios](https://getbootstrap.com/css/#checkboxes-and-radios)
## Integrations
- Angular: [angular-bootstrap-switch](https://github.com/frapontillo/angular-bootstrap-switch)
- Angular: [angular-toggle-switch](https://github.com/JumpLink/angular-toggle-switch)
- Knockout: [knockout-bootstrap-switch](https://github.com/pauloortins/knockout-bootstrap-switch)
## License
Licensed under the [MIT License](https://github.com/Bttstrp/bootstrap-switch/blob/master/LICENSE).

22
WebRoot/node_modules/bootstrap-switch/bower.json generated vendored Normal file
View File

@ -0,0 +1,22 @@
{
"name": "bootstrap-switch",
"description": "Turn checkboxes and radio buttons into toggle switches.",
"license": "Apache-2.0",
"main": [
"./dist/js/bootstrap-switch.js",
"./dist/css/bootstrap3/bootstrap-switch.css"
],
"ignore": [
"docs",
"test",
"CNAME",
"composer.json",
"CONTRIBUTING.md",
"index.html",
"package.json"
],
"dependencies": {
"bootstrap": ">=2.3.2",
"jquery": "~1.9.0"
}
}

37
WebRoot/node_modules/bootstrap-switch/composer.json generated vendored Normal file
View File

@ -0,0 +1,37 @@
{
"name": "components/bootstrap-switch",
"description": "Turn checkboxes and radio buttons into toggle switches.",
"version": "3.3.4",
"type": "component",
"keywords": [
"bootstrap",
"switch",
"javascript",
"js"
],
"homepage": "https://bttstrp.github.io/bootstrap-switch",
"license": "Apache License Version 2.0",
"authors": [
{
"name": "Mattia Larentis",
"homepage": "http://www.larentis.eu"
}
],
"ignore": [
"docs"
],
"extra": {
"component": {
"name": "bootstrap-switch",
"files": [
"dist/**"
],
"scripts": [
"dist/js/bootstrap-switch.js"
],
"shim": {
"exports": "BootstrapSwitch"
}
}
}
}

View File

@ -0,0 +1,510 @@
/**
* bootstrap-switch - Turn checkboxes and radio buttons into toggle switches.
*
* @version v3.3.4
* @homepage https://bttstrp.github.io/bootstrap-switch
* @author Mattia Larentis <mattia@larentis.eu> (http://larentis.eu)
* @license Apache-2.0
*/
.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;
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: #fff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #005fcc;
background-image: -moz-linear-gradient(top, #0044cc, #08c);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0044cc), to(#08c));
background-image: -webkit-linear-gradient(top, #0044cc, #08c);
background-image: -o-linear-gradient(top, #0044cc, #08c);
background-image: linear-gradient(to bottom, #0044cc, #08c);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0044cc', endColorstr='#ff0088cc', GradientType=0);
border-color: #08c #08c #005580;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #08c;
/* 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: #fff;
background-color: #08c;
*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: #fff;
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: #fff;
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: #fff;
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: #fff;
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: #fff;
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: #fff;
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: #fff;
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: #fff;
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: #333;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
background-color: #f0f0f0;
background-image: -moz-linear-gradient(top, #e6e6e6, #fff);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#fff));
background-image: -webkit-linear-gradient(top, #e6e6e6, #fff);
background-image: -o-linear-gradient(top, #e6e6e6, #fff);
background-image: linear-gradient(to bottom, #e6e6e6, #fff);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0);
border-color: #fff #fff #d9d9d9;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #fff;
/* 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: #333;
background-color: #fff;
*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 #ccc;
border-right: 1px solid #ccc;
color: #333;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #fff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#fff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #fff, #e6e6e6);
background-image: -o-linear-gradient(top, #fff, #e6e6e6);
background-image: linear-gradient(to bottom, #fff, #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: #333;
background-color: #e6e6e6;
*background-color: #d9d9d9;
}
.bootstrap-switch .bootstrap-switch-label:active,
.bootstrap-switch .bootstrap-switch-label.active {
background-color: #cccccc \9;
}
.bootstrap-switch span::before {
content: "\200b";
}
.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;
visibility: hidden;
}
.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,187 @@
/**
* bootstrap-switch - Turn checkboxes and radio buttons into toggle switches.
*
* @version v3.3.4
* @homepage https://bttstrp.github.io/bootstrap-switch
* @author Mattia Larentis <mattia@larentis.eu> (http://larentis.eu)
* @license Apache-2.0
*/
.bootstrap-switch {
display: inline-block;
direction: ltr;
cursor: pointer;
border-radius: 4px;
border: 1px solid;
border-color: #ccc;
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;
-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;
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: table-cell;
vertical-align: middle;
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: #337ab7;
}
.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: #333;
background: #fff;
}
.bootstrap-switch span::before {
content: "\200b";
}
.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;
margin: 0;
z-index: -1;
opacity: 0;
filter: alpha(opacity=0);
visibility: hidden;
}
.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.3333333;
}
.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;
-o-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,784 @@
/**
* bootstrap-switch - Turn checkboxes and radio buttons into toggle switches.
*
* @version v3.3.4
* @homepage https://bttstrp.github.io/bootstrap-switch
* @author Mattia Larentis <mattia@larentis.eu> (http://larentis.eu)
* @license Apache-2.0
*/
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(['jquery'], factory);
} else if (typeof exports !== "undefined") {
factory(require('jquery'));
} else {
var mod = {
exports: {}
};
factory(global.jquery);
global.bootstrapSwitch = mod.exports;
}
})(this, function (_jquery) {
'use strict';
var _jquery2 = _interopRequireDefault(_jquery);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var _createClass = function () {
function defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function (Constructor, protoProps, staticProps) {
if (protoProps) defineProperties(Constructor.prototype, protoProps);
if (staticProps) defineProperties(Constructor, staticProps);
return Constructor;
};
}();
var $ = _jquery2.default || window.jQuery || window.$;
var BootstrapSwitch = function () {
function BootstrapSwitch(element) {
var _this = this;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
_classCallCheck(this, BootstrapSwitch);
this.$element = $(element);
this.options = $.extend({}, $.fn.bootstrapSwitch.defaults, this._getElementOptions(), options);
this.prevOptions = {};
this.$wrapper = $('<div>', {
class: function _class() {
var classes = [];
classes.push(_this.options.state ? 'on' : 'off');
if (_this.options.size) {
classes.push(_this.options.size);
}
if (_this.options.disabled) {
classes.push('disabled');
}
if (_this.options.readonly) {
classes.push('readonly');
}
if (_this.options.indeterminate) {
classes.push('indeterminate');
}
if (_this.options.inverse) {
classes.push('inverse');
}
if (_this.$element.attr('id')) {
classes.push('id-' + _this.$element.attr('id'));
}
return classes.map(_this._getClass.bind(_this)).concat([_this.options.baseClass], _this._getClasses(_this.options.wrapperClass)).join(' ');
}
});
this.$container = $('<div>', { class: this._getClass('container') });
this.$on = $('<span>', {
html: this.options.onText,
class: this._getClass('handle-on') + ' ' + this._getClass(this.options.onColor)
});
this.$off = $('<span>', {
html: this.options.offText,
class: this._getClass('handle-off') + ' ' + this._getClass(this.options.offColor)
});
this.$label = $('<span>', {
html: this.options.labelText,
class: this._getClass('label')
});
this.$element.on('init.bootstrapSwitch', this.options.onInit.bind(this, element));
this.$element.on('switchChange.bootstrapSwitch', function () {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
if (_this.options.onSwitchChange.apply(element, args) === false) {
if (_this.$element.is(':radio')) {
$('[name="' + _this.$element.attr('name') + '"]').trigger('previousState.bootstrapSwitch', true);
} else {
_this.$element.trigger('previousState.bootstrapSwitch', true);
}
}
});
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', this.options.state);
}
_createClass(BootstrapSwitch, [{
key: 'setPrevOptions',
value: function setPrevOptions() {
this.prevOptions = _extends({}, this.options);
}
}, {
key: 'state',
value: function state(value, skip) {
if (typeof value === 'undefined') {
return this.options.state;
}
if (this.options.disabled || this.options.readonly || this.options.state && !this.options.radioAllOff && this.$element.is(':radio')) {
return this.$element;
}
if (this.$element.is(':radio')) {
$('[name="' + this.$element.attr('name') + '"]').trigger('setPreviousOptions.bootstrapSwitch');
} else {
this.$element.trigger('setPreviousOptions.bootstrapSwitch');
}
if (this.options.indeterminate) {
this.indeterminate(false);
}
this.$element.prop('checked', Boolean(value)).trigger('change.bootstrapSwitch', skip);
return this.$element;
}
}, {
key: 'toggleState',
value: function toggleState(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);
}
}
}, {
key: 'size',
value: function size(value) {
if (typeof value === 'undefined') {
return this.options.size;
}
if (this.options.size != null) {
this.$wrapper.removeClass(this._getClass(this.options.size));
}
if (value) {
this.$wrapper.addClass(this._getClass(value));
}
this._width();
this._containerPosition();
this.options.size = value;
return this.$element;
}
}, {
key: 'animate',
value: function animate(value) {
if (typeof value === 'undefined') {
return this.options.animate;
}
if (this.options.animate === Boolean(value)) {
return this.$element;
}
return this.toggleAnimate();
}
}, {
key: 'toggleAnimate',
value: function toggleAnimate() {
this.options.animate = !this.options.animate;
this.$wrapper.toggleClass(this._getClass('animate'));
return this.$element;
}
}, {
key: 'disabled',
value: function disabled(value) {
if (typeof value === 'undefined') {
return this.options.disabled;
}
if (this.options.disabled === Boolean(value)) {
return this.$element;
}
return this.toggleDisabled();
}
}, {
key: 'toggleDisabled',
value: function toggleDisabled() {
this.options.disabled = !this.options.disabled;
this.$element.prop('disabled', this.options.disabled);
this.$wrapper.toggleClass(this._getClass('disabled'));
return this.$element;
}
}, {
key: 'readonly',
value: function readonly(value) {
if (typeof value === 'undefined') {
return this.options.readonly;
}
if (this.options.readonly === Boolean(value)) {
return this.$element;
}
return this.toggleReadonly();
}
}, {
key: 'toggleReadonly',
value: function toggleReadonly() {
this.options.readonly = !this.options.readonly;
this.$element.prop('readonly', this.options.readonly);
this.$wrapper.toggleClass(this._getClass('readonly'));
return this.$element;
}
}, {
key: 'indeterminate',
value: function indeterminate(value) {
if (typeof value === 'undefined') {
return this.options.indeterminate;
}
if (this.options.indeterminate === Boolean(value)) {
return this.$element;
}
return this.toggleIndeterminate();
}
}, {
key: 'toggleIndeterminate',
value: function toggleIndeterminate() {
this.options.indeterminate = !this.options.indeterminate;
this.$element.prop('indeterminate', this.options.indeterminate);
this.$wrapper.toggleClass(this._getClass('indeterminate'));
this._containerPosition();
return this.$element;
}
}, {
key: 'inverse',
value: function inverse(value) {
if (typeof value === 'undefined') {
return this.options.inverse;
}
if (this.options.inverse === Boolean(value)) {
return this.$element;
}
return this.toggleInverse();
}
}, {
key: 'toggleInverse',
value: function toggleInverse() {
this.$wrapper.toggleClass(this._getClass('inverse'));
var $on = this.$on.clone(true);
var $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;
}
}, {
key: 'onColor',
value: function onColor(value) {
if (typeof value === 'undefined') {
return this.options.onColor;
}
if (this.options.onColor) {
this.$on.removeClass(this._getClass(this.options.onColor));
}
this.$on.addClass(this._getClass(value));
this.options.onColor = value;
return this.$element;
}
}, {
key: 'offColor',
value: function offColor(value) {
if (typeof value === 'undefined') {
return this.options.offColor;
}
if (this.options.offColor) {
this.$off.removeClass(this._getClass(this.options.offColor));
}
this.$off.addClass(this._getClass(value));
this.options.offColor = value;
return this.$element;
}
}, {
key: 'onText',
value: function onText(value) {
if (typeof value === 'undefined') {
return this.options.onText;
}
this.$on.html(value);
this._width();
this._containerPosition();
this.options.onText = value;
return this.$element;
}
}, {
key: 'offText',
value: function offText(value) {
if (typeof value === 'undefined') {
return this.options.offText;
}
this.$off.html(value);
this._width();
this._containerPosition();
this.options.offText = value;
return this.$element;
}
}, {
key: 'labelText',
value: function labelText(value) {
if (typeof value === 'undefined') {
return this.options.labelText;
}
this.$label.html(value);
this._width();
this.options.labelText = value;
return this.$element;
}
}, {
key: 'handleWidth',
value: function handleWidth(value) {
if (typeof value === 'undefined') {
return this.options.handleWidth;
}
this.options.handleWidth = value;
this._width();
this._containerPosition();
return this.$element;
}
}, {
key: 'labelWidth',
value: function labelWidth(value) {
if (typeof value === 'undefined') {
return this.options.labelWidth;
}
this.options.labelWidth = value;
this._width();
this._containerPosition();
return this.$element;
}
}, {
key: 'baseClass',
value: function baseClass(value) {
return this.options.baseClass;
}
}, {
key: 'wrapperClass',
value: function wrapperClass(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;
}
}, {
key: 'radioAllOff',
value: function radioAllOff(value) {
if (typeof value === 'undefined') {
return this.options.radioAllOff;
}
var val = Boolean(value);
if (this.options.radioAllOff === val) {
return this.$element;
}
this.options.radioAllOff = val;
return this.$element;
}
}, {
key: 'onInit',
value: function onInit(value) {
if (typeof value === 'undefined') {
return this.options.onInit;
}
if (!value) {
value = $.fn.bootstrapSwitch.defaults.onInit;
}
this.options.onInit = value;
return this.$element;
}
}, {
key: 'onSwitchChange',
value: function onSwitchChange(value) {
if (typeof value === 'undefined') {
return this.options.onSwitchChange;
}
if (!value) {
value = $.fn.bootstrapSwitch.defaults.onSwitchChange;
}
this.options.onSwitchChange = value;
return this.$element;
}
}, {
key: 'destroy',
value: function destroy() {
var $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;
}
}, {
key: '_getElementOptions',
value: function _getElementOptions() {
return {
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')
};
}
}, {
key: '_width',
value: function _width() {
var _this2 = this;
var $handles = this.$on.add(this.$off).add(this.$label).css('width', '');
var handleWidth = this.options.handleWidth === 'auto' ? Math.round(Math.max(this.$on.width(), this.$off.width())) : this.options.handleWidth;
$handles.width(handleWidth);
this.$label.width(function (index, width) {
if (_this2.options.labelWidth !== 'auto') {
return _this2.options.labelWidth;
}
if (width < handleWidth) {
return handleWidth;
}
return width;
});
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);
}
}, {
key: '_containerPosition',
value: function _containerPosition() {
var _this3 = this;
var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.options.state;
var callback = arguments[1];
this.$container.css('margin-left', function () {
var values = [0, '-' + _this3._handleWidth + 'px'];
if (_this3.options.indeterminate) {
return '-' + _this3._handleWidth / 2 + 'px';
}
if (state) {
if (_this3.options.inverse) {
return values[1];
} else {
return values[0];
}
} else {
if (_this3.options.inverse) {
return values[0];
} else {
return values[1];
}
}
});
}
}, {
key: '_init',
value: function _init() {
var _this4 = this;
var init = function init() {
_this4.setPrevOptions();
_this4._width();
_this4._containerPosition();
setTimeout(function () {
if (_this4.options.animate) {
return _this4.$wrapper.addClass(_this4._getClass('animate'));
}
}, 50);
};
if (this.$wrapper.is(':visible')) {
init();
return;
}
var initInterval = window.setInterval(function () {
if (_this4.$wrapper.is(':visible')) {
init();
return window.clearInterval(initInterval);
}
}, 50);
}
}, {
key: '_elementHandlers',
value: function _elementHandlers() {
var _this5 = this;
return this.$element.on({
'setPreviousOptions.bootstrapSwitch': this.setPrevOptions.bind(this),
'previousState.bootstrapSwitch': function previousStateBootstrapSwitch() {
_this5.options = _this5.prevOptions;
if (_this5.options.indeterminate) {
_this5.$wrapper.addClass(_this5._getClass('indeterminate'));
}
_this5.$element.prop('checked', _this5.options.state).trigger('change.bootstrapSwitch', true);
},
'change.bootstrapSwitch': function changeBootstrapSwitch(event, skip) {
event.preventDefault();
event.stopImmediatePropagation();
var state = _this5.$element.is(':checked');
_this5._containerPosition(state);
if (state === _this5.options.state) {
return;
}
_this5.options.state = state;
_this5.$wrapper.toggleClass(_this5._getClass('off')).toggleClass(_this5._getClass('on'));
if (!skip) {
if (_this5.$element.is(':radio')) {
$('[name="' + _this5.$element.attr('name') + '"]').not(_this5.$element).prop('checked', false).trigger('change.bootstrapSwitch', true);
}
_this5.$element.trigger('switchChange.bootstrapSwitch', [state]);
}
},
'focus.bootstrapSwitch': function focusBootstrapSwitch(event) {
event.preventDefault();
_this5.$wrapper.addClass(_this5._getClass('focused'));
},
'blur.bootstrapSwitch': function blurBootstrapSwitch(event) {
event.preventDefault();
_this5.$wrapper.removeClass(_this5._getClass('focused'));
},
'keydown.bootstrapSwitch': function keydownBootstrapSwitch(event) {
if (!event.which || _this5.options.disabled || _this5.options.readonly) {
return;
}
if (event.which === 37 || event.which === 39) {
event.preventDefault();
event.stopImmediatePropagation();
_this5.state(event.which === 39);
}
}
});
}
}, {
key: '_handleHandlers',
value: function _handleHandlers() {
var _this6 = this;
this.$on.on('click.bootstrapSwitch', function (event) {
event.preventDefault();
event.stopPropagation();
_this6.state(false);
return _this6.$element.trigger('focus.bootstrapSwitch');
});
return this.$off.on('click.bootstrapSwitch', function (event) {
event.preventDefault();
event.stopPropagation();
_this6.state(true);
return _this6.$element.trigger('focus.bootstrapSwitch');
});
}
}, {
key: '_labelHandlers',
value: function _labelHandlers() {
var _this7 = this;
var handlers = {
click: function click(event) {
event.stopPropagation();
},
'mousedown.bootstrapSwitch touchstart.bootstrapSwitch': function mousedownBootstrapSwitchTouchstartBootstrapSwitch(event) {
if (_this7._dragStart || _this7.options.disabled || _this7.options.readonly) {
return;
}
event.preventDefault();
event.stopPropagation();
_this7._dragStart = (event.pageX || event.originalEvent.touches[0].pageX) - parseInt(_this7.$container.css('margin-left'), 10);
if (_this7.options.animate) {
_this7.$wrapper.removeClass(_this7._getClass('animate'));
}
_this7.$element.trigger('focus.bootstrapSwitch');
},
'mousemove.bootstrapSwitch touchmove.bootstrapSwitch': function mousemoveBootstrapSwitchTouchmoveBootstrapSwitch(event) {
if (_this7._dragStart == null) {
return;
}
var difference = (event.pageX || event.originalEvent.touches[0].pageX) - _this7._dragStart;
event.preventDefault();
if (difference < -_this7._handleWidth || difference > 0) {
return;
}
_this7._dragEnd = difference;
_this7.$container.css('margin-left', _this7._dragEnd + 'px');
},
'mouseup.bootstrapSwitch touchend.bootstrapSwitch': function mouseupBootstrapSwitchTouchendBootstrapSwitch(event) {
if (!_this7._dragStart) {
return;
}
event.preventDefault();
if (_this7.options.animate) {
_this7.$wrapper.addClass(_this7._getClass('animate'));
}
if (_this7._dragEnd) {
var state = _this7._dragEnd > -(_this7._handleWidth / 2);
_this7._dragEnd = false;
_this7.state(_this7.options.inverse ? !state : state);
} else {
_this7.state(!_this7.options.state);
}
_this7._dragStart = false;
},
'mouseleave.bootstrapSwitch': function mouseleaveBootstrapSwitch() {
_this7.$label.trigger('mouseup.bootstrapSwitch');
}
};
this.$label.on(handlers);
}
}, {
key: '_externalLabelHandler',
value: function _externalLabelHandler() {
var _this8 = this;
var $externalLabel = this.$element.closest('label');
$externalLabel.on('click', function (event) {
event.preventDefault();
event.stopImmediatePropagation();
if (event.target === $externalLabel[0]) {
_this8.toggleState();
}
});
}
}, {
key: '_formHandler',
value: function _formHandler() {
var $form = this.$element.closest('form');
if ($form.data('bootstrap-switch')) {
return;
}
$form.on('reset.bootstrapSwitch', function () {
window.setTimeout(function () {
$form.find('input').filter(function () {
return $(this).data('bootstrap-switch');
}).each(function () {
return $(this).bootstrapSwitch('state', this.checked);
});
}, 1);
}).data('bootstrap-switch', true);
}
}, {
key: '_getClass',
value: function _getClass(name) {
return this.options.baseClass + '-' + name;
}
}, {
key: '_getClasses',
value: function _getClasses(classes) {
if (!$.isArray(classes)) {
return [this._getClass(classes)];
}
return classes.map(this._getClass.bind(this));
}
}]);
return BootstrapSwitch;
}();
$.fn.bootstrapSwitch = function (option) {
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = arguments[_key2];
}
function reducer(ret, next) {
var $this = $(next);
var existingData = $this.data('bootstrap-switch');
var data = existingData || new BootstrapSwitch(next, option);
if (!existingData) {
$this.data('bootstrap-switch', data);
}
if (typeof option === 'string') {
return data[option].apply(data, args);
}
return ret;
}
return Array.prototype.reduce.call(this, reducer, this);
};
$.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: function onInit() {},
onSwitchChange: function onSwitchChange() {}
};
});

File diff suppressed because one or more lines are too long

1
WebRoot/node_modules/bootstrap-switch/docs/404.html generated vendored Normal file
View File

@ -0,0 +1 @@
<!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 into toggle switches"><meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein"><title>Bootstrap Switch · Turn checkboxes and radio buttons into toggle switches</title><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"><link href="css/highlight.css" rel="stylesheet"><link href="https://unpkg.com/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet"><link href="https://getbootstrap.com/assets/css/docs.min.css" rel="stylesheet"><link href="css/main.css" rel="stylesheet"></head><body><a href="https://github.com/Bttstrp/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/Bttstrp/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/Bttstrp/bootstrap-switch/issues">Bug reports</a></li></ul></nav></div></header><main id="content" role="main"><h1>404</h1><h3>Whoops. Looks like what you're looking for can't be found.</h3></main><footer class="bs-docs-footer"><div class="container"><p>Code licensed under <a href="https://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="https://code.jquery.com/jquery-3.1.1.min.js"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script><script src="js/highlight.js"></script><script src="https://unpkg.com/bootstrap-switch"></script><script src="js/main.js"></script></body></html>

1
WebRoot/node_modules/bootstrap-switch/docs/CNAME generated vendored Normal file
View File

@ -0,0 +1 @@
bootstrapswitch.com

View File

@ -0,0 +1,153 @@
/*
Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org>
*/
.hljs {
display: block; padding: 0.5em;
background: #F0F0F0;
}
.hljs,
.hljs-subst,
.hljs-tag .hljs-title,
.lisp .hljs-title,
.clojure .hljs-built_in,
.nginx .hljs-title {
color: black;
}
.hljs-string,
.hljs-title,
.hljs-constant,
.hljs-parent,
.hljs-tag .hljs-value,
.hljs-rules .hljs-value,
.hljs-rules .hljs-value .hljs-number,
.hljs-preprocessor,
.hljs-pragma,
.haml .hljs-symbol,
.ruby .hljs-symbol,
.ruby .hljs-symbol .hljs-string,
.hljs-aggregate,
.hljs-template_tag,
.django .hljs-variable,
.smalltalk .hljs-class,
.hljs-addition,
.hljs-flow,
.hljs-stream,
.bash .hljs-variable,
.apache .hljs-tag,
.apache .hljs-cbracket,
.tex .hljs-command,
.tex .hljs-special,
.erlang_repl .hljs-function_or_atom,
.asciidoc .hljs-header,
.markdown .hljs-header,
.coffeescript .hljs-attribute {
color: #800;
}
.smartquote,
.hljs-comment,
.hljs-annotation,
.hljs-template_comment,
.diff .hljs-header,
.hljs-chunk,
.asciidoc .hljs-blockquote,
.markdown .hljs-blockquote {
color: #888;
}
.hljs-number,
.hljs-date,
.hljs-regexp,
.hljs-literal,
.hljs-hexcolor,
.smalltalk .hljs-symbol,
.smalltalk .hljs-char,
.go .hljs-constant,
.hljs-change,
.lasso .hljs-variable,
.makefile .hljs-variable,
.asciidoc .hljs-bullet,
.markdown .hljs-bullet,
.asciidoc .hljs-link_url,
.markdown .hljs-link_url {
color: #080;
}
.hljs-label,
.hljs-javadoc,
.ruby .hljs-string,
.hljs-decorator,
.hljs-filter .hljs-argument,
.hljs-localvars,
.hljs-array,
.hljs-attr_selector,
.hljs-important,
.hljs-pseudo,
.hljs-pi,
.haml .hljs-bullet,
.hljs-doctype,
.hljs-deletion,
.hljs-envvar,
.hljs-shebang,
.apache .hljs-sqbracket,
.nginx .hljs-built_in,
.tex .hljs-formula,
.erlang_repl .hljs-reserved,
.hljs-prompt,
.asciidoc .hljs-link_label,
.markdown .hljs-link_label,
.vhdl .hljs-attribute,
.clojure .hljs-attribute,
.asciidoc .hljs-attribute,
.lasso .hljs-attribute,
.coffeescript .hljs-property,
.hljs-phony {
color: #88F
}
.hljs-keyword,
.hljs-id,
.hljs-title,
.hljs-built_in,
.hljs-aggregate,
.css .hljs-tag,
.hljs-javadoctag,
.hljs-phpdoc,
.hljs-yardoctag,
.smalltalk .hljs-class,
.hljs-winutils,
.bash .hljs-variable,
.apache .hljs-tag,
.go .hljs-typename,
.tex .hljs-command,
.asciidoc .hljs-strong,
.markdown .hljs-strong,
.hljs-request,
.hljs-status {
font-weight: bold;
}
.asciidoc .hljs-emphasis,
.markdown .hljs-emphasis {
font-style: italic;
}
.nginx .hljs-built_in {
font-weight: normal;
}
.coffeescript .javascript,
.javascript .xml,
.lasso .markup,
.tex .hljs-formula,
.xml .javascript,
.xml .vbscript,
.xml .css,
.xml .hljs-cdata {
opacity: 0.5;
}

View File

@ -0,0 +1 @@
body{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding-bottom:50px}.bs-docs-masthead,.bs-docs-header{color:#cdbfe3;text-shadow:0 1px 0 rgba(0,0,0,0.1);background-color:#6f5499;background-image:-webkit-gradient(linear,left top,left bottom,from(#563d7c),to(#6f5499));background-image:-webkit-linear-gradient(top,#563d7c 0,#6f5499 100%);background-image:linear-gradient(to bottom,#563d7c 0,#6f5499 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#563d7c',endColorstr='#6F5499',GradientType=0);background-repeat:repeat-x}.bs-docs-masthead h1{font-weight:500}.page-header{text-align:left}#github{display:none;position:fixed;width:150px;height:150px;top:0;right:0;z-index:2000}.bottom{border-top:1px solid #eee;margin-top:40px;padding-top:20px;padding-bottom:20px;text-align:center}.hljs{background-color:transparent}@media (min-width:768px){#github{display:block}}

View File

@ -0,0 +1,7 @@
<!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 into toggle switches"><meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein"><title>Bootstrap Switch · Turn checkboxes and radio buttons into toggle switches</title><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"><link href="css/highlight.css" rel="stylesheet"><link href="https://unpkg.com/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet"><link href="https://getbootstrap.com/assets/css/docs.min.css" rel="stylesheet"><link href="css/main.css" rel="stylesheet"></head><body><a href="https://github.com/Bttstrp/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/Bttstrp/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/Bttstrp/bootstrap-switch/issues">Bug reports</a></li></ul></nav></div></header><main id="content" role="main"><div 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 exceptions 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>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>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 is <code>switch-change</code>. It returns two parameters: <code>event</code> and
<code>data</code>.<br>
The latter is an object that includes <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="https://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="https://code.jquery.com/jquery-3.1.1.min.js"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script><script src="js/highlight.js"></script><script src="https://unpkg.com/bootstrap-switch"></script><script src="js/main.js"></script></body></html>

View File

@ -0,0 +1,9 @@
<!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 into toggle switches"><meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein"><title>Bootstrap Switch · Turn checkboxes and radio buttons into toggle switches</title><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"><link href="css/highlight.css" rel="stylesheet"><link href="https://unpkg.com/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet"><link href="https://getbootstrap.com/assets/css/docs.min.css" rel="stylesheet"><link href="css/main.css" rel="stylesheet"></head><body><a href="https://github.com/Bttstrp/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/Bttstrp/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/Bttstrp/bootstrap-switch/issues">Bug reports</a></li></ul></nav></div></header><main id="content" role="main"><div 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 follows:</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>)
state (true | false)</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="https://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="https://code.jquery.com/jquery-3.1.1.min.js"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script><script src="js/highlight.js"></script><script src="https://unpkg.com/bootstrap-switch"></script><script src="js/main.js"></script></body></html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,6 @@
<!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 into toggle switches"><meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein"><title>Bootstrap Switch · Turn checkboxes and radio buttons into toggle switches</title><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"><link href="css/highlight.css" rel="stylesheet"><link href="https://unpkg.com/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet"><link href="https://getbootstrap.com/assets/css/docs.min.css" rel="stylesheet"><link href="css/main.css" rel="stylesheet"></head><body><a href="https://github.com/Bttstrp/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/Bttstrp/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/Bttstrp/bootstrap-switch/issues">Bug reports</a></li></ul></nav></div></header><main id="content" role="main"><div class="bs-docs-masthead"><div class="container"><h1 class="title">Bootstrap Switch</h1><p class="lead">Turn checkboxes &nbsp;<input type="checkbox" checked="checked" data-switch-no-init="data-switch-no-init">&nbsp; and radio buttons &nbsp;<input type="radio" checked="checked" data-switch-no-init="data-switch-no-init">&nbsp; into toggle switches &nbsp;<input type="checkbox" checked="checked"></p><p class="lead"><a href="https://github.com/Bttstrp/bootstrap-switch/archive/master.zip" class="btn btn-outline-inverse btn-lg">Download Bootstrap Switch</a></p><p class="bs-docs-social"><iframe src="https://ghbtns.com/github-btn.html?user=Bttstrp&amp;repo=bootstrap-switch&amp;type=watch&amp;count=true&amp;size=large" allowtransparency="true" frameborder="0" scrolling="0" width="184" height="30"></iframe><iframe src="https://ghbtns.com/github-btn.html?user=Bttstrp&amp;repo=bootstrap-switch&amp;type=fork&amp;count=true&amp;size=large" allowtransparency="true" frameborder="0" scrolling="0" width="144" height="30"></iframe></p><br><p class="version">Currently v3.3.4 · Compatible with Bootstrap 2 and 3</p></div></div><div class="container"><h2 class="page-header">Getting Started</h2><p>Include the dependencies: jQuery, Bootstrap and Bootstrap Switch CSS + Javascript.</p><pre><code>[...]
&lt;link href="bootstrap.css" rel="stylesheet"&gt;
&lt;link href="bootstrap-switch.css" rel="stylesheet"&gt;
&lt;script src="jquery.js"&gt;&lt;/script&gt;
&lt;script src="bootstrap-switch.js"&gt;&lt;/script&gt;
[...]</code></pre><p>Add your checkbox.</p><pre><code>&lt;input type="checkbox" name="my-checkbox" checked&gt;</code></pre><p>Initialize Bootstrap Switch.</p><pre><code>$("[name='my-checkbox']").bootstrapSwitch();</code></pre><p>Enjoy.</p><div class="text-center"><a href="examples.html" class="btn btn-lg btn-primary">See Examples</a>&nbsp;<a href="options.html" class="btn btn-lg btn-outline">Browse Documentation</a></div></div></main><footer class="bs-docs-footer"><div class="container"><p>Code licensed under <a href="https://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="https://code.jquery.com/jquery-3.1.1.min.js"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script><script src="js/highlight.js"></script><script src="https://unpkg.com/bootstrap-switch"></script><script src="js/main.js"></script></body></html>

File diff suppressed because one or more lines are too long

60
WebRoot/node_modules/bootstrap-switch/docs/js/main.js generated vendored Normal file
View File

@ -0,0 +1,60 @@
var $ = window.jQuery
var $window = $(window)
var sectionTop = $('.top').outerHeight() + 20
var $createDestroy = $('#switch-create-destroy')
function capitalize (string) {
return string.charAt(0).toUpperCase() + string.slice(1)
}
window.hljs.initHighlightingOnLoad()
$(function () {
$('a[href*=\'#\']').on('click', function (event) {
event.preventDefault()
var $target = $($(this).attr('href').slice('#'))
if ($target.length) {
$window.scrollTop($target.offset().top - sectionTop)
}
})
$('input[type="checkbox"], input[type="radio"]')
.not('[data-switch-no-init]')
.bootstrapSwitch()
$('[data-switch-get]').on('click', function () {
var type = $(this).data('switch-get')
window.alert($('#switch-' + type).bootstrapSwitch(type))
})
$('[data-switch-set]').on('click', function () {
var type
type = $(this).data('switch-set')
$('#switch-' + type).bootstrapSwitch(type, $(this).data('switch-value'))
})
$('[data-switch-toggle]').on('click', function () {
var type = $(this).data('switch-toggle')
$('#switch-' + type).bootstrapSwitch('toggle' + capitalize(type))
})
$('[data-switch-set-value]').on('input', function (event) {
var type, value
event.preventDefault()
type = $(this).data('switch-set-value')
value = $.trim($(this).val())
if ($(this).data('value') === value) {
return
}
$('#switch-' + type).bootstrapSwitch(type, value)
})
$('[data-switch-create-destroy]').on('click', function () {
var isSwitch
isSwitch = $createDestroy.data('bootstrap-switch')
$createDestroy.bootstrapSwitch((isSwitch ? 'destroy' : null))
$(this).button((isSwitch ? 'reset' : 'destroy'))
})
$('#confirm').bootstrapSwitch({
size: 'large',
onSwitchChange: function (event, state) {
event.preventDefault()
return console.log(state, event.isDefaultPrevented())
}
})
})

View File

@ -0,0 +1 @@
<!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 into toggle switches"><meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein"><title>Bootstrap Switch · Turn checkboxes and radio buttons into toggle switches</title><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"><link href="css/highlight.css" rel="stylesheet"><link href="https://unpkg.com/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet"><link href="https://getbootstrap.com/assets/css/docs.min.css" rel="stylesheet"><link href="css/main.css" rel="stylesheet"></head><body><a href="https://github.com/Bttstrp/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/Bttstrp/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/Bttstrp/bootstrap-switch/issues">Bug reports</a></li></ul></nav></div></header><main id="content" role="main"><div 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 returns 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 accept 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="https://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="https://code.jquery.com/jquery-3.1.1.min.js"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script><script src="js/highlight.js"></script><script src="https://unpkg.com/bootstrap-switch"></script><script src="js/main.js"></script></body></html>

File diff suppressed because one or more lines are too long

57
WebRoot/node_modules/bootstrap-switch/karma.conf.js generated vendored Normal file
View File

@ -0,0 +1,57 @@
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'node_modules/babel-polyfill/dist/polyfill.js',
'node_modules/jquery/dist/jquery.js',
'node_modules/bootstrap/dist/js/bootstrap.js',
'test/*.js'
],
// list of files to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['PhantomJS', 'Firefox'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: true,
// Concurrency level
// how many browser should be started simultaneous
concurrency: Infinity
})
}

127
WebRoot/node_modules/bootstrap-switch/package.json generated vendored Normal file
View File

@ -0,0 +1,127 @@
{
"_from": "bootstrap-switch",
"_id": "bootstrap-switch@3.3.4",
"_inBundle": false,
"_integrity": "sha1-cOCusqh3wNx2aZHeEI4hcPwpov8=",
"_location": "/bootstrap-switch",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "bootstrap-switch",
"name": "bootstrap-switch",
"escapedName": "bootstrap-switch",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/bootstrap-switch/-/bootstrap-switch-3.3.4.tgz",
"_shasum": "70e0aeb2a877c0dc766991de108e2170fc29a2ff",
"_spec": "bootstrap-switch",
"_where": "D:\\Workspaces\\SSMBootstrap\\WebRoot",
"author": {
"name": "Mattia Larentis",
"email": "mattia@larentis.eu",
"url": "http://larentis.eu"
},
"bugs": {
"url": "https://github.com/Bttstrp/bootstrap-switch/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Emanuele Marchi",
"email": "emanuele@lostcrew.it",
"url": "http://lostcrew.it"
},
{
"name": "Peter Stein",
"url": "http://www.bdmdesign.org"
}
],
"dependencies": {},
"deprecated": false,
"description": "Turn checkboxes and radio buttons into toggle switches.",
"devDependencies": {
"babel-cli": "^6.22.2",
"babel-polyfill": "^6.22.0",
"babel-preset-babili": "^0.0.10",
"babel-preset-env": "^1.1.8",
"babel-preset-stage-2": "^6.22.0",
"bootstrap": "^3.3.7",
"harp": "^0.23.0",
"headr": "0.0.4",
"jasmine": "^2.5.3",
"jasmine-core": "^2.5.2",
"jquery": "^1.12.4",
"karma": "^1.4.1",
"karma-babel-preprocessor": "^6.0.1",
"karma-cli": "^1.0.1",
"karma-firefox-launcher": "^1.0.0",
"karma-jasmine": "^1.1.0",
"karma-phantomjs-launcher": "^1.0.2",
"less": "^2.7.2",
"less-plugin-clean-css": "^1.5.0",
"npm-run-all": "^4.0.1",
"standard": "^8.6.0",
"wintersmith": "^2.3.6"
},
"homepage": "https://bttstrp.github.io/bootstrap-switch",
"keywords": [
"bootstrap",
"switch",
"javascript",
"js"
],
"license": "Apache-2.0",
"main": "dist/js/bootstrap-switch.js",
"name": "bootstrap-switch",
"npmFileMap": [
{
"basePath": "/dist/",
"files": [
"*.js",
"css/bootstrap3/*.css",
"css/bootstrap2/*.css"
]
}
],
"npmName": "bootstrap-switch",
"peerDependencies": {
"bootstrap": "^3.1.1",
"jquery": ">=1.9.0"
},
"repository": {
"type": "git",
"url": "git://github.com/Bttstrp/bootstrap-switch.git"
},
"scripts": {
"build": "run-p *:build",
"clean": "rm -rf dist",
"css": "run-p css:build",
"css:build": "npm-run-all css:build:base css:build:min -p css:build:banner",
"css:build:banner": "headr dist/css/bootstrap2/bootstrap-switch.css -o dist/css/bootstrap2/bootstrap-switch.css --version --homepage --author --license && headr dist/css/bootstrap2/bootstrap-switch.min.css -o dist/css/bootstrap2/bootstrap-switch.min.css --version --homepage --author --license && headr dist/css/bootstrap3/bootstrap-switch.css -o dist/css/bootstrap3/bootstrap-switch.css --version --homepage --author --license && headr dist/css/bootstrap3/bootstrap-switch.min.css -o dist/css/bootstrap3/bootstrap-switch.min.css --version --homepage --author --license",
"css:build:base": "lessc src/less/bootstrap2/build.less dist/css/bootstrap2/bootstrap-switch.css && lessc src/less/bootstrap3/build.less dist/css/bootstrap3/bootstrap-switch.css",
"css:build:min": "lessc --clean-css='--advanced' src/less/bootstrap2/build.less dist/css/bootstrap2/bootstrap-switch.min.css && lessc --clean-css='--advanced' src/less/bootstrap3/build.less dist/css/bootstrap3/bootstrap-switch.min.css",
"docs": "run-p docs:build",
"docs:build": "harp compile src/docs docs",
"js": "run-s js:lint js:test js:build",
"js:build": "npm-run-all js:build:dir -p js:build:base js:build:min -s js:build:banner",
"js:build:banner": "headr dist/js/bootstrap-switch.js -o dist/js/bootstrap-switch.js --version --homepage --author --license && headr dist/js/bootstrap-switch.min.js -o dist/js/bootstrap-switch.min.js --version --homepage --author --license",
"js:build:base": "babel -o dist/js/bootstrap-switch.js src/js/bootstrap-switch.js",
"js:build:dir": "mkdir -p dist/js",
"js:build:min": "NODE_ENV=production babel -o dist/js/bootstrap-switch.min.js src/js/bootstrap-switch.js",
"js:lint": "standard src/js/**/*.js",
"js:test": "mkdir -p test && babel -d test src/js && karma start karma.conf.js",
"lint": "run-p js:lint",
"prepublish": "run-s clean lint test build",
"publish-docs": "git subtree push --prefix docs origin gh-pages",
"start": "run-s prepublish",
"test": "run-p js:test"
},
"version": "3.3.4"
}

View File

@ -0,0 +1,7 @@
{
"globals": {
"title": "Bootstrap Switch",
"description": "Turn checkboxes and radio buttons into toggle switches",
"version": "3.3.4"
}
}

View File

@ -0,0 +1,2 @@
h1 404
h3 Whoops. Looks like what you're looking for can't be found.

View File

@ -0,0 +1 @@
bootstrapswitch.com

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=description)
meta(name='author', content='Mattia Larentis, Emanuele Marchi and Peter Stein')
title #{title} · #{description}
link(href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' rel='stylesheet')
link(href='css/highlight.css' rel='stylesheet')
link(href="https://unpkg.com/bootstrap-switch/dist/css/bootstrap3/bootstrap-switch.css" rel='stylesheet')
link(href='https://getbootstrap.com/assets/css/docs.min.css' rel='stylesheet')
link(href='css/main.css' rel='stylesheet')
body
a(href='https://github.com/Bttstrp/bootstrap-switch', id='github')
img(src='https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png', alt='Fork me on GitHub')
header.navbar.navbar-static-top.bs-docs-nav(role='banner')
.container
.navbar-header
button.navbar-toggle(type='button', data-toggle='collapse', data-target='#collapse')
span.sr-only Toggle navigation
span.icon-bar
span.icon-bar
span.icon-bar
a.navbar-brand(href='../')= title
nav#collapse.collapse.navbar-collapse.bs-navbar-collapse(role='navigation')
ul.nav.navbar-nav
li: a(href='https://github.com/Bttstrp/bootstrap-switch/archive/master.zip', data-toggle='dropdown') Download
li: a(href='examples.html') Examples
li.dropdown
a(href='#', data-toggle='dropdown')
| Documentation
= ' '
span.caret
ul.dropdown-menu
li: a(href='/options.html') Options
li: a(href='/methods.html') Methods
li: a(href='/events.html') Events
li.divider(role='presentation')
li: a(href='/documentation-2.html') Documentation (v2.0.1)
li: a(href='https://github.com/Bttstrp/bootstrap-switch/issues') Bug reports
main#content(role='main')
!= yield
footer.bs-docs-footer
.container
p
| Code licensed under
= ' '
a(href='https://www.apache.org/licenses/LICENSE-2.0', target='_blank') Apache License, Version 2.0
br
| Created by
= ' '
a(href='https://github.com/nostalgiaz', target='_blank') Mattia Larentis
br
| Mantained by
= ' '
a(href='https://github.com/lostcrew', target='_blank') Emanuele Marchi
script(src='https://code.jquery.com/jquery-3.1.1.min.js')
script(src='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js')
script(src='js/highlight.js')
script(src="https://unpkg.com/bootstrap-switch")
script(src='js/main.js')

View File

@ -0,0 +1,153 @@
/*
Original style from softwaremaniacs.org (c) Ivan Sagalaev <Maniac@SoftwareManiacs.Org>
*/
.hljs {
display: block; padding: 0.5em;
background: #F0F0F0;
}
.hljs,
.hljs-subst,
.hljs-tag .hljs-title,
.lisp .hljs-title,
.clojure .hljs-built_in,
.nginx .hljs-title {
color: black;
}
.hljs-string,
.hljs-title,
.hljs-constant,
.hljs-parent,
.hljs-tag .hljs-value,
.hljs-rules .hljs-value,
.hljs-rules .hljs-value .hljs-number,
.hljs-preprocessor,
.hljs-pragma,
.haml .hljs-symbol,
.ruby .hljs-symbol,
.ruby .hljs-symbol .hljs-string,
.hljs-aggregate,
.hljs-template_tag,
.django .hljs-variable,
.smalltalk .hljs-class,
.hljs-addition,
.hljs-flow,
.hljs-stream,
.bash .hljs-variable,
.apache .hljs-tag,
.apache .hljs-cbracket,
.tex .hljs-command,
.tex .hljs-special,
.erlang_repl .hljs-function_or_atom,
.asciidoc .hljs-header,
.markdown .hljs-header,
.coffeescript .hljs-attribute {
color: #800;
}
.smartquote,
.hljs-comment,
.hljs-annotation,
.hljs-template_comment,
.diff .hljs-header,
.hljs-chunk,
.asciidoc .hljs-blockquote,
.markdown .hljs-blockquote {
color: #888;
}
.hljs-number,
.hljs-date,
.hljs-regexp,
.hljs-literal,
.hljs-hexcolor,
.smalltalk .hljs-symbol,
.smalltalk .hljs-char,
.go .hljs-constant,
.hljs-change,
.lasso .hljs-variable,
.makefile .hljs-variable,
.asciidoc .hljs-bullet,
.markdown .hljs-bullet,
.asciidoc .hljs-link_url,
.markdown .hljs-link_url {
color: #080;
}
.hljs-label,
.hljs-javadoc,
.ruby .hljs-string,
.hljs-decorator,
.hljs-filter .hljs-argument,
.hljs-localvars,
.hljs-array,
.hljs-attr_selector,
.hljs-important,
.hljs-pseudo,
.hljs-pi,
.haml .hljs-bullet,
.hljs-doctype,
.hljs-deletion,
.hljs-envvar,
.hljs-shebang,
.apache .hljs-sqbracket,
.nginx .hljs-built_in,
.tex .hljs-formula,
.erlang_repl .hljs-reserved,
.hljs-prompt,
.asciidoc .hljs-link_label,
.markdown .hljs-link_label,
.vhdl .hljs-attribute,
.clojure .hljs-attribute,
.asciidoc .hljs-attribute,
.lasso .hljs-attribute,
.coffeescript .hljs-property,
.hljs-phony {
color: #88F
}
.hljs-keyword,
.hljs-id,
.hljs-title,
.hljs-built_in,
.hljs-aggregate,
.css .hljs-tag,
.hljs-javadoctag,
.hljs-phpdoc,
.hljs-yardoctag,
.smalltalk .hljs-class,
.hljs-winutils,
.bash .hljs-variable,
.apache .hljs-tag,
.go .hljs-typename,
.tex .hljs-command,
.asciidoc .hljs-strong,
.markdown .hljs-strong,
.hljs-request,
.hljs-status {
font-weight: bold;
}
.asciidoc .hljs-emphasis,
.markdown .hljs-emphasis {
font-style: italic;
}
.nginx .hljs-built_in {
font-weight: normal;
}
.coffeescript .javascript,
.javascript .xml,
.lasso .markup,
.tex .hljs-formula,
.xml .javascript,
.xml .vbscript,
.xml .css,
.xml .hljs-cdata {
opacity: 0.5;
}

View File

@ -0,0 +1,53 @@
body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
padding-bottom: 50px;
}
.bs-docs-masthead,
.bs-docs-header {
color: #cdbfe3;
text-shadow: 0 1px 0 rgba(0,0,0,.1);
background-color: #6f5499;
background-image: -webkit-gradient(linear,left top,left bottom,from(#563d7c),to(#6f5499));
background-image:-webkit-linear-gradient(top,#563d7c 0,#6f5499 100%);
background-image:-o-linear-gradient(top,#563d7c 0,#6f5499 100%);
background-image:linear-gradient(to bottom,#563d7c 0,#6f5499 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#563d7c', endColorstr='#6F5499', GradientType=0);
background-repeat:repeat-x
}
.bs-docs-masthead h1 {
font-weight: 500;
}
.page-header {
text-align: left;
}
#github {
display: none;
position: fixed;
width: 150px;
height: 150px;
top: 0;
right: 0;
z-index: 2000;
}
.bottom {
border-top: 1px solid #eee;
margin-top: 40px;
padding-top: 20px;
padding-bottom: 20px;
text-align: center;
}
.hljs {
background-color: transparent;
}
@media (min-width: 768px) {
#github {
display: block;
}
}

View File

@ -0,0 +1,212 @@
.bs-docs-header
.container
h1 Documentation
p v2.0.1
.container
#options
h2.page-header Options
.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 exceptions to the rule, being
| default HTML input attributes.<br>
| Therefore, there is not any way to specify the options in JavaScript during initialization.
table.table.table-bordered.table-striped.table-responsive
thead
tr
th Name
th Type
th Description
th Values
th Default
tbody
tr
td state
td Boolean
td The checkbox state
td true, false
td 'checked' attribute or true
tr
td size
td String
td The checkbox state
td '', 'mini', 'small', 'normal', 'large'
td ''
tr
td animate
td Boolean
td Animate the switch
td true, false
td true
tr
td disabled
td Boolean
td Disable state
td true, false
td 'disabled' attribute or false
tr
td readonly
td Boolean
td Readonly state
td true, false
td 'readonly' attribute or false
tr
td on
td String
td Color of the left side of the switch
td 'primary', 'info', 'success', 'warning', 'danger', 'default'
td null
tr
td off
td String
td Color of the right side of the switch
td 'primary', 'info', 'success', 'warning', 'danger', 'default'
td null
tr
td on-label
td String
td Text of the left side of the switch
td String
td 'ON'
tr
td off-label
td String
td Text of the right side of the switch
td String
td 'OFF'
tr
td label-text
td String
td Text of the center handle of the switch
td String
td '&amp;nbsp;'
tr
td label-icon
td String
td Text of the center handle of the switch. Use to include external services icons
td String
td null
#methods
h2.page-header Methods
table.table.table-bordered.table-striped.table-responsive
thead
tr
th Name
th Description
th Accepted Values
th Returned Values
tbody
tr
td state
td Get checkbox state
td
td true, false
tr
td setState
td Set checkbox state
td (value: true, false)[, skip: true, <strong>false</strong>]
td jQuery Object (input element)
tr
td toggleState
td Toggle checkbox state
td [skip: true, <strong>false</strong>]
td jQuery Object (input element)
tr
td toggleRadioState
td Toggle radio state
td [skip: true, <strong>false</strong>]
td jQuery Object (input element)
tr
td toggleRadioStateAllowUncheck
td Toggle radio state allowing uncheck of the radio input
td [uncheck: true, <strong>false</strong> | skip: true, <strong>false</strong>]
td jQuery Object (input element)
tr
td setSizeClass
td Set the size of the switch
td '', 'mini', 'small', 'normal', 'large'
td jQuery Object (input element)
tr
td setAnimated
td Animate the switch
td true, false
td jQuery Object (input element)
tr
td isDisabled
td Get disabled state
td
td true, false
tr
td setDisabled
td Set disable state
td true, false
td jQuery Object (input element)
tr
td toggleDisabled
td Toggle disabled state
td
td jQuery Object (input element)
tr
td isReadOnly
td Get Readonly state
td
td true, false
tr
td setReadOnly
td Set Readonly state
td true, false
td jQuery Object (input element)
tr
td toggleReadOnly
td Toggle readonly state
td
td jQuery Object (input element)
tr
td setOnClass
td Color of the left side of the switch
td 'primary', 'info', 'success', 'warning', 'danger', 'default'
td jQuery Object (input element)
tr
td setOffClass
td Color of the right side of the switch
td 'primary', 'info', 'success', 'warning', 'danger', 'default'
td jQuery Object (input element)
tr
td setOnLabel
td Text of the left side of the switch
td String
td jQuery Object (input element)
tr
td setOffLabel
td Text of the right side of the switch
td String
td jQuery Object (input element)
tr
td setTextLabel
td Text of the center handle of the switch
td String
td null
tr
td setTextIcon
td Text of the center handle of the switch. Use to include external services icons
td String
td null
tr
td destroy
td Destroy the instance of #{title}
td
td jQuery Object (input element)
#events
h2.page-header Events
p
| The only event triggered is <code>switch-change</code>. It returns two parameters: <code>event</code> and
| <code>data</code>.<br>
| The latter is an object that includes <code>el</code> (the input DOM element) and <code>value</code> (the
| new input state)

View File

@ -0,0 +1,36 @@
.bs-docs-header
.container
h1 Events
.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 follows:
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
| });
table.table.table-bordered.table-striped.table-responsive
thead
tr
th Name
th Description
th Parameters
tbody
tr
td init
td Triggered on initialization. 'this' refers to the DOM element.
td
| event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>)
| state (true | false)
tr
td switchChange
td Triggered on switch state change. 'this' refers to the DOM element.
td
| event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>),
| state (true | false)

View File

@ -0,0 +1,182 @@
.bs-docs-header
.container
h1 Examples
.container
.row
.col-sm-6.col-lg-4
h2.h4 State
p
input#switch-state(type='checkbox', checked)
.btn-group
button.btn.btn-default(type='button' data-switch-toggle='state') Toggle
button.btn.btn-default(type='button', data-switch-set='state', data-switch-value='true') Set true
button.btn.btn-default(type='button', data-switch-set='state', data-switch-value='false') Set false
button.btn.btn-default(type='button', data-switch-get='state') Get
.col-sm-6.col-lg-4
h2.h4 Size
p
input#switch-size(type='checkbox', checked, data-size='mini')
.btn-group
button.btn.btn-default(type='button', data-switch-set='size', data-switch-value='mini') Mini
button.btn.btn-default(type='button', data-switch-set='size', data-switch-value='small') Small
button.btn.btn-default(type='button', data-switch-set='size', data-switch-value='normal') Normal
button.btn.btn-default(type='button', data-switch-set='size', data-switch-value='large') Large
button.btn.btn-default(type='button', data-switch-get='size') Get
.col-sm-6.col-lg-4
h2.h4 Animate
p
input#switch-animate(type='checkbox', checked)
p
button.btn.btn-default(type='button', data-switch-toggle='animate') Toggle
button.btn.btn-default(type='button', data-switch-get='animate') Get
.col-sm-6.col-lg-4
h2.h4 Disabled
p
input#switch-disabled(type='checkbox', checked, disabled)
p
button.btn.btn-default(type='button', data-switch-toggle='disabled') Toggle
button.btn.btn-default(type='button', data-switch-get='disabled') Get
.col-sm-6.col-lg-4
h2.h4 Readonly
p
input#switch-readonly(type='checkbox', checked, readonly)
p
button.btn.btn-default(type='button', data-switch-toggle='readonly') Toggle
button.btn.btn-default(type='button', data-switch-get='readonly') Get
.col-sm-6.col-lg-4
h2.h4 Indeterminate
p
input#switch-indeterminate(type='checkbox', checked, data-indeterminate='true')
p
button.btn.btn-default(type='button', data-switch-toggle='indeterminate') Toggle
button.btn.btn-default(type='button', data-switch-get='indeterminate') Get
.col-sm-6.col-lg-4
h2.h4 Inverse
p
input#switch-inverse(type='checkbox', checked, data-inverse='true')
p
button.btn.btn-default(type='button', data-switch-toggle='inverse') Toggle
button.btn.btn-default(type='button', data-switch-get='inverse') Get
.col-sm-6.col-lg-4
h2.h4 On Color
p
input#switch-onColor(type='checkbox', checked, data-on-color='info')
p.btn-group
.btn-group
button.btn.btn-default.dropdown-toggle(type='button', data-toggle='dropdown')
| Set &nbsp;
span.caret
.dropdown-menu(role='menu')
li: a(data-switch-set='onColor', data-switch-value='primary') Primary
li: a(data-switch-set='onColor', data-switch-value='info') Info
li: a(data-switch-set='onColor', data-switch-value='success') Success
li: a(data-switch-set='onColor', data-switch-value='warning') Warning
li: a(data-switch-set='onColor', data-switch-value='default') Default
button.btn.btn-default(type='button', data-switch-get='onColor') Get
.col-sm-6.col-lg-4
h2.h4 Off Color
p
input#switch-offColor(type='checkbox', data-off-color='warning')
p.btn-group
.btn-group
button.btn.btn-default.dropdown-toggle(type='button', data-toggle='dropdown')
| Set &nbsp;
span.caret
.dropdown-menu(role='menu')
li: a(data-switch-set='offColor', data-switch-value='primary') Primary
li: a(data-switch-set='offColor', data-switch-value='info') Info
li: a(data-switch-set='offColor', data-switch-value='success') Success
li: a(data-switch-set='offColor', data-switch-value='warning') Warning
li: a(data-switch-set='offColor', data-switch-value='default') Default
button.btn.btn-default(type='button', data-switch-get='offColor') Get
.col-sm-6.col-lg-4
h2.h4 On Text
p
input#switch-onText(type='checkbox', checked, data-on-text='Yes')
.row
.col-sm-6
input.form-control(type='text', data-switch-set-value='onText', value='Yes')
.col-sm-6.col-lg-4
h2.h4 Off Text
p
input#switch-offText(type='checkbox', data-off-text='No')
.row
.col-sm-6
input.form-control(type='text', data-switch-set-value='offText', value='No')
.col-sm-6.col-lg-4
h2.h4 Label Text
p
input#switch-labelText(type='checkbox', data-label-text='Label')
.row
.col-sm-6
input.form-control(type='text', data-switch-set-value='labelText')
.col-sm-6.col-lg-4
h2.h4 Handle Width
p
input#switch-handleWidth(type='checkbox', data-handle-width='100')
.row
.col-sm-6
input.form-control(type='number', data-switch-set-value='handleWidth', value='100')
.col-sm-6.col-lg-4
h2.h4 Label Width
p
input#switch-labelWidth(type='checkbox', data-label-width='100')
.row
.col-sm-6
input.form-control(type='number', data-switch-set-value='labelWidth', value='100')
.col-sm-6.col-lg-4
h2.h4 Create | Destroy
p
input#switch-create-destroy(type='checkbox', checked, data-switch-no-init)
.row
.col-sm-6
button.btn.btn-default(type='button', data-switch-create-destroy, data-destroy-text="Destroy") Create
br
br
.text-center
h2.h4 Radio All Off
.row
.col-sm-6
h3.h5 Disabled
input.switch-radio1(type='radio', name='radio1', checked)
input.switch-radio1(type='radio', name='radio1')
input.switch-radio1(type='radio', name='radio1')
.col-sm-6
h3.h5 Enabled
input.switch-radio2(type='radio', name='radio2', checked, data-radio-all-off='true')
input.switch-radio2(type='radio', name='radio2', data-radio-all-off='true')
input.switch-radio2(type='radio', name='radio2', data-radio-all-off='true')
br
hr
h2.h4 Inside Modals
button.btn.btn-default(data-toggle='modal', data-target='#modal-switch') Open Modal
.modal.fade#modal-switch(tabindex='-1', role='dialog', aria-labelledby='modal-switch-label')
.modal-dialog
.modal-content
.modal-header
button.close(type='button', data-dismiss='modal')
span(aria-hidden='true') &times;
span.sr-only Close
.modal-title#modal-switch-label Title
.modal-body
input#switch-modal(type='checkbox', checked)

View File

@ -0,0 +1,46 @@
.bs-docs-masthead
.container
h1.title= title
p.lead
| Turn checkboxes &nbsp;
input(type='checkbox', checked, data-switch-no-init)
| &nbsp; and radio buttons &nbsp;
input(type='radio', checked, data-switch-no-init)
| &nbsp; into toggle switches &nbsp;
input(type='checkbox', checked)
p.lead
a.btn.btn-outline-inverse.btn-lg(href='https://github.com/Bttstrp/bootstrap-switch/archive/master.zip') Download #{title}
p.bs-docs-social
iframe(src='https://ghbtns.com/github-btn.html?user=Bttstrp&repo=bootstrap-switch&type=watch&count=true&size=large', allowtransparency='true', frameborder='0', scrolling='0', width='184', height='30')
iframe(src='https://ghbtns.com/github-btn.html?user=Bttstrp&repo=bootstrap-switch&type=fork&count=true&size=large', allowtransparency='true', frameborder='0', scrolling='0', width='144', height='30')
br
p.version
| Currently v#{version} · Compatible with Bootstrap 2 and 3
.container
h2.page-header Getting Started
p Include the dependencies: jQuery, Bootstrap and #{title} CSS + Javascript.
pre: code
| [...]
| &lt;link href="bootstrap.css" rel="stylesheet"&gt;
| &lt;link href="bootstrap-switch.css" rel="stylesheet"&gt;
| &lt;script src="jquery.js"&gt;&lt;/script&gt;
| &lt;script src="bootstrap-switch.js"&gt;&lt;/script&gt;
| [...]
p Add your checkbox.
pre: code &lt;input type="checkbox" name="my-checkbox" checked&gt;
p Initialize #{title}.
pre: code $("[name='my-checkbox']").bootstrapSwitch();
p Enjoy.
.text-center
a.btn.btn-lg.btn-primary(href='examples.html') See Examples
| &nbsp;
a.btn.btn-lg.btn-outline(href='options.html') Browse Documentation

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,60 @@
var $ = window.jQuery
var $window = $(window)
var sectionTop = $('.top').outerHeight() + 20
var $createDestroy = $('#switch-create-destroy')
function capitalize (string) {
return string.charAt(0).toUpperCase() + string.slice(1)
}
window.hljs.initHighlightingOnLoad()
$(function () {
$('a[href*=\'#\']').on('click', function (event) {
event.preventDefault()
var $target = $($(this).attr('href').slice('#'))
if ($target.length) {
$window.scrollTop($target.offset().top - sectionTop)
}
})
$('input[type="checkbox"], input[type="radio"]')
.not('[data-switch-no-init]')
.bootstrapSwitch()
$('[data-switch-get]').on('click', function () {
var type = $(this).data('switch-get')
window.alert($('#switch-' + type).bootstrapSwitch(type))
})
$('[data-switch-set]').on('click', function () {
var type
type = $(this).data('switch-set')
$('#switch-' + type).bootstrapSwitch(type, $(this).data('switch-value'))
})
$('[data-switch-toggle]').on('click', function () {
var type = $(this).data('switch-toggle')
$('#switch-' + type).bootstrapSwitch('toggle' + capitalize(type))
})
$('[data-switch-set-value]').on('input', function (event) {
var type, value
event.preventDefault()
type = $(this).data('switch-set-value')
value = $.trim($(this).val())
if ($(this).data('value') === value) {
return
}
$('#switch-' + type).bootstrapSwitch(type, value)
})
$('[data-switch-create-destroy]').on('click', function () {
var isSwitch
isSwitch = $createDestroy.data('bootstrap-switch')
$createDestroy.bootstrapSwitch((isSwitch ? 'destroy' : null))
$(this).button((isSwitch ? 'reset' : 'destroy'))
})
$('#confirm').bootstrapSwitch({
size: 'large',
onSwitchChange: function (event, state) {
event.preventDefault()
return console.log(state, event.isDefaultPrevented())
}
})
})

View File

@ -0,0 +1,46 @@
.bs-docs-header
.container
h1 Methods
.container
p In #{title}, every option is also a method.
p If the second parameter is omitted, the method returns the current value.
p You can invoke methods as follows:
pre: code $('input[name="my-checkbox"]').bootstrapSwitch('state', true, true);
h2 Additional Methods
table.table.table-bordered.table-striped.table-responsive
thead
tr
th Name
th Description
tbody
tr
td toggleState
td Toggle the switch state
tr
td toggleAnimate
td Toggle the animate option
tr
td toggleDisabled
td Toggle the disabled state
tr
td toggleReadonly
td Toggle the readonly state
tr
td toggleIndeterminate
td Toggle the indeterminate state
tr
td toggleInverse
td Toggle the inverse option
tr
td destroy
td Destroy the instance of #{title}
h2 Special Behaviours
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 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 The method <code>wrapperClass</code> can accept a falsy value as second parameter. If so, it resets the class to its default.

View File

@ -0,0 +1,156 @@
.bs-docs-header
.container
h1 Options
.container
table.table.table-bordered.table-striped.table-responsive
thead
tr
th Name
th Attribute
th Type
th Description
th Values
th Default
tbody
tr
td state
td checked
td Boolean
td The checkbox state
td true, false
td true
tr
td size
td data-size
td String
td The checkbox size
td null, 'mini', 'small', 'normal', 'large'
td null
tr
td animate
td data-animate
td Boolean
td Animate the switch
td true, false
td true
tr
td disabled
td disabled
td Boolean
td Disable state
td true, false
td false
tr
td readonly
td readonly
td Boolean
td Readonly state
td true, false
td false
tr
td indeterminate
td data-indeterminate
td Boolean
td Indeterminate state
td true, false
td false
tr
td inverse
td data-inverse
td Boolean
td Inverse switch direction
td true, false
td false
tr
td radioAllOff
td data-radio-all-off
td Boolean
td Allow this radio button to be unchecked by the user
td true, false
td false
tr
td onColor
td data-on-color
td String
td Color of the left side of the switch
td 'primary', 'info', 'success', 'warning', 'danger', 'default'
td 'primary'
tr
td offColor
td data-off-color
td String
td Color of the right side of the switch
td 'primary', 'info', 'success', 'warning', 'danger', 'default'
td 'default'
tr
td onText
td data-on-text
td String
td Text of the left side of the switch
td String
td 'ON'
tr
td offText
td data-off-text
td String
td Text of the right side of the switch
td String
td 'OFF'
tr
td labelText
td data-label-text
td String
td Text of the center handle of the switch
td String
td '&amp;nbsp;'
tr
td handleWidth
td data-handle-width
td String | Number
td Width of the left and right sides in pixels
td 'auto' or Number
td 'auto'
tr
td labelWidth
td data-label-width
td String | Number
td Width of the center handle in pixels
td 'auto' or Number
td 'auto'
tr
td baseClass
td data-base-class
td String
td Global class prefix
td String
td 'bootstrap-switch'
tr
td wrapperClass
td data-wrapper-class
td String | Array
td Container element class(es)
td String | Array
td 'wrapper'
tr
td onInit
td
td Function
td Callback function to execute on initialization
td Function
td: pre: code.javascript function(event, state) {}
tr
td onSwitchChange
td
td Function
td Callback function to execute on switch state change. If false is returned, the status will be reverted, otherwise nothing changes
td Function
td: pre: code.javascript function(event, state) {}
h2 Global Defaults Overriding
p Follow the jQuery convention to override the default options of the library. For instance:
pre
code
| $.fn.bootstrapSwitch.defaults.size = 'large';
| $.fn.bootstrapSwitch.defaults.onColor = 'success';

View File

@ -0,0 +1,614 @@
import jquery from 'jquery'
const $ = jquery || window.jQuery || window.$
class BootstrapSwitch {
constructor (element, options = {}) {
this.$element = $(element)
this.options = $.extend(
{},
$.fn.bootstrapSwitch.defaults,
this._getElementOptions(),
options
)
this.prevOptions = {}
this.$wrapper = $('<div>', {
class: () => {
const classes = []
classes.push(this.options.state ? 'on' : 'off')
if (this.options.size) {
classes.push(this.options.size)
}
if (this.options.disabled) {
classes.push('disabled')
}
if (this.options.readonly) {
classes.push('readonly')
}
if (this.options.indeterminate) {
classes.push('indeterminate')
}
if (this.options.inverse) {
classes.push('inverse')
}
if (this.$element.attr('id')) {
classes.push(`id-${this.$element.attr('id')}`)
}
return classes
.map(this._getClass.bind(this))
.concat([this.options.baseClass], this._getClasses(this.options.wrapperClass))
.join(' ')
}
})
this.$container = $('<div>', { class: this._getClass('container') })
this.$on = $('<span>', {
html: this.options.onText,
class: `${this._getClass('handle-on')} ${this._getClass(this.options.onColor)}`
})
this.$off = $('<span>', {
html: this.options.offText,
class: `${this._getClass('handle-off')} ${this._getClass(this.options.offColor)}`
})
this.$label = $('<span>', {
html: this.options.labelText,
class: this._getClass('label')
})
this.$element.on('init.bootstrapSwitch', this.options.onInit.bind(this, element))
this.$element.on('switchChange.bootstrapSwitch', (...args) => {
if (this.options.onSwitchChange.apply(element, args) === false) {
if (this.$element.is(':radio')) {
$(`[name="${this.$element.attr('name')}"]`).trigger('previousState.bootstrapSwitch', true)
} else {
this.$element.trigger('previousState.bootstrapSwitch', true)
}
}
})
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', this.options.state)
}
setPrevOptions () {
this.prevOptions = { ...this.options }
}
state (value, skip) {
if (typeof value === 'undefined') { return this.options.state }
if (
(this.options.disabled || this.options.readonly) ||
(this.options.state && !this.options.radioAllOff && this.$element.is(':radio'))
) { return this.$element }
if (this.$element.is(':radio')) {
$(`[name="${this.$element.attr('name')}"]`).trigger('setPreviousOptions.bootstrapSwitch')
} else {
this.$element.trigger('setPreviousOptions.bootstrapSwitch')
}
if (this.options.indeterminate) {
this.indeterminate(false)
}
this.$element
.prop('checked', Boolean(value))
.trigger('change.bootstrapSwitch', skip)
return this.$element
}
toggleState (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)
}
}
size (value) {
if (typeof value === 'undefined') { return this.options.size }
if (this.options.size != null) {
this.$wrapper.removeClass(this._getClass(this.options.size))
}
if (value) {
this.$wrapper.addClass(this._getClass(value))
}
this._width()
this._containerPosition()
this.options.size = value
return this.$element
}
animate (value) {
if (typeof value === 'undefined') { return this.options.animate }
if (this.options.animate === Boolean(value)) { return this.$element }
return this.toggleAnimate()
}
toggleAnimate () {
this.options.animate = !this.options.animate
this.$wrapper.toggleClass(this._getClass('animate'))
return this.$element
}
disabled (value) {
if (typeof value === 'undefined') { return this.options.disabled }
if (this.options.disabled === Boolean(value)) { return this.$element }
return this.toggleDisabled()
}
toggleDisabled () {
this.options.disabled = !this.options.disabled
this.$element.prop('disabled', this.options.disabled)
this.$wrapper.toggleClass(this._getClass('disabled'))
return this.$element
}
readonly (value) {
if (typeof value === 'undefined') { return this.options.readonly }
if (this.options.readonly === Boolean(value)) { return this.$element }
return this.toggleReadonly()
}
toggleReadonly () {
this.options.readonly = !this.options.readonly
this.$element.prop('readonly', this.options.readonly)
this.$wrapper.toggleClass(this._getClass('readonly'))
return this.$element
}
indeterminate (value) {
if (typeof value === 'undefined') { return this.options.indeterminate }
if (this.options.indeterminate === Boolean(value)) { return this.$element }
return this.toggleIndeterminate()
}
toggleIndeterminate () {
this.options.indeterminate = !this.options.indeterminate
this.$element.prop('indeterminate', this.options.indeterminate)
this.$wrapper.toggleClass(this._getClass('indeterminate'))
this._containerPosition()
return this.$element
}
inverse (value) {
if (typeof value === 'undefined') { return this.options.inverse }
if (this.options.inverse === Boolean(value)) { return this.$element }
return this.toggleInverse()
}
toggleInverse () {
this.$wrapper.toggleClass(this._getClass('inverse'))
const $on = this.$on.clone(true)
const $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
}
onColor (value) {
if (typeof value === 'undefined') { return this.options.onColor }
if (this.options.onColor) {
this.$on.removeClass(this._getClass(this.options.onColor))
}
this.$on.addClass(this._getClass(value))
this.options.onColor = value
return this.$element
}
offColor (value) {
if (typeof value === 'undefined') { return this.options.offColor }
if (this.options.offColor) {
this.$off.removeClass(this._getClass(this.options.offColor))
}
this.$off.addClass(this._getClass(value))
this.options.offColor = value
return this.$element
}
onText (value) {
if (typeof value === 'undefined') { return this.options.onText }
this.$on.html(value)
this._width()
this._containerPosition()
this.options.onText = value
return this.$element
}
offText (value) {
if (typeof value === 'undefined') { return this.options.offText }
this.$off.html(value)
this._width()
this._containerPosition()
this.options.offText = value
return this.$element
}
labelText (value) {
if (typeof value === 'undefined') { return this.options.labelText }
this.$label.html(value)
this._width()
this.options.labelText = value
return this.$element
}
handleWidth (value) {
if (typeof value === 'undefined') { return this.options.handleWidth }
this.options.handleWidth = value
this._width()
this._containerPosition()
return this.$element
}
labelWidth (value) {
if (typeof value === 'undefined') { return this.options.labelWidth }
this.options.labelWidth = value
this._width()
this._containerPosition()
return this.$element
}
baseClass (value) {
return this.options.baseClass
}
wrapperClass (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
}
radioAllOff (value) {
if (typeof value === 'undefined') { return this.options.radioAllOff }
const val = Boolean(value)
if (this.options.radioAllOff === val) { return this.$element }
this.options.radioAllOff = val
return this.$element
}
onInit (value) {
if (typeof value === 'undefined') { return this.options.onInit }
if (!value) {
value = $.fn.bootstrapSwitch.defaults.onInit
}
this.options.onInit = value
return this.$element
}
onSwitchChange (value) {
if (typeof value === 'undefined') {
return this.options.onSwitchChange
}
if (!value) {
value = $.fn.bootstrapSwitch.defaults.onSwitchChange
}
this.options.onSwitchChange = value
return this.$element
}
destroy () {
const $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
}
_getElementOptions () {
return {
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')
}
}
_width () {
const $handles = this.$on
.add(this.$off)
.add(this.$label)
.css('width', '')
const handleWidth = this.options.handleWidth === 'auto'
? Math.round(Math.max(this.$on.width(), this.$off.width()))
: this.options.handleWidth
$handles.width(handleWidth)
this.$label.width((index, width) => {
if (this.options.labelWidth !== 'auto') { return this.options.labelWidth }
if (width < handleWidth) { return handleWidth }
return width
})
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)
}
_containerPosition (state = this.options.state, callback) {
this.$container.css('margin-left', () => {
const 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]
}
}
})
}
_init () {
const init = () => {
this.setPrevOptions()
this._width()
this._containerPosition()
setTimeout(() => {
if (this.options.animate) {
return this.$wrapper.addClass(this._getClass('animate'))
}
}, 50)
}
if (this.$wrapper.is(':visible')) {
init()
return
}
const initInterval = window.setInterval(() => {
if (this.$wrapper.is(':visible')) {
init()
return window.clearInterval(initInterval)
}
}, 50)
}
_elementHandlers () {
return this.$element.on({
'setPreviousOptions.bootstrapSwitch': this.setPrevOptions.bind(this),
'previousState.bootstrapSwitch': () => {
this.options = this.prevOptions
if (this.options.indeterminate) {
this.$wrapper.addClass(this._getClass('indeterminate'))
}
this.$element
.prop('checked', this.options.state)
.trigger('change.bootstrapSwitch', true)
},
'change.bootstrapSwitch': (event, skip) => {
event.preventDefault()
event.stopImmediatePropagation()
const state = this.$element.is(':checked')
this._containerPosition(state)
if (state === this.options.state) {
return
}
this.options.state = state
this.$wrapper
.toggleClass(this._getClass('off'))
.toggleClass(this._getClass('on'))
if (!skip) {
if (this.$element.is(':radio')) {
$(`[name="${this.$element.attr('name')}"]`)
.not(this.$element)
.prop('checked', false)
.trigger('change.bootstrapSwitch', true)
}
this.$element.trigger('switchChange.bootstrapSwitch', [state])
}
},
'focus.bootstrapSwitch': event => {
event.preventDefault()
this.$wrapper.addClass(this._getClass('focused'))
},
'blur.bootstrapSwitch': event => {
event.preventDefault()
this.$wrapper.removeClass(this._getClass('focused'))
},
'keydown.bootstrapSwitch': event => {
if (!event.which || this.options.disabled || this.options.readonly) {
return
}
if (event.which === 37 || event.which === 39) {
event.preventDefault()
event.stopImmediatePropagation()
this.state(event.which === 39)
}
}
})
}
_handleHandlers () {
this.$on.on('click.bootstrapSwitch', event => {
event.preventDefault()
event.stopPropagation()
this.state(false)
return this.$element.trigger('focus.bootstrapSwitch')
})
return this.$off.on('click.bootstrapSwitch', event => {
event.preventDefault()
event.stopPropagation()
this.state(true)
return this.$element.trigger('focus.bootstrapSwitch')
})
}
_labelHandlers () {
const handlers = {
click (event) { event.stopPropagation() },
'mousedown.bootstrapSwitch touchstart.bootstrapSwitch': event => {
if (this._dragStart || this.options.disabled || this.options.readonly) {
return
}
event.preventDefault()
event.stopPropagation()
this._dragStart = (event.pageX || event.originalEvent.touches[0].pageX) - parseInt(this.$container.css('margin-left'), 10)
if (this.options.animate) {
this.$wrapper.removeClass(this._getClass('animate'))
}
this.$element.trigger('focus.bootstrapSwitch')
},
'mousemove.bootstrapSwitch touchmove.bootstrapSwitch': event => {
if (this._dragStart == null) { return }
const difference = (event.pageX || event.originalEvent.touches[0].pageX) - this._dragStart
event.preventDefault()
if (difference < -this._handleWidth || difference > 0) { return }
this._dragEnd = difference
this.$container.css('margin-left', `${this._dragEnd}px`)
},
'mouseup.bootstrapSwitch touchend.bootstrapSwitch': event => {
if (!this._dragStart) { return }
event.preventDefault()
if (this.options.animate) {
this.$wrapper.addClass(this._getClass('animate'))
}
if (this._dragEnd) {
const state = this._dragEnd > -(this._handleWidth / 2)
this._dragEnd = false
this.state(this.options.inverse ? !state : state)
} else {
this.state(!this.options.state)
}
this._dragStart = false
},
'mouseleave.bootstrapSwitch': () => {
this.$label.trigger('mouseup.bootstrapSwitch')
}
}
this.$label.on(handlers)
}
_externalLabelHandler () {
const $externalLabel = this.$element.closest('label')
$externalLabel.on('click', event => {
event.preventDefault()
event.stopImmediatePropagation()
if (event.target === $externalLabel[0]) {
this.toggleState()
}
})
}
_formHandler () {
const $form = this.$element.closest('form')
if ($form.data('bootstrap-switch')) {
return
}
$form
.on('reset.bootstrapSwitch', () => {
window.setTimeout(() => {
$form.find('input')
.filter(function () { return $(this).data('bootstrap-switch') })
.each(function () { return $(this).bootstrapSwitch('state', this.checked) })
}, 1)
})
.data('bootstrap-switch', true)
}
_getClass (name) {
return `${this.options.baseClass}-${name}`
}
_getClasses (classes) {
if (!$.isArray(classes)) {
return [this._getClass(classes)]
}
return classes.map(this._getClass.bind(this))
}
}
$.fn.bootstrapSwitch = function (option, ...args) {
function reducer (ret, next) {
const $this = $(next)
const existingData = $this.data('bootstrap-switch')
const data = existingData || new BootstrapSwitch(next, option)
if (!existingData) {
$this.data('bootstrap-switch', data)
}
if (typeof option === 'string') {
return data[option].apply(data, args)
}
return ret
}
return Array.prototype.reduce.call(this, reducer, this)
}
$.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,117 @@
const { $, describe, beforeEach, afterEach, it, expect } = window
describe('Bootstrap Switch:', function () {
beforeEach(function () {
$.support.transition = false
$.fx.off = true
})
afterEach(function () {
$(`.${$.fn.bootstrapSwitch.defaults.baseClass}`).bootstrapSwitch('destroy')
})
function createCheckbox () {
return $('<input>', {
type: 'checkbox',
class: 'switch'
}).appendTo('body')
}
function createRadio () {
return $('<input>', {
type: 'radio',
name: 'name',
class: 'switch'
}).appendTo('body')
}
function getOptions ($element) {
return $element.data('bootstrap-switch').options
}
it('should set the default options as element options, except state', function () {
const $switch = createCheckbox().prop('checked', true).bootstrapSwitch()
expect(getOptions($switch)).toEqual($.fn.bootstrapSwitch.defaults)
})
it('should override default options with initialization ones', function () {
const $switch = createCheckbox().prop('checked', false).bootstrapSwitch()
const $switch2 = createCheckbox().bootstrapSwitch({ state: false })
expect(getOptions($switch).state).toBe(false)
expect(getOptions($switch2).state).toBe(false)
})
it('should something', function () {
const $switch = createCheckbox().bootstrapSwitch()
let eventDoc = 0
let eventElement = 0
$(document).on('switchChange.bootstrapSwitch', ':checkbox', function (event, state) { eventDoc++ })
$(':checkbox').on('switchChange.bootstrapSwitch', function (event, state) { eventElement++ })
$switch.click()
expect(eventElement).toEqual(eventDoc)
expect(eventElement).toEqual(1)
})
describe('The Checkbox Bootstrap Switch', function () {
it('should conserve its state if onSwitchChange returns false', function () {
const $switch = createCheckbox().bootstrapSwitch({
onSwitchChange: function (event, state) {
expect(state).toEqual(true)
return false
}
})
const $indeterminateSwitch = createCheckbox().data('indeterminate', true).bootstrapSwitch({
onSwitchChange: function (event, state) {
expect(state).toEqual(true)
return false
}
})
$switch.click()
$indeterminateSwitch.click()
expect($switch.bootstrapSwitch('state')).toEqual(false)
expect($indeterminateSwitch.bootstrapSwitch('state')).toEqual(false)
})
it('should change its state if onSwitchChange does not return false', function () {
const $switch = createCheckbox().bootstrapSwitch({
onSwitchChange: function (event, state) {
expect(state).toEqual(true)
}
})
$switch.click()
expect($switch.bootstrapSwitch('state')).toEqual(true)
})
})
describe('The Radio Bootstrap Switch', function () {
it('should conserve its state if onSwitchChange returns false', function () {
const $radio1 = createRadio().prop('checked', true)
const $radio2 = createRadio().prop('checked', false)
const $radio3 = createRadio().prop('checked', false)
$('[name="name"]').bootstrapSwitch({
onSwitchChange: function (e, s) {
expect(s).toEqual(true)
return false
}
})
$radio2.click()
expect($radio1.bootstrapSwitch('state')).toEqual(true)
expect($radio2.bootstrapSwitch('state')).toEqual(false)
expect($radio3.bootstrapSwitch('state')).toEqual(false)
})
it('should change its state if onSwitchChange not returns false', function () {
const $radio1 = createRadio().prop('checked', true)
const $radio2 = createRadio().prop('checked', false)
const $radio3 = createRadio().prop('checked', false)
$('[name="name"]').bootstrapSwitch({
onSwitchChange: function (e, s) {
expect(s).toEqual(true)
}
})
$radio2.click()
expect($radio1.bootstrapSwitch('state')).toEqual(false)
expect($radio2.bootstrapSwitch('state')).toEqual(true)
expect($radio3.bootstrapSwitch('state')).toEqual(false)
})
})
})

View File

@ -0,0 +1,197 @@
@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;
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);
}
span::before {
content: "\200b";
}
.@{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;
visibility: hidden;
&.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,195 @@
@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: table-cell;
vertical-align: middle;
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;
}
span::before {
content: "\200b";
}
.@{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;
margin: 0;
z-index: -1;
.opacity(0);
visibility: hidden;
}
&.@{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,40 @@
// Mixins
// --------------------------------------------------
// Utilities
@import "mixins/hide-text.less";
@import "mixins/opacity.less";
@import "mixins/image.less";
@import "mixins/labels.less";
@import "mixins/reset-filter.less";
@import "mixins/resize.less";
@import "mixins/responsive-visibility.less";
@import "mixins/size.less";
@import "mixins/tab-focus.less";
@import "mixins/reset-text.less";
@import "mixins/text-emphasis.less";
@import "mixins/text-overflow.less";
@import "mixins/vendor-prefixes.less";
// Components
@import "mixins/alerts.less";
@import "mixins/buttons.less";
@import "mixins/panels.less";
@import "mixins/pagination.less";
@import "mixins/list-group.less";
@import "mixins/nav-divider.less";
@import "mixins/forms.less";
@import "mixins/progress-bar.less";
@import "mixins/table-row.less";
// Skins
@import "mixins/background-variant.less";
@import "mixins/border-radius.less";
@import "mixins/gradients.less";
// Layout
@import "mixins/clearfix.less";
@import "mixins/center-block.less";
@import "mixins/nav-vertical-align.less";
@import "mixins/grid-framework.less";
@import "mixins/grid.less";

View File

@ -0,0 +1,14 @@
// 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%);
}
}

View File

@ -0,0 +1,9 @@
// Contextual backgrounds
.bg-variant(@color) {
background-color: @color;
a&:hover,
a&:focus {
background-color: darken(@color, 10%);
}
}

View File

@ -0,0 +1,18 @@
// 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;
}

View File

@ -0,0 +1,68 @@
// 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;
&:focus,
&.focus {
color: @color;
background-color: darken(@background, 10%);
border-color: darken(@border, 25%);
}
&:hover {
color: @color;
background-color: darken(@background, 10%);
border-color: darken(@border, 12%);
}
&:active,
&.active,
.open > .dropdown-toggle& {
color: @color;
background-color: darken(@background, 10%);
border-color: darken(@border, 12%);
&:hover,
&:focus,
&.focus {
color: @color;
background-color: darken(@background, 17%);
border-color: darken(@border, 25%);
}
}
&:active,
&.active,
.open > .dropdown-toggle& {
background-image: none;
}
&.disabled,
&[disabled],
fieldset[disabled] & {
&,
&:hover,
&:focus,
&.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;
}

View File

@ -0,0 +1,7 @@
// Center-align a block level element
.center-block() {
display: block;
margin-left: auto;
margin-right: auto;
}

View File

@ -0,0 +1,22 @@
// Clearfix
//
// 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.
//
// Source: http://nicolasgallagher.com/micro-clearfix-hack/
.clearfix() {
&:before,
&:after {
content: " "; // 1
display: table; // 2
}
&:after {
clear: both;
}
}

View File

@ -0,0 +1,85 @@
// 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,
&.radio label,
&.checkbox label,
&.radio-inline label,
&.checkbox-inline label {
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-border-focus` 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,59 @@
// 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, @start-color @start-percent, @end-color @end-percent); // Safari 5.1-6, Chrome 10+
background-image: -o-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // Opera 12
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: -o-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Opera 12
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: -o-linear-gradient(@deg, @start-color, @end-color); // Opera 12
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: -o-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: -o-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: -o-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);
}
}

View File

@ -0,0 +1,91 @@
// 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) { // 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) { // 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) and (@index > 0) {
.col-@{class}-push-@{index} {
left: percentage((@index / @grid-columns));
}
}
.calc-grid-column(@index, @class, @type) when (@type = push) and (@index = 0) {
.col-@{class}-push-0 {
left: auto;
}
}
.calc-grid-column(@index, @class, @type) when (@type = pull) and (@index > 0) {
.col-@{class}-pull-@{index} {
right: percentage((@index / @grid-columns));
}
}
.calc-grid-column(@index, @class, @type) when (@type = pull) and (@index = 0) {
.col-@{class}-pull-0 {
right: auto;
}
}
.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);
}

View File

@ -0,0 +1,122 @@
// Grid system
//
// Generate semantic grid columns with these mixins.
// Centered container element
.container-fixed(@gutter: @grid-gutter-width) {
margin-right: auto;
margin-left: auto;
padding-left: (@gutter / 2);
padding-right: (@gutter / 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) {
margin-left: percentage((@columns / @grid-columns));
}
.make-xs-column-push(@columns) {
left: percentage((@columns / @grid-columns));
}
.make-xs-column-pull(@columns) {
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));
}
}

View File

@ -0,0 +1,21 @@
// 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()`.
//
// 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();
}

View File

@ -0,0 +1,33 @@
// Image Mixins
// - Responsive image
// - Retina image
// 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
}
// Retina image
//
// Short retina mixin for setting background-image and -size. Note that the
// spelling of `min--moz-device-pixel-ratio` is intentional.
.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;
}
}

View File

@ -0,0 +1,12 @@
// Labels
.label-variant(@color) {
background-color: @color;
&[href] {
&:hover,
&:focus {
background-color: darken(@color, 10%);
}
}
}

View File

@ -0,0 +1,29 @@
// 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;
}
}
}
}

View File

@ -0,0 +1,10 @@
// 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;
}

View File

@ -0,0 +1,9 @@
// 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);
}

View File

@ -0,0 +1,8 @@
// Opacity
.opacity(@opacity) {
opacity: @opacity;
// IE8 filter
@opacity-ie: (@opacity * 100);
filter: ~"alpha(opacity=@{opacity-ie})";
}

View File

@ -0,0 +1,23 @@
// 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);
}
}
}
}

View File

@ -0,0 +1,24 @@
// 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;
}
.badge {
color: @heading-bg-color;
background-color: @heading-text-color;
}
}
& > .panel-footer {
+ .panel-collapse > .panel-body {
border-bottom-color: @border;
}
}
}

View File

@ -0,0 +1,10 @@
// Progress bars
.progress-bar-variant(@color) {
background-color: @color;
// Deprecated parent class requirement as of v3.2.0
.progress-striped & {
#gradient > .striped();
}
}

View File

@ -0,0 +1,8 @@
// 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)"));
}

View File

@ -0,0 +1,18 @@
.reset-text() {
font-family: @font-family-base;
// We deliberately do NOT reset font-size.
font-style: normal;
font-weight: normal;
letter-spacing: normal;
line-break: auto;
line-height: @line-height-base;
text-align: left; // Fallback for where `start` is not supported
text-align: start;
text-decoration: none;
text-shadow: none;
text-transform: none;
white-space: normal;
word-break: normal;
word-spacing: normal;
word-wrap: normal;
}

View File

@ -0,0 +1,6 @@
// Resize anything
.resizable(@direction) {
resize: @direction; // Options: horizontal, vertical, both
overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible`
}

View File

@ -0,0 +1,15 @@
// Responsive utilities
//
// More easily include all the states for responsive-utilities.less.
.responsive-visibility() {
display: block !important;
table& { display: table !important; }
tr& { display: table-row !important; }
th&,
td& { display: table-cell !important; }
}
.responsive-invisibility() {
display: none !important;
}

View File

@ -0,0 +1,10 @@
// Sizing shortcuts
.size(@width; @height) {
width: @width;
height: @height;
}
.square(@size) {
.size(@size; @size);
}

View File

@ -0,0 +1,9 @@
// WebKit-style focus
.tab-focus() {
// Default
outline: thin dotted;
// WebKit
outline: 5px auto -webkit-focus-ring-color;
outline-offset: -2px;
}

View File

@ -0,0 +1,28 @@
// 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,
&:hover > .@{state},
&.@{state}:hover > th {
background-color: darken(@background, 5%);
}
}
}

View File

@ -0,0 +1,9 @@
// Typography
.text-emphasis-variant(@color) {
color: @color;
a&:hover,
a&:focus {
color: darken(@color, 10%);
}
}

View File

@ -0,0 +1,8 @@
// Text overflow
// Requires inline-block or block for proper styling
.text-overflow() {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}

View File

@ -0,0 +1,227 @@
// Vendor Prefixes
//
// All vendor mixins are deprecated as of v3.2.0 due to the introduction of
// Autoprefixer in our Gruntfile. They will be removed in v4.
// - Animations
// - Backface visibility
// - Box shadow
// - Box sizing
// - Content columns
// - Hyphens
// - Placeholder text
// - Transformations
// - Transitions
// - User Select
// Animations
.animation(@animation) {
-webkit-animation: @animation;
-o-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;
}
.animation-fill-mode(@fill-mode) {
-webkit-animation-fill-mode: @fill-mode;
animation-fill-mode: @fill-mode;
}
// 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;
}
// 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 it.
.box-shadow(@shadow) {
-webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1
box-shadow: @shadow;
}
// Box sizing
.box-sizing(@boxmodel) {
-webkit-box-sizing: @boxmodel;
-moz-box-sizing: @boxmodel;
box-sizing: @boxmodel;
}
// 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;
}
// Placeholder text
.placeholder(@color: @input-color-placeholder) {
// Firefox
&::-moz-placeholder {
color: @color;
opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
}
&:-ms-input-placeholder { color: @color; } // Internet Explorer 10+
&::-webkit-input-placeholder { color: @color; } // Safari and Chrome
}
// Transformations
.scale(@ratio) {
-webkit-transform: scale(@ratio);
-ms-transform: scale(@ratio); // IE9 only
-o-transform: scale(@ratio);
transform: scale(@ratio);
}
.scale(@ratioX; @ratioY) {
-webkit-transform: scale(@ratioX, @ratioY);
-ms-transform: scale(@ratioX, @ratioY); // IE9 only
-o-transform: scale(@ratioX, @ratioY);
transform: scale(@ratioX, @ratioY);
}
.scaleX(@ratio) {
-webkit-transform: scaleX(@ratio);
-ms-transform: scaleX(@ratio); // IE9 only
-o-transform: scaleX(@ratio);
transform: scaleX(@ratio);
}
.scaleY(@ratio) {
-webkit-transform: scaleY(@ratio);
-ms-transform: scaleY(@ratio); // IE9 only
-o-transform: scaleY(@ratio);
transform: scaleY(@ratio);
}
.skew(@x; @y) {
-webkit-transform: skewX(@x) skewY(@y);
-ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
-o-transform: skewX(@x) skewY(@y);
transform: skewX(@x) skewY(@y);
}
.translate(@x; @y) {
-webkit-transform: translate(@x, @y);
-ms-transform: translate(@x, @y); // IE9 only
-o-transform: translate(@x, @y);
transform: translate(@x, @y);
}
.translate3d(@x; @y; @z) {
-webkit-transform: translate3d(@x, @y, @z);
transform: translate3d(@x, @y, @z);
}
.rotate(@degrees) {
-webkit-transform: rotate(@degrees);
-ms-transform: rotate(@degrees); // IE9 only
-o-transform: rotate(@degrees);
transform: rotate(@degrees);
}
.rotateX(@degrees) {
-webkit-transform: rotateX(@degrees);
-ms-transform: rotateX(@degrees); // IE9 only
-o-transform: rotateX(@degrees);
transform: rotateX(@degrees);
}
.rotateY(@degrees) {
-webkit-transform: rotateY(@degrees);
-ms-transform: rotateY(@degrees); // IE9 only
-o-transform: rotateY(@degrees);
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;
}
// Transitions
.transition(@transition) {
-webkit-transition: @transition;
-o-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-timing-function(@timing-function) {
-webkit-transition-timing-function: @timing-function;
transition-timing-function: @timing-function;
}
.transition-transform(@transition) {
-webkit-transition: -webkit-transform @transition;
-moz-transition: -moz-transform @transition;
-o-transition: -o-transform @transition;
transition: transform @transition;
}
// 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;
}

View File

@ -0,0 +1,862 @@
//
// Variables
// --------------------------------------------------
//== Colors
//
//## Gray and brand colors for use across Bootstrap.
@gray-base: #000;
@gray-darker: lighten(@gray-base, 13.5%); // #222
@gray-dark: lighten(@gray-base, 20%); // #333
@gray: lighten(@gray-base, 33.5%); // #555
@gray-light: lighten(@gray-base, 46.7%); // #777
@gray-lighter: lighten(@gray-base, 93.5%); // #eee
@brand-primary: darken(#428bca, 6.5%); // #337ab7
@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%);
//** Link hover decoration.
@link-hover-decoration: underline;
//== 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 location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower.
//** Load fonts from this directory.
@icon-font-path: "../fonts/";
//** File name for all font files.
@icon-font-name: "glyphicons-halflings-regular";
//** Element ID within SVG icon file.
@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.3333333; // extra decimals for Win 8.1 Chrome
@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;
// TODO: Rename `@input-border-radius` to `@input-border-radius-base` in v4
//** Default `.form-control` border radius
// This has no effect on `<select>`s in some browsers, due to the limited stylability of `<select>`s in CSS.
@input-border-radius: @border-radius-base;
//** Large `.form-control` border radius
@input-border-radius-large: @border-radius-large;
//** Small `.form-control` border radius
@input-border-radius-small: @border-radius-small;
//** Border color for inputs on focus
@input-border-focus: #66afe9;
//** Placeholder text color
@input-color-placeholder: #999;
//** 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);
//** `.form-group` margin
@form-group-margin-bottom: 15px;
@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;
//** Disabled cursor for form controls and buttons.
@cursor-disabled: not-allowed;
//== 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;
//** 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: 1060;
@zindex-tooltip: 1070;
@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
//** Deprecated `@screen-xs` as of v3.0.1
@screen-xs: 480px;
//** Deprecated `@screen-xs-min` as of v3.2.0
@screen-xs-min: @screen-xs;
//** Deprecated `@screen-phone` as of v3.0.1
@screen-phone: @screen-xs-min;
// Small screen / tablet
//** Deprecated `@screen-sm` as of v3.0.1
@screen-sm: 768px;
@screen-sm-min: @screen-sm;
//** Deprecated `@screen-tablet` as of v3.0.1
@screen-tablet: @screen-sm-min;
// Medium screen / desktop
//** Deprecated `@screen-md` as of v3.0.1
@screen-md: 992px;
@screen-md-min: @screen-md;
//** Deprecated `@screen-desktop` as of v3.0.1
@screen-desktop: @screen-md-min;
// Large screen / wide desktop
//** Deprecated `@screen-lg` as of v3.0.1
@screen-lg: 1200px;
@screen-lg-min: @screen-lg;
//** Deprecated `@screen-lg-desktop` as of v3.0.1
@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: lighten(@gray-light, 15%);
@navbar-inverse-bg: #222;
@navbar-inverse-border: darken(@navbar-inverse-bg, 10%);
// Inverted navbar links
@navbar-inverse-link-color: lighten(@gray-light, 15%);
@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;
//== 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));
@jumbotron-heading-font-size: ceil((@font-size-base * 4.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: @popover-bg;
//** 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: 15px;
//** 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;
//** Variable for setting rounded corners on progress bar.
@progress-border-radius: @border-radius-base;
//** 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 items on hover
@list-group-hover-bg: #f5f5f5;
//** Text color of active list items
@list-group-active-color: @component-active-color;
//** Background color of active list items
@list-group-active-bg: @component-active-bg;
//** Border color of active list elements
@list-group-active-border: @list-group-active-bg;
//** Text color for content within active list items
@list-group-active-text-color: lighten(@list-group-active-bg, 40%);
//** Text color of disabled list items
@list-group-disabled-color: @gray-light;
//** Background color of disabled list items
@list-group-disabled-bg: @gray-lighter;
//** Text color for content within disabled list items
@list-group-disabled-text-color: @list-group-disabled-color;
@list-group-link-color: #555;
@list-group-link-hover-color: @list-group-link-color;
@list-group-link-heading-color: #333;
//== Panels
//
//##
@panel-bg: #fff;
@panel-body-padding: 15px;
@panel-heading-padding: 10px 15px;
@panel-footer-padding: @panel-heading-padding;
@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
//
//##
//** Horizontal offset for forms and lists.
@component-offset-horizontal: 180px;
//** 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;
//** Width of horizontal description list titles
@dl-horizontal-offset: @component-offset-horizontal;
//** Horizontal line color.
@hr-border: @gray-lighter;

5732
WebRoot/node_modules/bootstrap-switch/yarn.lock generated vendored Normal file

File diff suppressed because it is too large Load Diff