First Initial

This commit is contained in:
Nakorn Rientrakrunchai
2020-02-20 15:02:39 +07:00
commit 8b98125e49
3048 changed files with 760804 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
If you want help us to fix bugs or add a extension please use our develop branch
https://github.com/nostalgiaz/bootstrap-switch/tree/develop
First step:
Please merge your branch develop with nostalgiaz/bootstrap-switch/tree/develop
second step:
Work in the branch develop for fixes
third step:
regularly reviews the branch develop for updates and then merge this with your branch develop
fourth step:
When you're done in your branch send us a PR to merge the two branches

View File

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

View File

@@ -0,0 +1,225 @@
Bootstrap-switch v.1.8
========================
You can now also use radio buttons and checkboxes as switches.
Demo
----
Hurray! http://www.larentis.eu/switch/ moves to github pages and we are happy to tell you that we have bought a new domain: http://www.bootstrap-switch.org . Some troubles can occur so please, don't hate us :')
Usage
-----
Just include Twitter Bootstrap, jQuery, Bootstrap Switch CSS and Javascript
``` html
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8;" />
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css">
<link rel="stylesheet" href="bootstrap-switch.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="bootstrap-switch.js"></script> // master
<script src="http://cdnjs.cloudflare.com/ajax/libs/bootstrap-switch/1.7/bootstrap-switch.min.js"> // from cdnjs.com
```
Less
----
If you want to use your bootstrap vars edit bootstrapSwitch.less and then compile the less file
``` bash
lessc static/less/bootstrap-switch.less static/stylesheets/bootstrap-switch.css
```
Supported browsers
------------------
I'm not going to support ancient browsers! (it works on IE8+)
Basic Example
-------------
checkboxes:
``` html
<div class="make-switch">
<input type="checkbox">
</div>
```
radioboxes:
``` html
<div class="make-switch">
<input type="radio">
</div>
```
Large, small or mini
--------------------
checkboxes:
``` html
<div class="make-switch switch-large"> <!-- switch-large, switch-small or switch-mini -->
<input type="checkbox">
</div>
```
radioboxes:
``` html
<div class="make-switch switch-large"> <!-- switch-large, switch-small or switch-mini -->
<input type="radio">
</div>
```
Colors
------
checkboxes:
``` html
<div class="make-switch" data-on="danger" data-off="warning"> <!-- primary, info, success, warning, danger and default -->
<input type="checkbox">
</div>
```
radioboxes:
``` html
<div class="make-switch" data-on="danger" data-off="warning"> <!-- primary, info, success, warning, danger and default -->
<input type="radio">
</div>
```
Animation
---------
checkboxes:
``` html
<div class="make-switch" data-animated="false">
<input type="checkbox">
</div>
```
radioboxes:
``` html
<div class="make-switch" data-animated="false">
<input type="radio">
</div>
```
Text
-----
checkboxes:
``` html
<div class="make-switch" data-on-label="SI" data-off-label="NO">
<input type="checkbox">
</div>
```
radioboxes:
``` html
<div class="make-switch" data-on-label="SI" data-off-label="NO">
<input type="radio">
</div>
```
Text Label
----------
checkboxes:
``` html
<div class="make-switch" data-text-label="My Slider Text">
<input type="checkbox">
</div>
```
radioboxes:
``` html
<div class="make-switch" data-text-label="My Slider Text">
<input type="radio">
</div>
```
HTML Text
----------
checkboxes:
``` html
<div class="make-switch" data-on-label="<i class='icon-ok icon-white'></i>" data-off-label="<i class='icon-remove'></i>">
<input type="checkbox">
</div>
```
radioboxes:
``` html
<div class="make-switch" data-on-label="<i class='icon-ok icon-white'></i>" data-off-label="<i class='icon-remove'></i>">
<input type="radio">
</div>
```
Initial values
--------------
checkboxes:
``` html
<div class="make-switch">
<input type="checkbox" checked="checked" disabled="disabled">
</div>
```
radioboxes:
``` html
<div class="make-switch">
<input type="radio" checked="checked" disabled="disabled">
</div>
```
Event handler
-------------
``` javascript
$('#mySwitch').on('switch-change', function (e, data) {
var $el = $(data.el)
, value = data.value;
console.log(e, $el, value);
});
```
Methods
-------
``` javascript
$('#mySwitch').bootstrapSwitch('toggleActivation');
$('#mySwitch').bootstrapSwitch('isActive');
$('#mySwitch').bootstrapSwitch('setActive', false);
$('#mySwitch').bootstrapSwitch('setActive', true);
$('#mySwitch').bootstrapSwitch('toggleState');
$('.mySwitch').bootstrapSwitch('toggleRadioState'); // the radiobuttons need a class not a ID, don't allow uncheck radio switch
$('.mySwitch').bootstrapSwitch('toggleRadioStateAllowUncheck'); // don't allow uncheck radio switch
$('.mySwitch').bootstrapSwitch('toggleRadioStateAllowUncheck', false); // don't allow uncheck radio switch
$('.mySwitch').bootstrapSwitch('toggleRadioStateAllowUncheck', true); // allow uncheck radio switch
$('#mySwitch').bootstrapSwitch('setState', true);
$('#mySwitch').bootstrapSwitch('setState', true || false, true); // sets the state without getting the switch-change event
$('#mySwitch').bootstrapSwitch('setOnLabel', onValue); // sets the text of the "on" label
$('#mySwitch').bootstrapSwitch('setOffLabel', offValue); // sets the text of the "off" label
$('#mySwitch').bootstrapSwitch('setOnClass', onClass); // sets the left color class
$('#mySwitch').bootstrapSwitch('setOffClass', offClass); // sets the right color class
$('#mySwitch').bootstrapSwitch('setAnimated', animated); // sets true or false for animation
$('#mySwitch').bootstrapSwitch('setSizeClass', size); // sets 'switch-mini', 'switch-small' or 'switch-large'
$('#mySwitch').bootstrapSwitch('status'); // returns true or false
$('#mySwitch').bootstrapSwitch('destroy');
```
License
-------
Licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0

View File

@@ -0,0 +1,13 @@
{
"name": "bootstrap-switch",
"description" : "Unofficial bootstrap switch",
"version": "1.8.0",
"main": "static/js/bootstrap-switch.js",
"ignore": [
"examples"
],
"dependencies": {
"jquery": "~1.9.0"
}
}

View File

@@ -0,0 +1,15 @@
{
"name" : "bootstrap-switch",
"description" : "Unofficial bootstrap switch",
"version" : "1.8.0",
"main" : "static/js/bootstrap-switch.js",
"ignore": [
"examples"
],
"dependencies": {
"jquery": "~1.9.0"
},
"scripts": [
"static/js/bootstrap-switch.js"
]
}

View File

@@ -0,0 +1,32 @@
{
"name" : "nostalgiaz/bootstrap-switch",
"description" : "Unofficial bootstrap switch",
"type": "component",
"keywords": [
"JavaScript"
],
"homepage": "http://www.larentis.eu/switch/",
"license": "Apache License, Version 2.0",
"authors": [
{
"name": "Mattia Larentis",
"name": "Peter Stein",
"homepage": "http://www.larentis.eu/switch/"
}
],
"require": {
},
"ignore": [
"examples"
],
"extra": {
"component": {
"scripts": [
"static/js/bootstrap-switch.js"
],
"shim": {
"exports": "BootstrapSwitch"
}
}
}
}

View File

@@ -0,0 +1,934 @@
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="utf-8">
<title>Bootstrap switch - by Mattia Larentis and Peter Stein</title>
<meta name="description" content="Switches for radio buttons and checkboxes">
<meta name="author" content="Mattia Larentis">
<meta name="subauthor" content="Peter Stein">
<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8;" />
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" />
<link rel="stylesheet" href="../static/stylesheets/bootstrap-switch.css" />
<link rel="stylesheet" href="http://getbootstrap.com/2.3.2/assets/js/google-code-prettify/prettify.css" />
<link rel="stylesheet" href="http://getbootstrap.com/2.3.2/assets/css/docs.css" />
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css">
<link rel="stylesheet" href="http://bdmdesign.github.io/bootstrap-switch/static/stylesheets/flat-ui-fonts.css">
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.span4, h1, h4 {
text-align: center;
}
h1 {
font-size: 4em;
}
h4 {
font-weight: 200;
}
h1 {
margin-bottom: 20px;
}
h3 {
margin-top: 20px;
}
</style>
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-43092768-1']);
_gaq.push(['_trackPageview']);
(function () {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<a href="https://github.com/nostalgiaz/bootstrap-switch">
<img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png" alt="Fork me on GitHub">
</a>
<div class="container">
<div class="row-fluid">
<div class="span8 offset2">
<h1>Bootstrap switch</h1>
<h4>
by
<a href="http://larentis.eu" target="_blank">Mattia Larentis</a> (<a href="https://twitter.com/spiritualguru">@SpiritualGuru</a>)
and
<a href="http://www.bdmdesign.org/" target="_blank">Peter Stein</a>
</h4>
<br>
</div>
</div>
<div class="row-fluid">
<div class="span8 offset2" style="text-align: center;">
<iframe src="http://ghbtns.com/github-btn.html?user=nostalgiaz&repo=bootstrap-switch&type=watch&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe>
<iframe src="http://ghbtns.com/github-btn.html?user=nostalgiaz&repo=bootstrap-switch&type=fork&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe>
<iframe src="http://ghbtns.com/github-btn.html?user=nostalgiaz&type=follow&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe>
<iframe src="http://ghbtns.com/github-btn.html?user=BdMdesigN&type=follow&count=true"
allowtransparency="true" frameborder="0" scrolling="0" width="170" height="30"></iframe>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="size" class="anchor" href="#size">Size</a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<div class="make-switch switch-large">
<input type="checkbox" checked>
</div>
<div class="make-switch">
<input type="checkbox" checked>
</div>
<div class="make-switch switch-small">
<input type="checkbox" checked>
</div>
<div class="make-switch switch-mini">
<input type="checkbox" checked>
</div>
<br>
<br>
<span>Dimensions can be changed too:</span>
<div id="dimension-switch" class="make-switch">
<input type="checkbox" checked>
</div>
<br />
<br />
<button id="btn-size-large-switch" class="btn">Large</button>
<button id="btn-size-regular-switch" class="btn">Regular</button>
<button id="btn-size-small-switch" class="btn">Small</button>
<button id="btn-size-mini-switch" class="btn">Mini</button>
</div>
<pre class="prettyprint linenums">
&lt;div class="make-switch switch-large">
&lt;input type="checkbox" checked>
&lt;/div>
&lt;div class="make-switch">
&lt;input type="checkbox" checked>
&lt;/div>
&lt;div class="make-switch switch-small">
&lt;input type="checkbox" checked>
&lt;/div>
&lt;div class="make-switch switch-mini">
&lt;input type="checkbox" checked>
&lt;/div>
&lt;div id="dimension-switch" class="make-switch">
&lt;input type="checkbox" checked>
&lt;/div></pre>
<pre class="prettyprint linenums">
// Resets to the regular style
$('#dimension-switch').bootstrapSwitch('setSizeClass', '');
// Sets a mini switch
$('#dimension-switch').bootstrapSwitch('setSizeClass', 'switch-mini');
// Sets a small switch
$('#dimension-switch').bootstrapSwitch('setSizeClass', 'switch-small');
// Sets a large switch
$('#dimension-switch').bootstrapSwitch('setSizeClass', 'switch-large');</pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="colors" class="anchor" href="#colors">Colors</a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<div class="make-switch" data-on="primary" data-off="info">
<input type="checkbox" checked>
</div>
<div class="make-switch" data-on="info" data-off="success">
<input type="checkbox" checked>
</div>
<div class="make-switch" data-on="success" data-off="warning">
<input type="checkbox" checked>
</div>
<div class="make-switch" data-on="warning" data-off="danger">
<input type="checkbox" checked>
</div>
<div class="make-switch" data-on="danger" data-off="default">
<input type="checkbox" checked>
</div>
<div class="make-switch" data-on="default" data-off="primary">
<input type="checkbox" checked>
</div>
<br />
<br />
<span>Colors can be changed too:</span>
<div id="change-color-switch" class="make-switch" data-on="default" data-off="primary">
<input type="checkbox" checked>
</div>
<br />
<br />
<button id="btn-color-on-switch" class="btn btn-success">
Change "On" color
</button>
<button id="btn-color-off-switch" class="btn btn-danger">
Change "Off" color
</button>
</div>
<pre class="prettyprint linenums">
&lt;div class="make-switch" data-on="primary" data-off="info">
&lt;input type="checkbox" checked>
&lt;/div>
&lt;div class="make-switch" data-on="info" data-off="success">
&lt;input type="checkbox" checked>
&lt;/div>
&lt;div class="make-switch" data-on="success" data-off="warning">
&lt;input type="checkbox" checked>
&lt;/div>
&lt;div class="make-switch" data-on="warning" data-off="danger">
&lt;input type="checkbox" checked>
&lt;/div>
&lt;div class="make-switch" data-on="danger" data-off="default">
&lt;input type="checkbox" checked>
&lt;/div>
&lt;div class="make-switch" data-on="default" data-off="primary">
&lt;input type="checkbox" checked>
&lt;/div>
&lt;div id="change-color-switch" class="make-switch" data-on="default" data-off="primary">
&lt;input type="checkbox" checked>
&lt;/div></pre>
<pre class="prettyprint linenums">
$('#change-color-switch').bootstrapSwitch('setOnClass', 'success');
$('#change-color-switch').bootstrapSwitch('setOffClass', 'danger');</pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="animation" class="anchor" href="#animation">Animation <small>javascript</small></a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<div id="animated-switch" class="make-switch" data-animated="false">
<input type="checkbox" checked>
</div>
<br />
<br />
<button id="btn-animate-switch" class="btn">Animate</button>
<button id="btn-dont-animate-switch" class="btn">Don't animate</button>
</div>
<pre class="prettyprint linenums">
&lt;div id="animated-switch" class="make-switch" data-animated="false">
&lt;input type="checkbox" checked>
&lt;/div></pre>
<pre class="prettyprint linenums">
// Enables animation for the selected item
$('#animated-switch').bootstrapSwitch('setAnimated', true);
// Disables animation for the selected item
$('#animated-switch').bootstrapSwitch('setAnimated', false);</pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="disabled" class="anchor" href="#disabled">Disabled</a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<div class="make-switch">
<input type="checkbox" checked disabled>
</div>
</div>
<pre class="prettyprint linenums">
&lt;div class="make-switch">
&lt;input type="checkbox" checked disabled>
&lt;/div></pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="text" class="anchor" href="#text">Text</a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<div id="label-switch" class="make-switch" data-on-label="SI" data-off-label="NO">
<input type="checkbox" checked>
</div>
<br />
<br />
<button id="btn-label-on-switch" class="btn">Change "On" label</button>
<button id="btn-label-off-switch" class="btn">Change "Off" label</button>
</div>
<pre class="prettyprint linenums">
&lt;div id="label-switch" class="make-switch" data-on-label="SI" data-off-label="NO">
&lt;input type="checkbox" checked>
&lt;/div></pre>
<pre class="prettyprint linenums">
$('#label-switch').bootstrapSwitch('setOnLabel', 'I');
$('#label-switch').bootstrapSwitch('setOffLabel', 'O');</pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="label-text" class="anchor" href="#label-text">Label Text</a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<div class="make-switch" data-text-label="TV">
<input type="checkbox" checked>
</div>
</div>
<pre class="prettyprint linenums">
&lt;div class="make-switch" data-text-label="TV">
&lt;input type="checkbox" checked>
&lt;/div></pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="html-text" class="anchor" href="#html-text">HTML text</a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<div class="make-switch" data-on-label="<i class='icon-ok icon-white'></i>" data-off-label="<i class='icon-remove'></i>">
<input type="checkbox" checked>
</div>
</div>
<pre class="prettyprint linenums">
&lt;div class="make-switch" data-on-label="&lt;i class='icon-ok icon-white'>&lt;/i>" data-off-label="&lt;i class='icon-remove'>&lt;/i>">
&lt;input type="checkbox" checked />
&lt;/div></pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="html-text-label-icon" class="anchor" href="#html-text-label-icon">HTML text Label Icon</a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<h5>Standard</h5>
<div class="make-switch switch-large" data-label-icon="icon-fullscreen" data-on-label="<i class='icon-ok icon-white'></i>" data-off-label="<i class='icon-remove'></i>">
<input type="checkbox" checked>
</div>
<h5>Font Awesome</h5>
<div class="make-switch switch-large" data-label-icon="icon-youtube icon-large" data-on-label="<i class='icon-thumbs-up icon-white'></i>" data-off-label="<i class='icon-thumbs-down'></i>">
<input type="checkbox" checked>
</div>
<h5>Flat UI</h5>
<div class="make-switch switch-large" data-label-icon="fui-video" data-on-label="<i class='fui-check icon-white'></i>" data-off-label="<i class='fui-cross'></i>">
<input type="checkbox" checked>
</div>
</div>
<!--<h3>Standard</h3>-->
<pre class="prettyprint linenums">
&lt;div class="make-switch switch-large" data-label-icon="icon-fullscreen" data-on-label="&lt;i class='icon-ok icon-white'>&lt;/i>" data-off-label="&lt;i class='icon-remove'>&lt;/i>">
&lt;input type="checkbox" checked>
&lt;/div>
&lt;div class="make-switch switch-large" data-label-icon="icon-youtube icon-large" data-on-label="&lt;i class='icon-thumbs-up icon-white'>&lt;/i>" data-off-label="&lt;i class='icon-thumbs-down'>&lt;/i>">
&lt;input type="checkbox" checked>
&lt;/div>
&lt;div class="make-switch" data-label-icon="fui-video" data-on-label="&lt;i class='fui-check icon-white'>&lt;/i>" data-off-label="&lt;i class='fui-cross'>&lt;/i>">
&lt;input type="checkbox" checked>
&lt;/div></pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="event-handler-javascript" class="anchor" href="#event-handler-javascript">Event handler <small>javascript</small></a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<div id="mySwitch" class="make-switch">
<input type="checkbox" checked>
</div>
</div>
<pre class="prettyprint linenums">
$('#mySwitch').on('switch-change', function (e, data) {
var $el = $(data.el)
, value = data.value;
console.log(e, $el, value);
});</pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="label-event-handler-javascript" class="anchor" href="#label-event-handler-javascript">Label Event handler <small>javascript</small></a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<h5>Label 1</h5>
<label id="label-toggle-switch">Click on this Text to change the switch state</label>
<div class="label-toggle-switch make-switch">
<input type="checkbox" checked>
</div>
<h5>Label 2</h5>
<div id="label2-toggle-switch">
<label class="label-change-switch">Click on this Text to change the switch state
<div class="label2-toggle-switch make-switch">
<input type="checkbox" checked>
</div>
</label>
</div>
</div>
<pre class="prettyprint linenums">
&lt;label id="label-toggle-switch">Click on this Text to change the switch state&lt;/label>
&lt;div class="label-toggle-switch make-switch">
&lt;input type="checkbox" checked />
&lt;/div>
&lt;script>
$('#label-toggle-switch').on('click', function(e, data) {
$('.label-toggle-switch').bootstrapSwitch('toggleState');
});
$('.label-toggle-switch').on('switch-change', function (e, data) {
alert(data.value);
});
&lt;/script>
&lt;div id="label2-toggle-switch">
&lt;label class="label-change-switch">Click on this Text to change the switch state
&lt;div class="label2-toggle-switch make-switch">
&lt;input type="checkbox" checked />
&lt;/div>
&lt;/label>
&lt;/div>
&lt;script>
$('#label2-toggle-switch').on('switch-change', function(e, data) {
alert(data.value);
});
&lt;/script></pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="toggle-state" class="anchor" href="#toggle-state">Toggle State <small>javascript</small></a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<div id="toggle-state-switch" class="make-switch">
<input type="checkbox" checked>
</div>
<br />
<br />
<div id="toggle-state-switch-button-status" class="btny">Status!</div>
<div id="toggle-state-switch-button-on" class="btn">ON!</div>
<div id="toggle-state-switch-button" class="btn">Toggle me!</div>
<div id="toggle-state-switch-button-off" class="btn">OFF!</div>
</div>
<pre class="prettyprint linenums">
$('#toggle-state-switch').bootstrapSwitch('status'); // true || false
$('#toggle-state-switch').bootstrapSwitch('toggleState');
$('#toggle-state-switch').bootstrapSwitch('setState', false); // true || false</pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="destroy" class="anchor" href="#destroy">Destroy <small>javascript</small></a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<div id="destroy-switch" class="make-switch">
<input type="checkbox" checked>
</div>
<br />
<br />
<button id="btn-destroy-switch" class="btn">Destroy me!</button>
</div>
<pre class="prettyprint linenums">
$('#destroy-switch').bootstrapSwitch('destroy');</pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="create" class="anchor" href="#create">Create <small>javascript</small></a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<input id="create-switch" type="checkbox" checked>
<br />
<br />
<div id="btn-create" class="btn">Create</div>
</div>
<pre class="prettyprint linenums">
$('#create-switch').wrap('&lt;div class="make-switch" />').parent().bootstrapSwitch();</pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="disabled-javascript" class="anchor" href="#disabled-javascript">Disabled <small>javascript</small></a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<label for="disable-switch-input">amazing label</label>
<div id="disable-switch" class="make-switch">
<input id="disable-switch-input" type="checkbox" checked>
</div>
<br />
<br />
<button id="btn-is-active-switch" class="btn">Is active?</button>
<button id="btn-toggle-activation-switch" class="btn">Toggle activation!</button>
<button id="btn-disable-switch" class="btn">Disable!</button>
<button id="btn-activate-switch" class="btn">Activate!</button>
</div>
<pre class="prettyprint linenums">
$('#disable-switch').bootstrapSwitch('isActive');
$('#disable-switch').bootstrapSwitch('toggleActivation');
$('#disable-switch').bootstrapSwitch('setActive', false); // true || false</pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="radio-javascript" class="anchor" href="#radio-javascript">Radio <small>javascript</small></a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<div class="control-group">
<div class="controls">
<label for="option1">Option 1</label>
<div class="make-switch radio1 radio-no-uncheck">
<input id="option1" type="radio" name="radio1" value="option1">
</div>
<label for="option2">Option 2</label>
<div class="make-switch radio1 radio-no-uncheck">
<input id="option2" type="radio" name="radio1" value="option2">
</div>
<label for="option3">Option 3</label>
<div class="make-switch radio1 radio-no-uncheck">
<input id="option3" type="radio" name="radio1" value="option3">
</div>
</div>
</div>
</div>
<pre class="prettyprint linenums">
&lt;div class="control-group">
&lt;div class="controls">
&lt;label for="option1">Option 1&lt;/label>
&lt;div class="make-switch radio1 radio-no-uncheck">
&lt;input id="option1" type="radio" name="radio1" value="option1">
&lt;/div>
&lt;label for="option2">Option 2&lt;/label>
&lt;div class="make-switch radio1 radio-no-uncheck">
&lt;input id="option2" type="radio" name="radio1" value="option2">
&lt;/div>
&lt;label for="option3">Option 3&lt;/label>
&lt;div class="make-switch radio1 radio-no-uncheck">
&lt;input id="option3" type="radio" name="radio1" value="option3">
&lt;/div>
&lt;/div>
&lt;/div>
&lt;script>
$('.radio1').on('switch-change', function () {
$('.radio1').bootstrapSwitch('toggleRadioState');
});
// or
$('.radio1').on('switch-change', function () {
$('.radio1').bootstrapSwitch('toggleRadioStateAllowUncheck');
});
// or
$('.radio1').on('switch-change', function () {
$('.radio1').bootstrapSwitch('toggleRadioStateAllowUncheck', false);
});
&lt;/script></pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="radio-javascript-allow-uncheck" class="anchor" href="#radio-javascript-allow-uncheck">Radio <small>javascript (allow radios uncheck)</small></a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<div class="control-group">
<div class="controls">
<label for="option11">Option 1</label>
<div class="make-switch radio2">
<input id="option11" type="radio" name="radio2" value="option11">
</div>
<label for="option12">Option 2</label>
<div class="make-switch radio2">
<input id="option12" type="radio" name="radio2" value="option12" checked="checked">
</div>
<label for="option13">Option 3</label>
<div class="make-switch radio2">
<input id="option13" type="radio" name="radio2" value="option13">
</div>
</div>
</div>
</div>
<pre class="prettyprint linenums">
&lt;div class="control-group">
&lt;div class="controls">
&lt;label for="option11">Option 1&lt;/label>
&lt;div class="make-switch radio2">
&lt;input id="option11" type="radio" name="radio2" value="option1">
&lt;/div>
&lt;label for="option12">Option 2&lt;/label>
&lt;div class="make-switch radio2">
&lt;input id="option12" type="radio" name="radio2" value="option2" checked="checked">
&lt;/div>
&lt;label for="option13">Option 3&lt;/label>
&lt;div class="make-switch radio2">
&lt;input id="option13" type="radio" name="radio2" value="option3">
&lt;/div>
&lt;/div>
&lt;/div>
&lt;script>
$('.radio2').on('switch-change', function () {
$('.radio2').bootstrapSwitch('toggleRadioStateAllowUncheck', true);
});
&lt;/script></pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="form" class="anchor" href="#form">Form <small>- try to use tab, space and reset button</small></a>
</h2>
</div>
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<form class="form-horizontal span8 offset2">
<div class="control-group">
<label class="control-label" for="inputEmail">Email</label>
<div class="controls">
<input type="text" id="inputEmail" placeholder="Email">
</div>
</div>
<div class="control-group">
<label class="control-label" for="notification1">Notification 1</label>
<div class="controls">
<div class="make-switch" tabindex="0">
<input id="notification1" type="checkbox">
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="notification2">Notification 2</label>
<div class="controls">
<div class="make-switch" tabindex="0">
<input id="notification2" type="checkbox">
</div>
</div>
</div>
<div class="form-actions">
<button type="reset" class="btn btn-inverse">Reset</button>
</div>
</form>
<div class="clearfix"></div>
</div>
<pre class="prettyprint linenums">
&lt;form class="form-horizontal">
&lt;div class="control-group">
&lt;label class="control-label" for="inputEmail">Email&lt;/label>
&lt;div class="controls">
&lt;input type="text" id="inputEmail" placeholder="Email">
&lt;/div>
&lt;/div>
&lt;div class="control-group">
&lt;label class="control-label" for="notification1">Notification 1&lt;/label>
&lt;div class="controls">
&lt;div class="make-switch" tabindex="0">
&lt;input id="notification1" type="checkbox">
&lt;/div>
&lt;/div>
&lt;/div>
&lt;div class="control-group">
&lt;label class="control-label" for="notification2">Notification 2&lt;/label>
&lt;div class="controls">
&lt;div class="make-switch" tabindex="0">
&lt;input id="notification2" type="checkbox">
&lt;/div>
&lt;/div>
&lt;/div>
&lt;div class="form-actions">
&lt;button type="reset" class="btn btn-inverse">Reset&lt;/button>
&lt;/div>
&lt;/form></pre>
</div>
</div>
<div class="row-fluid">
<h2 class="span8 offset2">
<a name="modal" class="anchor" href="#modal">Modal</a>
</h2>
</div>
<!-- MODAL -->
<div class="row-fluid">
<div class="span8 offset2">
<div class="bs-docs-example">
<a href="#myModal" role="button" class="btn" data-toggle="modal">Modal</a>
</div>
<pre class="prettyprint linenums">
&lt;a href="#myModal" role="button" class="btn" data-toggle="modal">Modal&lt;/a>
&lt;div class="modal-body">
&lt;div class="make-switch">
&lt;input type="checkbox" checked>
&lt;/div>
&lt;/div></pre>
</div>
</div>
</div>
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3>Modal</h3>
</div>
<div class="modal-body">
<div class="make-switch">
<input type="checkbox" checked>
</div>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$(document).ready(function() {
window.prettyPrint && prettyPrint();
$('#mySwitch').on('switch-change', function (e, data) {
var $el = $(data.el)
, value = data.value;
console.log(e, $el, value);
});
// DIMENSION
$('#btn-size-regular-switch').on('click', function () {
$('#dimension-switch').bootstrapSwitch('setSizeClass', '');
});
$('#btn-size-mini-switch').on('click', function () {
$('#dimension-switch').bootstrapSwitch('setSizeClass', 'switch-mini');
});
$('#btn-size-small-switch').on('click', function () {
$('#dimension-switch').bootstrapSwitch('setSizeClass', 'switch-small');
});
$('#btn-size-large-switch').on('click', function () {
$('#dimension-switch').bootstrapSwitch('setSizeClass', 'switch-large');
});
// STATE
$('#toggle-state-switch-button').on('click', function () {
$('#toggle-state-switch').bootstrapSwitch('toggleState');
});
$('#toggle-state-switch-button-on').on('click', function () {
$('#toggle-state-switch').bootstrapSwitch('setState', true);
});
$('#toggle-state-switch-button-off').on('click', function () {
$('#toggle-state-switch').bootstrapSwitch('setState', false);
});
$('#toggle-state-switch-button-status').on('click', function () {
alert($('#toggle-state-switch').bootstrapSwitch('status'));
});
// DESTROY
$('#btn-destroy-switch').on('click', function () {
$('#destroy-switch').bootstrapSwitch('destroy');
$(this).remove();
});
// CREATE
$('#btn-create').on('click', function () {
$('#create-switch').wrap('<div class="make-switch" />').parent().bootstrapSwitch();
$(this).remove()
});
// ACTIVATION
$('#btn-is-active-switch').on('click', function () {
alert($('#disable-switch').bootstrapSwitch('isActive'));
});
$('#btn-toggle-activation-switch').on('click', function () {
$('#disable-switch').bootstrapSwitch('toggleActivation');
});
$('#btn-disable-switch').on('click', function () {
$('#disable-switch').bootstrapSwitch('setActive', false);
});
$('#btn-activate-switch').on('click', function () {
$('#disable-switch').bootstrapSwitch('setActive', true);
});
// LABEL
$('#btn-label-on-switch').on('click', function() {
$('#label-switch').bootstrapSwitch('setOnLabel', 'I');
});
$('#btn-label-off-switch').on('click', function() {
$('#label-switch').bootstrapSwitch('setOffLabel', 'O');
});
$('#label-toggle-switch').on('click', function(e, data) {
$('.label-toggle-switch').bootstrapSwitch('toggleState');
});
$('.label-toggle-switch').on('switch-change', function(e, data) {
alert(data.value);
});
$('#label2-toggle-switch').on('switch-change', function(e, data) {
alert(data.value);
});
// COLOR
$('#btn-color-on-switch').on('click', function() {
$('#change-color-switch').bootstrapSwitch('setOnClass', 'success');
});
$('#btn-color-off-switch').on('click', function() {
$('#change-color-switch').bootstrapSwitch('setOffClass', 'danger');
});
// ANIMATION
$('#btn-animate-switch').on('click', function() {
$('#animated-switch').bootstrapSwitch('setAnimated', true);
});
$('#btn-dont-animate-switch').on('click', function() {
$('#animated-switch').bootstrapSwitch('setAnimated', false);
});
// RADIO
$('.radio1').on('switch-change', function () {
$('.radio1').bootstrapSwitch('toggleRadioState');
});
$('.radio2').on('switch-change', function () {
$('.radio2').bootstrapSwitch('toggleRadioStateAllowUncheck', true);
});
});
</script>
<footer>
<div class="container-fluid">
<p style="float:left; padding-top: 5px;">
&copy; by
<a href="http://larentis.eu" target="_blank">Mattia Larentis</a> (<a href="https://twitter.com/SpiritualGuru">@SpiritualGuru</a>)
and
<a href="http://www.bdmdesign.org/" target="_blank">Peter Stein</a>
</p>
</div>
</footer>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="http://getbootstrap.com/2.3.2/assets/js/google-code-prettify/prettify.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script src="../static/js/bootstrap-switch.js"></script>
</body>
</html>

View File

@@ -0,0 +1,382 @@
/*! ============================================================
* bootstrapSwitch v1.8 by Larentis Mattia @SpiritualGuru
* http://www.larentis.eu/
*
* Enhanced for radiobuttons by Stein, Peter @BdMdesigN
* http://www.bdmdesign.org/
*
* Project site:
* http://www.larentis.eu/switch/
* ============================================================
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
* ============================================================ */
!function ($) {
"use strict";
$.fn['bootstrapSwitch'] = function (method) {
var inputSelector = 'input[type!="hidden"]';
var methods = {
init: function () {
return this.each(function () {
var $element = $(this)
, $div
, $switchLeft
, $switchRight
, $label
, $form = $element.closest('form')
, myClasses = ""
, classes = $element.attr('class')
, color
, moving
, onLabel = "ON"
, offLabel = "OFF"
, icon = false
, textLabel = false;
$.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) {
if (classes.indexOf(el) >= 0)
myClasses = el;
});
$element.addClass('has-switch');
if ($element.data('on') !== undefined)
color = "switch-" + $element.data('on');
if ($element.data('on-label') !== undefined)
onLabel = $element.data('on-label');
if ($element.data('off-label') !== undefined)
offLabel = $element.data('off-label');
if ($element.data('label-icon') !== undefined)
icon = $element.data('label-icon');
if ($element.data('text-label') !== undefined)
textLabel = $element.data('text-label');
$switchLeft = $('<span>')
.addClass("switch-left")
.addClass(myClasses)
.addClass(color)
.html(onLabel);
color = '';
if ($element.data('off') !== undefined)
color = "switch-" + $element.data('off');
$switchRight = $('<span>')
.addClass("switch-right")
.addClass(myClasses)
.addClass(color)
.html(offLabel);
$label = $('<label>')
.html("&nbsp;")
.addClass(myClasses)
.attr('for', $element.find(inputSelector).attr('id'));
if (icon) {
$label.html('<i class="icon ' + icon + '"></i>');
}
if (textLabel) {
$label.html('' + textLabel + '');
}
$div = $element.find(inputSelector).wrap($('<div>')).parent().data('animated', false);
if ($element.data('animated') !== false)
$div.addClass('switch-animate').data('animated', true);
$div
.append($switchLeft)
.append($label)
.append($switchRight);
$element.find('>div').addClass(
$element.find(inputSelector).is(':checked') ? 'switch-on' : 'switch-off'
);
if ($element.find(inputSelector).is(':disabled'))
$(this).addClass('deactivate');
var changeStatus = function ($this) {
if ($element.parent('label').is('.label-change-switch')) {
} else {
$this.siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
}
};
$element.on('keydown', function (e) {
if (e.keyCode === 32) {
e.stopImmediatePropagation();
e.preventDefault();
changeStatus($(e.target).find('span:first'));
}
});
$switchLeft.on('click', function (e) {
changeStatus($(this));
});
$switchRight.on('click', function (e) {
changeStatus($(this));
});
$element.find(inputSelector).on('change', function (e, skipOnChange) {
var $this = $(this)
, $element = $this.parent()
, thisState = $this.is(':checked')
, state = $element.is('.switch-off');
e.preventDefault();
$element.css('left', '');
if (state === thisState) {
if (thisState)
$element.removeClass('switch-off').addClass('switch-on');
else $element.removeClass('switch-on').addClass('switch-off');
if ($element.data('animated') !== false)
$element.addClass("switch-animate");
if (typeof skipOnChange === 'boolean' && skipOnChange)
return;
$element.parent().trigger('switch-change', {'el': $this, 'value': thisState})
}
});
$element.find('label').on('mousedown touchstart', function (e) {
var $this = $(this);
moving = false;
e.preventDefault();
e.stopImmediatePropagation();
$this.closest('div').removeClass('switch-animate');
if ($this.closest('.has-switch').is('.deactivate')) {
$this.unbind('click');
} else if ($this.closest('.switch-on').parent().is('.radio-no-uncheck')) {
$this.unbind('click');
} else {
$this.on('mousemove touchmove', function (e) {
var $element = $(this).closest('.make-switch')
, relativeX = (e.pageX || e.originalEvent.targetTouches[0].pageX) - $element.offset().left
, percent = (relativeX / $element.width()) * 100
, left = 25
, right = 75;
moving = true;
if (percent < left)
percent = left;
else if (percent > right)
percent = right;
$element.find('>div').css('left', (percent - right) + "%")
});
$this.on('click touchend', function (e) {
var $this = $(this)
, $myInputBox = $this.siblings('input');
e.stopImmediatePropagation();
e.preventDefault();
$this.unbind('mouseleave');
if (moving)
$myInputBox.prop('checked', !(parseInt($this.parent().css('left')) < -25));
else
$myInputBox.prop("checked", !$myInputBox.is(":checked"));
moving = false;
$myInputBox.trigger('change');
});
$this.on('mouseleave', function (e) {
var $this = $(this)
, $myInputBox = $this.siblings('input');
e.preventDefault();
e.stopImmediatePropagation();
$this.unbind('mouseleave mousemove');
$this.trigger('mouseup');
$myInputBox.prop('checked', !(parseInt($this.parent().css('left')) < -25)).trigger('change');
});
$this.on('mouseup', function (e) {
e.stopImmediatePropagation();
e.preventDefault();
$(this).trigger('mouseleave');
});
}
});
if ($form.data('bootstrapSwitch') !== 'injected') {
$form.bind('reset', function () {
setTimeout(function () {
$form.find('.make-switch').each(function () {
var $input = $(this).find(inputSelector);
$input.prop('checked', $input.is(':checked')).trigger('change');
});
}, 1);
});
$form.data('bootstrapSwitch', 'injected');
}
}
);
},
toggleActivation: function () {
var $this = $(this);
$this.toggleClass('deactivate');
$this.find(inputSelector).prop('disabled', $this.is('.deactivate'));
},
isActive: function () {
return !$(this).hasClass('deactivate');
},
setActive: function (active) {
var $this = $(this);
if (active) {
$this.removeClass('deactivate');
$this.find(inputSelector).removeAttr('disabled');
}
else {
$this.addClass('deactivate');
$this.find(inputSelector).attr('disabled', 'disabled');
}
},
toggleState: function (skipOnChange) {
var $input = $(this).find(':checkbox');
$input.prop('checked', !$input.is(':checked')).trigger('change', skipOnChange);
},
toggleRadioState: function (skipOnChange) {
var $radioinput = $(this).find(':radio');
$radioinput.not(':checked').prop('checked', !$radioinput.is(':checked')).trigger('change', skipOnChange);
},
toggleRadioStateAllowUncheck: function (uncheck, skipOnChange) {
var $radioinput = $(this).find(':radio');
if (uncheck) {
$radioinput.not(':checked').trigger('change', skipOnChange);
}
else {
$radioinput.not(':checked').prop('checked', !$radioinput.is(':checked')).trigger('change', skipOnChange);
}
},
setState: function (value, skipOnChange) {
$(this).find(inputSelector).prop('checked', value).trigger('change', skipOnChange);
},
setOnLabel: function (value) {
var $switchLeft = $(this).find(".switch-left");
$switchLeft.html(value);
},
setOffLabel: function (value) {
var $switchRight = $(this).find(".switch-right");
$switchRight.html(value);
},
setOnClass: function (value) {
var $switchLeft = $(this).find(".switch-left");
var color = '';
if (value !== undefined) {
if ($(this).attr('data-on') !== undefined) {
color = "switch-" + $(this).attr('data-on')
}
$switchLeft.removeClass(color);
color = "switch-" + value;
$switchLeft.addClass(color);
}
},
setOffClass: function (value) {
var $switchRight = $(this).find(".switch-right");
var color = '';
if (value !== undefined) {
if ($(this).attr('data-off') !== undefined) {
color = "switch-" + $(this).attr('data-off')
}
$switchRight.removeClass(color);
color = "switch-" + value;
$switchRight.addClass(color);
}
},
setAnimated: function (value) {
var $element = $(this).find(inputSelector).parent();
if (value === undefined) value = false;
$element.data('animated', value);
$element.attr('data-animated', value);
if ($element.data('animated') !== false) {
$element.addClass("switch-animate");
} else {
$element.removeClass("switch-animate");
}
},
setSizeClass: function (value) {
var $element = $(this);
var $switchLeft = $element.find(".switch-left");
var $switchRight = $element.find(".switch-right");
var $label = $element.find("label");
$.each(['switch-mini', 'switch-small', 'switch-large'], function (i, el) {
if (el !== value) {
$switchLeft.removeClass(el);
$switchRight.removeClass(el);
$label.removeClass(el);
} else {
$switchLeft.addClass(el);
$switchRight.addClass(el);
$label.addClass(el);
}
});
},
status: function () {
return $(this).find(inputSelector).is(':checked');
},
destroy: function () {
var $element = $(this)
, $div = $element.find('div')
, $form = $element.closest('form')
, $inputbox;
$div.find(':not(input)').remove();
$inputbox = $div.children();
$inputbox.unwrap().unwrap();
$inputbox.unbind('change');
if ($form) {
$form.unbind('reset');
$form.removeData('bootstrapSwitch');
}
return $inputbox;
}
};
if (methods[method])
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
else if (typeof method === 'object' || !method)
return methods.init.apply(this, arguments);
else
$.error('Method ' + method + ' does not exist!');
};
}(jQuery);
(function ($) {
$(function () {
$('.make-switch')['bootstrapSwitch']();
});
})(jQuery);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,400 @@
/* ============================================================
* bootstrapSwitch v1.8 by Larentis Mattia @SpiritualGuru
* http://www.larentis.eu/
*
* Enhanced for radiobuttons by Stein, Peter @BdMdesigN
* http://www.bdmdesign.org/
*
* Project site:
* http://www.larentis.eu/switch/
* ============================================================
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
* ============================================================ */
.has-switch {
display: inline-block;
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;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
vertical-align: middle;
min-width: 100px;
}
.has-switch.switch-mini {
min-width: 72px;
}
.has-switch.switch-mini i.switch-mini-icons {
height: 1.20em;
line-height: 9px;
vertical-align: text-top;
text-align: center;
transform: scale(0.6);
margin-top: -1px;
margin-bottom: -1px;
}
.has-switch.switch-small {
min-width: 80px;
}
.has-switch.switch-large {
min-width: 120px;
}
.has-switch.deactivate {
opacity: 0.5;
filter: alpha(opacity=50);
cursor: default !important;
}
.has-switch.deactivate label,
.has-switch.deactivate span {
cursor: default !important;
}
.has-switch > div {
display: inline-block;
width: 150%;
position: relative;
top: 0;
}
.has-switch > div.switch-animate {
-webkit-transition: left 0.5s;
-moz-transition: left 0.5s;
-o-transition: left 0.5s;
transition: left 0.5s;
}
.has-switch > div.switch-off {
left: -50%;
}
.has-switch > div.switch-on {
left: 0%;
}
.has-switch input[type=radio],
.has-switch input[type=checkbox] {
display: none;
}
.has-switch span,
.has-switch label {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
cursor: pointer;
position: relative;
display: inline-block;
height: 100%;
padding-bottom: 4px;
padding-top: 4px;
font-size: 14px;
line-height: 20px;
}
.has-switch span.switch-mini,
.has-switch label.switch-mini {
padding-bottom: 4px;
padding-top: 4px;
font-size: 10px;
line-height: 9px;
}
.has-switch span.switch-small,
.has-switch label.switch-small {
padding-bottom: 3px;
padding-top: 3px;
font-size: 12px;
line-height: 18px;
}
.has-switch span.switch-large,
.has-switch label.switch-large {
padding-bottom: 9px;
padding-top: 9px;
font-size: 16px;
line-height: normal;
}
.has-switch label {
text-align: center;
margin-top: -1px;
margin-bottom: -1px;
z-index: 100;
width: 34%;
border-left: 1px solid #cccccc;
border-right: 1px solid #cccccc;
color: #333333;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #e6e6e6;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch label:hover,
.has-switch label:focus,
.has-switch label:active,
.has-switch label.active,
.has-switch label.disabled,
.has-switch label[disabled] {
color: #333333;
background-color: #e6e6e6;
*background-color: #d9d9d9;
}
.has-switch label:active,
.has-switch label.active {
background-color: #cccccc \9;
}
.has-switch label i {
color: #000;
text-shadow: 0 1px 0 #fff;
line-height: 18px;
pointer-events: none;
}
.has-switch span {
text-align: center;
z-index: 1;
width: 33%;
}
.has-switch span.switch-left {
-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;
}
.has-switch span.switch-right {
color: #333333;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
background-color: #f0f0f0;
background-image: -moz-linear-gradient(top, #e6e6e6, #ffffff);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#ffffff));
background-image: -webkit-linear-gradient(top, #e6e6e6, #ffffff);
background-image: -o-linear-gradient(top, #e6e6e6, #ffffff);
background-image: linear-gradient(to bottom, #e6e6e6, #ffffff);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0);
border-color: #ffffff #ffffff #d9d9d9;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #ffffff;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-right:hover,
.has-switch span.switch-right:focus,
.has-switch span.switch-right:active,
.has-switch span.switch-right.active,
.has-switch span.switch-right.disabled,
.has-switch span.switch-right[disabled] {
color: #333333;
background-color: #ffffff;
*background-color: #f2f2f2;
}
.has-switch span.switch-right:active,
.has-switch span.switch-right.active {
background-color: #e6e6e6 \9;
}
.has-switch span.switch-primary,
.has-switch span.switch-left {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #005fcc;
background-image: -moz-linear-gradient(top, #0044cc, #0088cc);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0044cc), to(#0088cc));
background-image: -webkit-linear-gradient(top, #0044cc, #0088cc);
background-image: -o-linear-gradient(top, #0044cc, #0088cc);
background-image: linear-gradient(to bottom, #0044cc, #0088cc);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0044cc', endColorstr='#ff0088cc', GradientType=0);
border-color: #0088cc #0088cc #005580;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #0088cc;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-primary:hover,
.has-switch span.switch-left:hover,
.has-switch span.switch-primary:focus,
.has-switch span.switch-left:focus,
.has-switch span.switch-primary:active,
.has-switch span.switch-left:active,
.has-switch span.switch-primary.active,
.has-switch span.switch-left.active,
.has-switch span.switch-primary.disabled,
.has-switch span.switch-left.disabled,
.has-switch span.switch-primary[disabled],
.has-switch span.switch-left[disabled] {
color: #ffffff;
background-color: #0088cc;
*background-color: #0077b3;
}
.has-switch span.switch-primary:active,
.has-switch span.switch-left:active,
.has-switch span.switch-primary.active,
.has-switch span.switch-left.active {
background-color: #006699 \9;
}
.has-switch span.switch-info {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #41a7c5;
background-image: -moz-linear-gradient(top, #2f96b4, #5bc0de);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#2f96b4), to(#5bc0de));
background-image: -webkit-linear-gradient(top, #2f96b4, #5bc0de);
background-image: -o-linear-gradient(top, #2f96b4, #5bc0de);
background-image: linear-gradient(to bottom, #2f96b4, #5bc0de);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff2f96b4', endColorstr='#ff5bc0de', GradientType=0);
border-color: #5bc0de #5bc0de #28a1c5;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #5bc0de;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-info:hover,
.has-switch span.switch-info:focus,
.has-switch span.switch-info:active,
.has-switch span.switch-info.active,
.has-switch span.switch-info.disabled,
.has-switch span.switch-info[disabled] {
color: #ffffff;
background-color: #5bc0de;
*background-color: #46b8da;
}
.has-switch span.switch-info:active,
.has-switch span.switch-info.active {
background-color: #31b0d5 \9;
}
.has-switch span.switch-success {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #58b058;
background-image: -moz-linear-gradient(top, #51a351, #62c462);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#51a351), to(#62c462));
background-image: -webkit-linear-gradient(top, #51a351, #62c462);
background-image: -o-linear-gradient(top, #51a351, #62c462);
background-image: linear-gradient(to bottom, #51a351, #62c462);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff51a351', endColorstr='#ff62c462', GradientType=0);
border-color: #62c462 #62c462 #3b9e3b;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #62c462;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-success:hover,
.has-switch span.switch-success:focus,
.has-switch span.switch-success:active,
.has-switch span.switch-success.active,
.has-switch span.switch-success.disabled,
.has-switch span.switch-success[disabled] {
color: #ffffff;
background-color: #62c462;
*background-color: #4fbd4f;
}
.has-switch span.switch-success:active,
.has-switch span.switch-success.active {
background-color: #42b142 \9;
}
.has-switch span.switch-warning {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #f9a123;
background-image: -moz-linear-gradient(top, #f89406, #fbb450);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f89406), to(#fbb450));
background-image: -webkit-linear-gradient(top, #f89406, #fbb450);
background-image: -o-linear-gradient(top, #f89406, #fbb450);
background-image: linear-gradient(to bottom, #f89406, #fbb450);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff89406', endColorstr='#fffbb450', GradientType=0);
border-color: #fbb450 #fbb450 #f89406;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #fbb450;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-warning:hover,
.has-switch span.switch-warning:focus,
.has-switch span.switch-warning:active,
.has-switch span.switch-warning.active,
.has-switch span.switch-warning.disabled,
.has-switch span.switch-warning[disabled] {
color: #ffffff;
background-color: #fbb450;
*background-color: #faa937;
}
.has-switch span.switch-warning:active,
.has-switch span.switch-warning.active {
background-color: #fa9f1e \9;
}
.has-switch span.switch-danger {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #d14641;
background-image: -moz-linear-gradient(top, #bd362f, #ee5f5b);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#bd362f), to(#ee5f5b));
background-image: -webkit-linear-gradient(top, #bd362f, #ee5f5b);
background-image: -o-linear-gradient(top, #bd362f, #ee5f5b);
background-image: linear-gradient(to bottom, #bd362f, #ee5f5b);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffbd362f', endColorstr='#ffee5f5b', GradientType=0);
border-color: #ee5f5b #ee5f5b #e51d18;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #ee5f5b;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-danger:hover,
.has-switch span.switch-danger:focus,
.has-switch span.switch-danger:active,
.has-switch span.switch-danger.active,
.has-switch span.switch-danger.disabled,
.has-switch span.switch-danger[disabled] {
color: #ffffff;
background-color: #ee5f5b;
*background-color: #ec4844;
}
.has-switch span.switch-danger:active,
.has-switch span.switch-danger.active {
background-color: #e9322d \9;
}
.has-switch span.switch-default {
color: #333333;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
background-color: #f0f0f0;
background-image: -moz-linear-gradient(top, #e6e6e6, #ffffff);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#ffffff));
background-image: -webkit-linear-gradient(top, #e6e6e6, #ffffff);
background-image: -o-linear-gradient(top, #e6e6e6, #ffffff);
background-image: linear-gradient(to bottom, #e6e6e6, #ffffff);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0);
border-color: #ffffff #ffffff #d9d9d9;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #ffffff;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-default:hover,
.has-switch span.switch-default:focus,
.has-switch span.switch-default:active,
.has-switch span.switch-default.active,
.has-switch span.switch-default.disabled,
.has-switch span.switch-default[disabled] {
color: #333333;
background-color: #ffffff;
*background-color: #f2f2f2;
}
.has-switch span.switch-default:active,
.has-switch span.switch-default.active {
background-color: #e6e6e6 \9;
}

View File

@@ -0,0 +1,176 @@
/* ============================================================
* bootstrapSwitch v1.8 by Larentis Mattia @SpiritualGuru
* http://www.larentis.eu/
*
* Enhanced for radiobuttons by Stein, Peter @BdMdesigN
* http://www.bdmdesign.org/
*
* Project site:
* http://www.larentis.eu/switch/
* ============================================================
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
* ============================================================ */
@import "deps/variables";
@import "deps/mixins";
.has-switch {
display: inline-block;
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;
.user-select(none);
vertical-align: middle;
min-width: 100px;
&.switch-mini {
min-width: 72px;
}
&.switch-mini i.switch-mini-icons {
height: 1.20em;
line-height: 9px;
vertical-align: text-top;
text-align: center;
transform: scale(0.6);
margin-top: -1px;
margin-bottom: -1px;
}
&.switch-small {
min-width: 80px;
}
&.switch-large {
min-width: 120px;
}
&.deactivate {
.opacity(50);
cursor: default !important;
label, span {
cursor: default !important;
}
}
> div {
display: inline-block;
width: 150%;
position: relative;
top: 0;
&.switch-animate {
.transition(left 0.5s);
}
&.switch-off {
left: -50%;
}
&.switch-on {
left: 0%;
}
}
input[type=radio],
input[type=checkbox] {
//debug
display: none;
//position: absolute;
//margin-left: 60%;
//z-index: 123;
}
span, label {
.box-sizing(border-box);
cursor: pointer;
position: relative;
display: inline-block;
height: 100%;
padding-bottom: 4px;
padding-top: 4px;
font-size: 14px;
line-height: 20px;
&.switch-mini {
padding-bottom: 4px;
padding-top: 4px;
font-size: 10px;
line-height: 9px;
}
&.switch-small {
padding-bottom: 3px;
padding-top: 3px;
font-size: 12px;
line-height: 18px;
}
&.switch-large {
padding-bottom: 9px;
padding-top: 9px;
font-size: 16px;
line-height: normal;
}
}
label {
text-align: center;
margin-top: -1px;
margin-bottom: -1px;
z-index: 100;
width: 34%;
border-left: 1px solid @btnBorder;
border-right: 1px solid @btnBorder;
.buttonBackground(@btnBackground, @btnBackgroundHighlight, @grayDark);
i {
color: #000;
text-shadow: 0 1px 0 #fff;
line-height: 18px;
pointer-events: none;
}
}
span {
text-align: center;
z-index: 1;
width: 33%;
&.switch-left {
.border-left-radius(4px);
}
&.switch-right {
.buttonBackground(@btnBackgroundHighlight, @btnBackground, @grayDark, 0 1px 1px rgba(255,255,255,.75));
}
&.switch-primary, &.switch-left {
.buttonBackground(@btnPrimaryBackgroundHighlight, @btnPrimaryBackground);
}
&.switch-info {
.buttonBackground(@btnInfoBackgroundHighlight, @btnInfoBackground);
}
&.switch-success {
.buttonBackground(@btnSuccessBackgroundHighlight, @btnSuccessBackground);
}
&.switch-warning {
.buttonBackground(@btnWarningBackgroundHighlight, @btnWarningBackground);
}
&.switch-danger {
.buttonBackground(@btnDangerBackgroundHighlight, @btnDangerBackground);
}
&.switch-default {
.buttonBackground(@btnBackgroundHighlight, @btnBackground, @grayDark, 0 1px 1px rgba(255,255,255,.75));
}
}
}

View File

@@ -0,0 +1,97 @@
.border-radius(@radius) {
-webkit-border-radius: @radius;
-moz-border-radius: @radius;
border-radius: @radius;
}
.border-top-left-radius(@radius) {
-webkit-border-top-left-radius: @radius;
-moz-border-radius-topleft: @radius;
border-top-left-radius: @radius;
}
.border-bottom-left-radius(@radius) {
-webkit-border-bottom-left-radius: @radius;
-moz-border-radius-bottomleft: @radius;
border-bottom-left-radius: @radius;
}
.border-left-radius(@radius) {
.border-top-left-radius(@radius);
.border-bottom-left-radius(@radius);
}
// Transitions
.transition(@transition) {
-webkit-transition: @transition;
-moz-transition: @transition;
-o-transition: @transition;
transition: @transition;
}
// 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;
}
// Opacity
.opacity(@opacity) {
opacity: @opacity / 100;
filter: ~"alpha(opacity=@{opacity})";
}
// 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 {
.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
}
}
.reset-filter() {
filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
}
.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");
}
}

View File

@@ -0,0 +1,32 @@
@grayDarker: #222;
@grayDark: #333;
@white: #fff;
@orange: #f89406;
@bodyBackground: @white;
@textColor: @grayDark;
@linkColor: #08c;
@linkColorHover: darken(@linkColor, 15%);
@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;

View File

@@ -0,0 +1,288 @@
/* ============================================================
* bootstrapSwitch v1.8 by Larentis Mattia @SpiritualGuru
* http://www.larentis.eu/
*
* Enhanced for radiobuttons by Stein, Peter @BdMdesigN
* http://www.bdmdesign.org/
*
* Project site:
* http://www.larentis.eu/switch/
* ============================================================
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
* ============================================================ */
.has-switch {
padding: 0;
display: inline-block;
cursor: pointer;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border: 1px solid;
border-color: #e3e3e3;
position: relative;
text-align: left;
overflow: hidden;
line-height: 8px;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
vertical-align: middle;
min-width: 100px;
}
.has-switch.switch-mini {
min-width: 72px;
}
.has-switch.switch-mini i.switch-mini-icons {
height: 1.20em;
line-height: 9px;
vertical-align: text-top;
text-align: center;
transform: scale(0.6);
margin-top: -1px;
margin-bottom: -1px;
}
.has-switch.switch-small {
min-width: 80px;
}
.has-switch.switch-large {
min-width: 120px;
}
.has-switch.deactivate {
opacity: 0.5;
filter: alpha(opacity=50);
cursor: default !important;
}
.has-switch.deactivate label,
.has-switch.deactivate span {
cursor: default !important;
}
.has-switch > div {
display: inline-block;
width: 150%;
position: relative;
top: 0;
}
.has-switch > div.switch-animate {
-webkit-transition: left 0.5s;
-moz-transition: left 0.5s;
-o-transition: left 0.5s;
transition: left 0.5s;
}
.has-switch > div.switch-off {
left: -50%;
margin-left: 1px !important; /* parent container with float:left issue fix*/
}
.has-switch > div.switch-on {
left: 0%;
}
.has-switch input[type=radio],
.has-switch input[type=checkbox] {
display: none;
}
.has-switch span,
.has-switch label {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
cursor: pointer;
position: relative;
display: inline-block;
height: 100%;
padding-bottom: 4px;
padding-top: 4px;
font-size: 14px;
line-height: 20px;
}
.has-switch span.switch-mini,
.has-switch label.switch-mini {
padding-bottom: 4px;
padding-top: 4px;
font-size: 10px;
line-height: 9px;
}
.has-switch span.switch-small,
.has-switch label.switch-small {
padding-bottom: 3px;
padding-top: 3px;
font-size: 12px;
line-height: 18px;
}
.has-switch span.switch-large,
.has-switch label.switch-large {
padding-bottom: 9px;
padding-top: 9px;
font-size: 16px;
line-height: normal;
}
.has-switch label {
text-align: center;
margin-top: -1px;
margin-bottom: -1px;
z-index: 100;
width: 34%;
color: #ffffff;
}
.has-switch label:hover,
.has-switch label:focus,
.has-switch label:active,
.has-switch label.active,
.has-switch label.disabled,
.has-switch label[disabled] {
color: #ffffff;
background-color: #e6e6e6;
}
.has-switch label:active,
.has-switch label.active {
background-color: #cccccc \9;
}
.has-switch label i {
color: #666;
line-height: 18px;
pointer-events: none;
}
.has-switch span {
text-align: center;
z-index: 1;
width: 33%;
}
.has-switch span.switch-left {
-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;
}
.has-switch span.switch-right {
color: #333333;
background-color: #e0e0e0;
}
.has-switch span.switch-right:hover,
.has-switch span.switch-right:focus,
.has-switch span.switch-right:active,
.has-switch span.switch-right.active,
.has-switch span.switch-right.disabled,
.has-switch span.switch-right[disabled] {
color: #333333;
background-color: #e9e9e9;
}
.has-switch span.switch-right:active,
.has-switch span.switch-right.active {
background-color: #e6e6e6 \9;
}
.has-switch span.switch-primary,
.has-switch span.switch-left {
color: #ffffff;
background-color: #428bca;
}
.has-switch span.switch-primary:hover,
.has-switch span.switch-left:hover,
.has-switch span.switch-primary:focus,
.has-switch span.switch-left:focus,
.has-switch span.switch-primary:active,
.has-switch span.switch-left:active,
.has-switch span.switch-primary.active,
.has-switch span.switch-left.active,
.has-switch span.switch-primary.disabled,
.has-switch span.switch-left.disabled,
.has-switch span.switch-primary[disabled],
.has-switch span.switch-left[disabled] {
color: #ffffff;
background-color: #68AAE3;
}
.has-switch span.switch-primary:active,
.has-switch span.switch-left:active,
.has-switch span.switch-primary.active,
.has-switch span.switch-left.active {
background-color: #4B9ADE \9;
}
.has-switch span.switch-info {
color: #ffffff;
background-color: #41a7c5;
}
.has-switch span.switch-info:hover,
.has-switch span.switch-info:focus,
.has-switch span.switch-info:active,
.has-switch span.switch-info.active,
.has-switch span.switch-info.disabled,
.has-switch span.switch-info[disabled] {
color: #ffffff;
background-color: #5bc0de;
}
.has-switch span.switch-info:active,
.has-switch span.switch-info.active {
background-color: #31b0d5 \9;
}
.has-switch span.switch-success {
color: #ffffff;
background-color: #3cc051;
}
.has-switch span.switch-success:hover,
.has-switch span.switch-success:focus,
.has-switch span.switch-success:active,
.has-switch span.switch-success.active,
.has-switch span.switch-success.disabled,
.has-switch span.switch-success[disabled] {
color: #ffffff;
background-color: #62c462;
}
.has-switch span.switch-success:active,
.has-switch span.switch-success.active {
background-color: #42b142 \9;
}
.has-switch span.switch-warning {
color: #ffffff;
background-color: #f9a123;
border-color: #fbb450;
}
.has-switch span.switch-warning:hover,
.has-switch span.switch-warning:focus,
.has-switch span.switch-warning:active,
.has-switch span.switch-warning.active,
.has-switch span.switch-warning.disabled,
.has-switch span.switch-warning[disabled] {
color: #ffffff;
background-color: #fbb450;
}
.has-switch span.switch-warning:active,
.has-switch span.switch-warning.active {
background-color: #fa9f1e \9;
}
.has-switch span.switch-danger {
color: #ffffff;
background-color: #d14641;
border-color: #ee5f5b #ee5f5b #e51d18;
}
.has-switch span.switch-danger:hover,
.has-switch span.switch-danger:focus,
.has-switch span.switch-danger:active,
.has-switch span.switch-danger.active,
.has-switch span.switch-danger.disabled,
.has-switch span.switch-danger[disabled] {
color: #ffffff;
background-color: #ee5f5b;
}
.has-switch span.switch-danger:active,
.has-switch span.switch-danger.active {
background-color: #e9322d \9;
}
.has-switch span.switch-default {
color: #333333;
background-color: #f0f0f0;
}
.has-switch span.switch-default:hover,
.has-switch span.switch-default:focus,
.has-switch span.switch-default:active,
.has-switch span.switch-default.active,
.has-switch span.switch-default.disabled,
.has-switch span.switch-default[disabled] {
color: #333333;
background-color: #ffffff;
}
.has-switch span.switch-default:active,
.has-switch span.switch-default.active {
background-color: #e6e6e6 \9;
}

View File

@@ -0,0 +1,408 @@
/* ============================================================
* bootstrapSwitch v1.8 by Larentis Mattia @SpiritualGuru
* http://www.larentis.eu/
*
* Enhanced for radiobuttons by Stein, Peter @BdMdesigN
* http://www.bdmdesign.org/
*
* Project site:
* http://www.larentis.eu/switch/
* ============================================================
* Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
* ============================================================ */
.has-switch {
display: inline-block;
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;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
vertical-align: middle;
min-width: 100px;
}
.has-switch.switch-mini {
min-width: 72px;
}
.has-switch.switch-mini i.switch-mini-icons {
height: 1.20em;
line-height: 9px;
vertical-align: text-top;
text-align: center;
transform: scale(0.6);
margin-top: -1px;
margin-bottom: -1px;
}
.has-switch.switch-small {
min-width: 80px;
}
.has-switch.switch-large {
min-width: 120px;
}
.has-switch.deactivate {
opacity: 0.5;
filter: alpha(opacity=50);
cursor: default !important;
}
.has-switch.deactivate label,
.has-switch.deactivate span {
cursor: default !important;
}
.has-switch > div {
display: inline-block;
width: 150%;
position: relative;
top: 0;
}
.has-switch > div.switch-animate {
-webkit-transition: left 0.5s;
-moz-transition: left 0.5s;
-o-transition: left 0.5s;
transition: left 0.5s;
}
.has-switch > div.switch-off {
left: -50%;
}
.has-switch > div.switch-on {
left: 0%;
}
.has-switch input[type=radio],
.has-switch input[type=checkbox] {
display: none;
}
.has-switch span,
.has-switch label {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
cursor: pointer;
position: relative;
display: inline-block;
height: 100%;
padding-bottom: 4px;
padding-top: 4px;
font-size: 14px;
line-height: 20px;
}
.has-switch span.switch-mini,
.has-switch label.switch-mini {
padding-bottom: 4px;
padding-top: 4px;
font-size: 10px;
line-height: 9px;
}
.has-switch span.switch-small,
.has-switch label.switch-small {
padding-bottom: 3px;
padding-top: 3px;
font-size: 12px;
line-height: 18px;
}
.has-switch span.switch-large,
.has-switch label.switch-large {
padding-bottom: 9px;
padding-top: 9px;
font-size: 16px;
line-height: normal;
}
.has-switch label {
text-align: center;
margin-top: -1px;
margin-bottom: -1px;
z-index: 100;
width: 34%;
border-left: 1px solid #cccccc;
border-right: 1px solid #cccccc;
color: #333333;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #f5f5f5;
background-image: -moz-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));
background-image: -webkit-linear-gradient(top, #ffffff, #e6e6e6);
background-image: -o-linear-gradient(top, #ffffff, #e6e6e6);
background-image: linear-gradient(to bottom, #ffffff, #e6e6e6);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe6e6e6', GradientType=0);
border-color: #e6e6e6 #e6e6e6 #bfbfbf;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #e6e6e6;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch label:hover,
.has-switch label:focus,
.has-switch label:active,
.has-switch label.active,
.has-switch label.disabled,
.has-switch label[disabled] {
color: #333333;
background-color: #e6e6e6;
*background-color: #d9d9d9;
}
.has-switch label:active,
.has-switch label.active {
background-color: #cccccc \9;
}
.has-switch label i {
color: #000;
text-shadow: 0 1px 0 #fff;
line-height: 18px;
pointer-events: none;
}
.has-switch span {
text-align: center;
z-index: 1;
width: 33%;
}
.has-switch span.switch-left {
-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;
}
.has-switch span.switch-right {
color: #333333;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
background-color: #f0f0f0;
background-image: -moz-linear-gradient(top, #e6e6e6, #ffffff);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#ffffff));
background-image: -webkit-linear-gradient(top, #e6e6e6, #ffffff);
background-image: -o-linear-gradient(top, #e6e6e6, #ffffff);
background-image: linear-gradient(to bottom, #e6e6e6, #ffffff);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0);
border-color: #ffffff #ffffff #d9d9d9;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #ffffff;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-right:hover,
.has-switch span.switch-right:focus,
.has-switch span.switch-right:active,
.has-switch span.switch-right.active,
.has-switch span.switch-right.disabled,
.has-switch span.switch-right[disabled] {
color: #333333;
background-color: #ffffff;
*background-color: #f2f2f2;
}
.has-switch span.switch-right:active,
.has-switch span.switch-right.active {
background-color: #e6e6e6 \9;
}
.has-switch span.switch-primary,
.has-switch span.switch-left {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #005fcc;
background-image: -moz-linear-gradient(top, #0044cc, #0088cc);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0044cc), to(#0088cc));
background-image: -webkit-linear-gradient(top, #0044cc, #0088cc);
background-image: -o-linear-gradient(top, #0044cc, #0088cc);
background-image: linear-gradient(to bottom, #0044cc, #0088cc);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0044cc', endColorstr='#ff0088cc', GradientType=0);
border-color: #0088cc #0088cc #005580;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #0088cc;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-primary:hover,
.has-switch span.switch-left:hover,
.has-switch span.switch-primary:focus,
.has-switch span.switch-left:focus,
.has-switch span.switch-primary:active,
.has-switch span.switch-left:active,
.has-switch span.switch-primary.active,
.has-switch span.switch-left.active,
.has-switch span.switch-primary.disabled,
.has-switch span.switch-left.disabled,
.has-switch span.switch-primary[disabled],
.has-switch span.switch-left[disabled] {
color: #ffffff;
background-color: #0088cc;
*background-color: #0077b3;
}
.has-switch span.switch-primary:active,
.has-switch span.switch-left:active,
.has-switch span.switch-primary.active,
.has-switch span.switch-left.active {
background-color: #006699 \9;
}
.has-switch span.switch-info {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #41a7c5;
background-image: -moz-linear-gradient(top, #2f96b4, #5bc0de);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#2f96b4), to(#5bc0de));
background-image: -webkit-linear-gradient(top, #2f96b4, #5bc0de);
background-image: -o-linear-gradient(top, #2f96b4, #5bc0de);
background-image: linear-gradient(to bottom, #2f96b4, #5bc0de);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff2f96b4', endColorstr='#ff5bc0de', GradientType=0);
border-color: #5bc0de #5bc0de #28a1c5;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #5bc0de;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-info:hover,
.has-switch span.switch-info:focus,
.has-switch span.switch-info:active,
.has-switch span.switch-info.active,
.has-switch span.switch-info.disabled,
.has-switch span.switch-info[disabled] {
color: #ffffff;
background-color: #5bc0de;
*background-color: #46b8da;
}
.has-switch span.switch-info:active,
.has-switch span.switch-info.active {
background-color: #31b0d5 \9;
}
.has-switch span.switch-success {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #58b058;
background-image: -moz-linear-gradient(top, #51a351, #62c462);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#51a351), to(#62c462));
background-image: -webkit-linear-gradient(top, #51a351, #62c462);
background-image: -o-linear-gradient(top, #51a351, #62c462);
background-image: linear-gradient(to bottom, #51a351, #62c462);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff51a351', endColorstr='#ff62c462', GradientType=0);
border-color: #62c462 #62c462 #3b9e3b;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #62c462;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-success:hover,
.has-switch span.switch-success:focus,
.has-switch span.switch-success:active,
.has-switch span.switch-success.active,
.has-switch span.switch-success.disabled,
.has-switch span.switch-success[disabled] {
color: #ffffff;
background-color: #62c462;
*background-color: #4fbd4f;
}
.has-switch span.switch-success:active,
.has-switch span.switch-success.active {
background-color: #42b142 \9;
}
.has-switch span.switch-warning {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #f9a123;
background-image: -moz-linear-gradient(top, #f89406, #fbb450);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#f89406), to(#fbb450));
background-image: -webkit-linear-gradient(top, #f89406, #fbb450);
background-image: -o-linear-gradient(top, #f89406, #fbb450);
background-image: linear-gradient(to bottom, #f89406, #fbb450);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff89406', endColorstr='#fffbb450', GradientType=0);
border-color: #fbb450 #fbb450 #f89406;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #fbb450;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-warning:hover,
.has-switch span.switch-warning:focus,
.has-switch span.switch-warning:active,
.has-switch span.switch-warning.active,
.has-switch span.switch-warning.disabled,
.has-switch span.switch-warning[disabled] {
color: #ffffff;
background-color: #fbb450;
*background-color: #faa937;
}
.has-switch span.switch-warning:active,
.has-switch span.switch-warning.active {
background-color: #fa9f1e \9;
}
.has-switch span.switch-danger {
color: #ffffff;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
background-color: #d14641;
background-image: -moz-linear-gradient(top, #bd362f, #ee5f5b);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#bd362f), to(#ee5f5b));
background-image: -webkit-linear-gradient(top, #bd362f, #ee5f5b);
background-image: -o-linear-gradient(top, #bd362f, #ee5f5b);
background-image: linear-gradient(to bottom, #bd362f, #ee5f5b);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffbd362f', endColorstr='#ffee5f5b', GradientType=0);
border-color: #ee5f5b #ee5f5b #e51d18;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #ee5f5b;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-danger:hover,
.has-switch span.switch-danger:focus,
.has-switch span.switch-danger:active,
.has-switch span.switch-danger.active,
.has-switch span.switch-danger.disabled,
.has-switch span.switch-danger[disabled] {
color: #ffffff;
background-color: #ee5f5b;
*background-color: #ec4844;
}
.has-switch span.switch-danger:active,
.has-switch span.switch-danger.active {
background-color: #e9322d \9;
}
.has-switch span.switch-default {
color: #333333;
text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75);
background-color: #f0f0f0;
background-image: -moz-linear-gradient(top, #e6e6e6, #ffffff);
background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#e6e6e6), to(#ffffff));
background-image: -webkit-linear-gradient(top, #e6e6e6, #ffffff);
background-image: -o-linear-gradient(top, #e6e6e6, #ffffff);
background-image: linear-gradient(to bottom, #e6e6e6, #ffffff);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6', endColorstr='#ffffffff', GradientType=0);
border-color: #ffffff #ffffff #d9d9d9;
border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
*background-color: #ffffff;
/* Darken IE7 buttons by default so they stand out more given they won't have borders */
filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
}
.has-switch span.switch-default:hover,
.has-switch span.switch-default:focus,
.has-switch span.switch-default:active,
.has-switch span.switch-default.active,
.has-switch span.switch-default.disabled,
.has-switch span.switch-default[disabled] {
color: #333333;
background-color: #ffffff;
*background-color: #f2f2f2;
}
.has-switch span.switch-default:active,
.has-switch span.switch-default.active {
background-color: #e6e6e6 \9;
}

View File

@@ -0,0 +1,153 @@
@import url("https://fonts.googleapis.com/css?family=Lato:400,700,700italic,900,400italic,300");
@font-face {
font-family: 'Flat-UI-Icons';
src: url('../fonts/Flat-UI-Icons.eot');
src: url('../fonts/Flat-UI-Icons.eot?#iefix') format('embedded-opentype'), url('../fonts/Flat-UI-Icons.woff') format('woff'), url('../fonts/Flat-UI-Icons.ttf') format('truetype'), url('../fonts/Flat-UI-Icons.svg#Flat-UI-Icons') format('svg');
font-weight: normal;
font-style: normal;
}
/* Use the following CSS code if you want to use data attributes for inserting your icons */
[data-icon]:before {
font-family: 'Flat-UI-Icons';
content: attr(data-icon);
speak: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
-webkit-font-smoothing: antialiased;
}
/* Use the following CSS code if you want to have a class per icon */
/*
Instead of a list of all class selectors,
you can use the generic selector below, but it's slower:
[class*="fui-"] {
*/
.fui-arrow-right,
.fui-arrow-left,
.fui-cmd,
.fui-check-inverted,
.fui-heart,
.fui-location,
.fui-plus,
.fui-check,
.fui-cross,
.fui-list,
.fui-new,
.fui-video,
.fui-photo,
.fui-volume,
.fui-time,
.fui-eye,
.fui-chat,
.fui-search,
.fui-user,
.fui-mail,
.fui-lock,
.fui-gear,
.fui-radio-unchecked,
.fui-radio-checked,
.fui-checkbox-unchecked,
.fui-checkbox-checked,
.fui-calendar-solid,
.fui-pause,
.fui-play,
.fui-check-inverted-2 {
display: inline-block;
font-family: 'Flat-UI-Icons';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
-webkit-font-smoothing: antialiased;
}
.fui-arrow-right:before {
content: "\e02c";
}
.fui-arrow-left:before {
content: "\e02d";
}
.fui-cmd:before {
content: "\e02f";
}
.fui-check-inverted:before {
content: "\e006";
}
.fui-heart:before {
content: "\e007";
}
.fui-location:before {
content: "\e008";
}
.fui-plus:before {
content: "\e009";
}
.fui-check:before {
content: "\e00a";
}
.fui-cross:before {
content: "\e00b";
}
.fui-list:before {
content: "\e00c";
}
.fui-new:before {
content: "\e00d";
}
.fui-video:before {
content: "\e00e";
}
.fui-photo:before {
content: "\e00f";
}
.fui-volume:before {
content: "\e010";
}
.fui-time:before {
content: "\e011";
}
.fui-eye:before {
content: "\e012";
}
.fui-chat:before {
content: "\e013";
}
.fui-search:before {
content: "\e01c";
}
.fui-user:before {
content: "\e01d";
}
.fui-mail:before {
content: "\e01e";
}
.fui-lock:before {
content: "\e01f";
}
.fui-gear:before {
content: "\e024";
}
.fui-radio-unchecked:before {
content: "\e02b";
}
.fui-radio-checked:before {
content: "\e032";
}
.fui-checkbox-unchecked:before {
content: "\e033";
}
.fui-checkbox-checked:before {
content: "\e034";
}
.fui-calendar-solid:before {
content: "\e022";
}
.fui-pause:before {
content: "\e03b";
}
.fui-play:before {
content: "\e03c";
}
.fui-check-inverted-2:before {
content: "\e000";
}