소스 검색

documentation and version bump

Emanuele Marchi 10 년 전
부모
커밋
19d54046bd
18개의 변경된 파일713개의 추가작업 그리고 595개의 파일을 삭제
  1. 1 1
      bower.json
  2. 1 1
      composer.json
  3. 8 3
      documentation-2.html
  4. 0 325
      documentation-3.html
  5. 53 9
      events-3.html
  6. 7 2
      examples.html
  7. 7 7
      gulpfile.coffee
  8. 8 3
      index.html
  9. 7 2
      main.html
  10. 129 0
      methods-3.html
  11. 238 0
      options-3.html
  12. 15 15
      package.json
  13. 3 1
      src/docs/documentation-2.jade
  14. 0 224
      src/docs/documentation-3.jade
  15. 37 0
      src/docs/events-3.jade
  16. 7 2
      src/docs/main.jade
  17. 48 0
      src/docs/methods-3.jade
  18. 144 0
      src/docs/options-3.jade

+ 1 - 1
bower.json

@@ -1,7 +1,7 @@
 {
   "name": "bootstrap-switch",
   "description": "Turn checkboxes and radio buttons in toggle switches.",
-  "version": "3.0.2",
+  "version": "3.1.0",
   "main": [
     "./dist/js/bootstrap-switch.js",
     "./dist/css/bootstrap3/bootstrap-switch.css"

+ 1 - 1
composer.json

@@ -1,7 +1,7 @@
 {
   "name": "components/bootstrap-switch",
   "description": "Turn checkboxes and radio buttons in toggle switches.",
-  "version": "3.0.2",
+  "version": "3.1.0",
   "type": "component",
   "keywords": [
     "bootstrap",

+ 8 - 3
documentation-2.html

@@ -44,8 +44,13 @@
             <li><a href="examples.html">Examples</a></li>
             <li class="dropdown"><a href="#" data-toggle="dropdown">Documentation<span class="caret"></span></a>
               <ul class="dropdown-menu">
-                <li><a href="/documentation-3.html">Version 3 (Stable)</a></li>
-                <li><a href="/documentation-2.html">Version 2.0.1 (Legacy)</a></li>
+                <li class="dropdown-header">Version 3 (Stable)</li>
+                <li><a href="/options-3.html">Options</a></li>
+                <li><a href="/methods-3.html">Methods</a></li>
+                <li><a href="/events-3.html">Events</a></li>
+                <li class="divider"></li>
+                <li class="dropdown-header">Version 2.0.1 (Legacy)</li>
+                <li><a href="/documentation-2.html">Documentation</a></li>
               </ul>
             </li>
             <li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
@@ -54,7 +59,7 @@
       </div>
     </header>
     <div class="container content">
-      <h1 class="page-header">Documentation 2.0.1 (Legacy)</h1>
+      <h1 class="page-header">Documentation &nbsp;<small>Version 2.0.1 (Legacy)</small></h1>
       <div id="options-2">
         <h2 class="page-header">Options</h2>
         <div class="alert alert-warning">

+ 0 - 325
documentation-3.html

@@ -1,325 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-  <head>
-    <meta charset="utf-8">
-    <meta http-equiv="X-UA-Compatible" content="IE=edge">
-    <meta name="viewport" content="width=device-width, initial-scale=1.0">
-    <meta name="description" content="Turn checkboxes and radio buttons in toggle switches.">
-    <meta name="author" content="Mattia Larentis, Emanuele Marchi and Peter Stein">
-    <title>Bootstrap Switch · Turn checkboxes and radio buttons in toggle switches</title>
-    <link href="http://fonts.googleapis.com/css?family=Roboto:400,700" rel="stylesheet">
-    <link href="docs/css/bootstrap.min.css" rel="stylesheet">
-    <link href="docs/css/highlight.css" rel="stylesheet">
-    <link href="dist/css/bootstrap3/bootstrap-switch.css" rel="stylesheet">
-    <link href="docs/css/main.css" rel="stylesheet">
-    <script>
-      var _gaq = _gaq || [];
-      _gaq.push(['_setAccount', 'UA-43092768-1']);
-      _gaq.push(['_trackPageview']);
-      (function () {
-        var ga = document.createElement('script');
-        ga.type = 'text/javascript';
-        ga.async = true;
-        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-        var s = document.getElementsByTagName('script')[0];
-        s.parentNode.insertBefore(ga, s);
-      })();
-    </script>
-  </head>
-  <body><a href="https://github.com/nostalgiaz/bootstrap-switch" id="github"><img src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
-    <header role="banner" class="navbar navbar-default navbar-fixed-top top">
-      <div class="container">
-        <div class="navbar-header">
-          <button type="button" data-toggle="collapse" data-target="#collapse" class="navbar-toggle"><span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><a href="../" class="navbar-brand">Bootstrap Switch <strong>3</strong></a>
-        </div>
-        <nav id="collapse" role="navigation" class="collapse navbar-collapse">
-          <ul class="nav navbar-nav">
-            <li class="dropdown"><a href="#" data-toggle="dropdown">Download<span class="caret"></span></a>
-              <ul class="dropdown-menu">
-                <li><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/master.zip">3 (Stable)</a></li>
-                <li><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/v2.0.1.zip">2.0.1 (Legacy)</a></li>
-              </ul>
-            </li>
-            <li><a href="index.html">Start</a></li>
-            <li><a href="examples.html">Examples</a></li>
-            <li class="dropdown"><a href="#" data-toggle="dropdown">Documentation<span class="caret"></span></a>
-              <ul class="dropdown-menu">
-                <li><a href="/documentation-3.html">Version 3 (Stable)</a></li>
-                <li><a href="/documentation-2.html">Version 2.0.1 (Legacy)</a></li>
-              </ul>
-            </li>
-            <li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
-          </ul>
-        </nav>
-      </div>
-    </header>
-    <div class="container content">
-      <h1 class="page-header">Documentation 3 (Stable)</h1>
-      <div id="options-3">
-        <h2 class="page-header">Options</h2>
-        <table class="table table-bordered table-striped table-responsive">
-          <thead>
-            <tr>
-              <th>Name</th>
-              <th>Attribute</th>
-              <th>Type</th>
-              <th>Description</th>
-              <th>Values</th>
-              <th>Default</th>
-            </tr>
-          </thead>
-          <tbody>
-            <tr>
-              <td>state</td>
-              <td>checked</td>
-              <td>Boolean</td>
-              <td>The checkbox state</td>
-              <td>true, false</td>
-              <td>true</td>
-            </tr>
-            <tr>
-              <td>size</td>
-              <td>data-size</td>
-              <td>String</td>
-              <td>The checkbox state</td>
-              <td>null, 'mini', 'small', 'normal', 'large'</td>
-              <td>null</td>
-            </tr>
-            <tr>
-              <td>animate</td>
-              <td>data-animate</td>
-              <td>Boolean</td>
-              <td>Animate the switch</td>
-              <td>true, false</td>
-              <td>true</td>
-            </tr>
-            <tr>
-              <td>disabled</td>
-              <td>disabled</td>
-              <td>Boolean</td>
-              <td>Disable state</td>
-              <td>true, false</td>
-              <td>false</td>
-            </tr>
-            <tr>
-              <td>readonly</td>
-              <td>readonly</td>
-              <td>Boolean</td>
-              <td>Readonly state</td>
-              <td>true, false</td>
-              <td>false</td>
-            </tr>
-            <tr>
-              <td>indeterminate</td>
-              <td>data-indeterminate</td>
-              <td>Boolean</td>
-              <td>Indeterminate state</td>
-              <td>true, false</td>
-              <td>false</td>
-            </tr>
-            <tr>
-              <td>inverse</td>
-              <td>data-inverse</td>
-              <td>Boolean</td>
-              <td>Inverse switch direction</td>
-              <td>true, false</td>
-              <td>false</td>
-            </tr>
-            <tr>
-              <td>radioAllOff</td>
-              <td>data-radio-all-off</td>
-              <td>Boolean</td>
-              <td>Allow this radio button to be unchecked by the user</td>
-              <td>true, false</td>
-              <td>false</td>
-            </tr>
-            <tr>
-              <td>onColor</td>
-              <td>data-on-color</td>
-              <td>String</td>
-              <td>Color of the left side of the switch</td>
-              <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
-              <td>'primary'</td>
-            </tr>
-            <tr>
-              <td>offColor</td>
-              <td>data-off-color</td>
-              <td>String</td>
-              <td>Color of the right side of the switch</td>
-              <td>'primary', 'info', 'success', 'warning', 'danger', 'default'</td>
-              <td>'default'</td>
-            </tr>
-            <tr>
-              <td>onText</td>
-              <td>data-on-text</td>
-              <td>String</td>
-              <td>Text of the left side of the switch</td>
-              <td>String</td>
-              <td>'ON'</td>
-            </tr>
-            <tr>
-              <td>offText</td>
-              <td>data-off-text</td>
-              <td>String</td>
-              <td>Text of the right side of the switch</td>
-              <td>String</td>
-              <td>'OFF'</td>
-            </tr>
-            <tr>
-              <td>labelText</td>
-              <td>data-label-text</td>
-              <td>String</td>
-              <td>Text of the center handle of the switch</td>
-              <td>String</td>
-              <td>'&amp;nbsp;'</td>
-            </tr>
-            <tr>
-              <td>baseClass</td>
-              <td>data-base-class</td>
-              <td>String</td>
-              <td>Global class prefix</td>
-              <td>String</td>
-              <td>'bootstrap-switch'</td>
-            </tr>
-            <tr>
-              <td>wrapperClass</td>
-              <td>data-wrapper-class</td>
-              <td>String | Array</td>
-              <td>Container element class(es)</td>
-              <td>String | Array</td>
-              <td>'wrapper'</td>
-            </tr>
-            <tr>
-              <td>onInit</td>
-              <td></td>
-              <td>Function</td>
-              <td>Callback function to execute on initialization</td>
-              <td>Function</td>
-              <td>
-                <pre><code class="javascript">function(event, state) {}</code></pre>
-              </td>
-            </tr>
-            <tr>
-              <td>onSwitchChange</td>
-              <td></td>
-              <td>Function</td>
-              <td>Callback function to execute on switch state change</td>
-              <td>Function</td>
-              <td>
-                <pre><code class="javascript">function(event, state) {}</code></pre>
-              </td>
-            </tr>
-          </tbody>
-        </table>
-        <h3>Global Defaults Overriding</h3>
-        <p>Follow the jQuery convention to override the default options of the library. For instance:</p>
-        <pre><code>$.fn.bootstrapSwitch.defaults.size = 'large';
-$.fn.bootstrapSwitch.defaults.onColor = 'success';</code></pre>
-      </div>
-      <div id="methods-3">
-        <h2 class="page-header">Methods</h2>
-        <p>In Bootstrap Switch, every option is also a method.</p>
-        <p>If the second parameter is omitted, the method return the current value.</p>
-        <p>You can invoke methods as follows:</p>
-        <pre><code>$('input[name="my-checkbox"]').bootstrapSwitch('state', true, true);</code></pre>
-        <h3>Additional Methods</h3>
-        <table class="table table-bordered table-striped table-responsive">
-          <thead>
-            <tr>
-              <th>Name</th>
-              <th>Description</th>
-            </tr>
-          </thead>
-          <tbody>
-            <tr>
-              <td>toggleState</td>
-              <td>Toggle the switch state</td>
-            </tr>
-            <tr>
-              <td>toggleAnimate</td>
-              <td>Toggle the animate option</td>
-            </tr>
-            <tr>
-              <td>toggleDisabled</td>
-              <td>Toggle the disabled state</td>
-            </tr>
-            <tr>
-              <td>toggleReadonly</td>
-              <td>Toggle the readonly state</td>
-            </tr>
-            <tr>
-              <td>toggleIndeterminate</td>
-              <td>Toggle the indeterminate state</td>
-            </tr>
-            <tr>
-              <td>toggleInverse</td>
-              <td>Toggle the inverse option</td>
-            </tr>
-            <tr>
-              <td>destroy</td>
-              <td>Destroy the instance of Bootstrap Switch</td>
-            </tr>
-          </tbody>
-        </table>
-        <h3>Special Behaviours</h3>
-        <ul>
-          <li>The method <code>state</code> can receive an optional third parameter <code>skip</code>. if true, <code>switchChange</code> event is not executed. The default is false.</li>
-          <li>The method <code>toggleState</code> can receive an optional second parameter <code>skip</code>. if true, <code>switchChange</code> event is not executed. The default is false.</li>
-          <li>The method <code>wrapperClass</code> can accepts a falsy value as second parameter. If so, it resets the class to its default.</li>
-        </ul>
-      </div>
-      <div id="events-3">
-        <h2 class="page-header">Events</h2>
-        <p>
-          All the events are namespaced, therefore always append <code>.bootstrapSwitch</code> when you
-          attach your handlers.<br>
-          You can register to the emitted events as follow:
-        </p>
-        <pre><code>$('input[name="my-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
-  console.log(this); // DOM element
-  console.log(event); // jQuery event
-  console.log(state); // true | false
-});</code></pre>
-        <table class="table table-bordered table-striped table-responsive">
-          <thead>
-            <tr>
-              <th>Name</th>
-              <th>Description</th>
-              <th>Parameters</th>
-            </tr>
-          </thead>
-          <tbody>
-            <tr>
-              <td>init</td>
-              <td>Triggered on initialization. 'this' refers to the DOM element.</td>
-              <td>event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>)</td>
-            </tr>
-            <tr>
-              <td>switchChange</td>
-              <td>Triggered on switch state change. 'this' refers to the DOM element.</td>
-              <td>
-                event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>),
-                state (true | false)
-              </td>
-            </tr>
-          </tbody>
-        </table>
-      </div>
-    </div>
-    <div class="container bottom">
-      <p>
-        Licensed under the
-        <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2.0</a>
-        · Created by
-        <a href="https://github.com/nostalgiaz" target="_blank">Mattia Larentis</a>
-        · Mantained by
-        <a href="https://github.com/lostcrew" target="_blank">Emanuele Marchi</a>
-      </p>
-    </div>
-    <script src="docs/js/jquery.min.js"></script>
-    <script src="docs/js/bootstrap.min.js"></script>
-    <script src="docs/js/highlight.js"></script>
-    <script src="dist/js/bootstrap-switch.js"></script>
-    <script src="docs/js/main.js"></script>
-  </body>
-</html>

+ 53 - 9
page.html → events-3.html

@@ -40,19 +40,17 @@
                 <li><a href="https://github.com/nostalgiaz/bootstrap-switch/archive/v2.0.1.zip">2.0.1 (Legacy)</a></li>
               </ul>
             </li>
-            <li><a href="#new">What's new</a></li>
-            <li><a href="#start">Start</a></li>
+            <li><a href="index.html">Start</a></li>
+            <li><a href="examples.html">Examples</a></li>
             <li class="dropdown"><a href="#" data-toggle="dropdown">Documentation<span class="caret"></span></a>
               <ul class="dropdown-menu">
                 <li class="dropdown-header">Version 3 (Stable)</li>
-                <li><a href="#options-3">Options</a></li>
-                <li><a href="#methods-3">Methods</a></li>
-                <li><a href="#events-3">Events</a></li>
+                <li><a href="/options-3.html">Options</a></li>
+                <li><a href="/methods-3.html">Methods</a></li>
+                <li><a href="/events-3.html">Events</a></li>
                 <li class="divider"></li>
                 <li class="dropdown-header">Version 2.0.1 (Legacy)</li>
-                <li><a href="#options-2">Options</a></li>
-                <li><a href="#methods-2">Methods</a></li>
-                <li><a href="#events-2">Events</a></li>
+                <li><a href="/documentation-2.html">Documentation</a></li>
               </ul>
             </li>
             <li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
@@ -60,7 +58,53 @@
         </nav>
       </div>
     </header>
-    <p>try</p>
+    <div class="container content">
+      <h1 class="page-header">Events &nbsp;<small>Version 3 (Stable)</small></h1>
+      <p>
+        All the events are namespaced, therefore always append <code>.bootstrapSwitch</code> when you
+        attach your handlers.<br>
+        You can register to the emitted events as follow:
+      </p>
+      <pre><code>$('input[name="my-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
+  console.log(this); // DOM element
+  console.log(event); // jQuery event
+  console.log(state); // true | false
+});</code></pre>
+      <table class="table table-bordered table-striped table-responsive">
+        <thead>
+          <tr>
+            <th>Name</th>
+            <th>Description</th>
+            <th>Parameters</th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr>
+            <td>init</td>
+            <td>Triggered on initialization. 'this' refers to the DOM element.</td>
+            <td>event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>)</td>
+          </tr>
+          <tr>
+            <td>switchChange</td>
+            <td>Triggered on switch state change. 'this' refers to the DOM element.</td>
+            <td>
+              event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>),
+              state (true | false)
+            </td>
+          </tr>
+        </tbody>
+      </table>
+    </div>
+    <div class="container bottom">
+      <p>
+        Licensed under the
+        <a href="http://www.apache.org/licenses/LICENSE-2.0" target="_blank">Apache License, Version 2.0</a>
+        · Created by
+        <a href="https://github.com/nostalgiaz" target="_blank">Mattia Larentis</a>
+        · Mantained by
+        <a href="https://github.com/lostcrew" target="_blank">Emanuele Marchi</a>
+      </p>
+    </div>
     <script src="docs/js/jquery.min.js"></script>
     <script src="docs/js/bootstrap.min.js"></script>
     <script src="docs/js/highlight.js"></script>

+ 7 - 2
examples.html

@@ -44,8 +44,13 @@
             <li><a href="examples.html">Examples</a></li>
             <li class="dropdown"><a href="#" data-toggle="dropdown">Documentation<span class="caret"></span></a>
               <ul class="dropdown-menu">
-                <li><a href="/documentation-3.html">Version 3 (Stable)</a></li>
-                <li><a href="/documentation-2.html">Version 2.0.1 (Legacy)</a></li>
+                <li class="dropdown-header">Version 3 (Stable)</li>
+                <li><a href="/options-3.html">Options</a></li>
+                <li><a href="/methods-3.html">Methods</a></li>
+                <li><a href="/events-3.html">Events</a></li>
+                <li class="divider"></li>
+                <li class="dropdown-header">Version 2.0.1 (Legacy)</li>
+                <li><a href="/documentation-2.html">Documentation</a></li>
               </ul>
             </li>
             <li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>

+ 7 - 7
gulpfile.coffee

@@ -7,9 +7,9 @@ pkg = require './package.json'
 name = pkg.name
 
 paths =
-  src: './src'
-  dist: './dist'
-  test: './test'
+  src: 'src'
+  dist: 'dist'
+  test: 'test'
   docs: "./"
 server =
   host: 'localhost'
@@ -43,7 +43,7 @@ gulp.task 'coffee', ->
   gulp
   .src "#{paths.src}/coffee/#{name}.coffee"
   .pipe $.changed "#{paths.dist}/js"
-  .pipe $.coffeelint './coffeelint.json'
+  .pipe $.coffeelint 'coffeelint.json'
   .pipe $.coffeelint.reporter()
     .on 'error', $.util.log
   .pipe $.coffee()
@@ -94,7 +94,7 @@ gulp.task 'test-coffee', ['coffee'], ->
   gulp
   .src "#{paths.src}/coffee/#{name}.tests.coffee"
   .pipe $.changed paths.test
-  .pipe $.coffeelint './coffeelint.json'
+  .pipe $.coffeelint 'coffeelint.json'
   .pipe $.coffeelint.reporter()
     .on 'error', $.util.log
   .pipe $.coffee()
@@ -113,7 +113,7 @@ gulp.task 'connect', ['docs'], ->
 
 gulp.task 'open', ['connect'], ->
   gulp
-  .src './index.html'
+  .src 'index.html'
   .pipe $.open '', url: "http://#{server.host}:#{server.port}"
 
 gulp.task 'watch', ['connect'], ->
@@ -124,7 +124,7 @@ gulp.task 'watch', ['connect'], ->
   gulp.watch [
     "#{paths.dist}/js/**/*.js"
     "#{paths.dist}/css/**/*.css"
-    './*.html'
+    '*.html'
   ]
   .on 'change', (event) ->
     gulp.src event.path

+ 8 - 3
index.html

@@ -44,8 +44,13 @@
             <li><a href="examples.html">Examples</a></li>
             <li class="dropdown"><a href="#" data-toggle="dropdown">Documentation<span class="caret"></span></a>
               <ul class="dropdown-menu">
-                <li><a href="/documentation-3.html">Version 3 (Stable)</a></li>
-                <li><a href="/documentation-2.html">Version 2.0.1 (Legacy)</a></li>
+                <li class="dropdown-header">Version 3 (Stable)</li>
+                <li><a href="/options-3.html">Options</a></li>
+                <li><a href="/methods-3.html">Methods</a></li>
+                <li><a href="/events-3.html">Events</a></li>
+                <li class="divider"></li>
+                <li class="dropdown-header">Version 2.0.1 (Legacy)</li>
+                <li><a href="/documentation-2.html">Documentation</a></li>
               </ul>
             </li>
             <li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>
@@ -74,7 +79,7 @@
           | If you feel there is something missing, submit a
           | <a href="https://github.com/nostalgiaz/bootstrap-switch/pulls">pull request</a> with your changes. Every
           | help is needed. Many thanks.
-          
+      
       -->
       <h1 class="page-header">Getting Started</h1>
       <p>Include the dependencies: jQuery, Bootstrap and Bootstrap Switch CSS + Javascript.</p>

+ 7 - 2
main.html

@@ -44,8 +44,13 @@
             <li><a href="examples.html">Examples</a></li>
             <li class="dropdown"><a href="#" data-toggle="dropdown">Documentation<span class="caret"></span></a>
               <ul class="dropdown-menu">
-                <li><a href="/documentation-3.html">Version 3 (Stable)</a></li>
-                <li><a href="/documentation-2.html">Version 2.0.1 (Legacy)</a></li>
+                <li class="dropdown-header">Version 3 (Stable)</li>
+                <li><a href="/options-3.html">Options</a></li>
+                <li><a href="/methods-3.html">Methods</a></li>
+                <li><a href="/events-3.html">Events</a></li>
+                <li class="divider"></li>
+                <li class="dropdown-header">Version 2.0.1 (Legacy)</li>
+                <li><a href="/documentation-2.html">Documentation</a></li>
               </ul>
             </li>
             <li><a href="https://github.com/nostalgiaz/bootstrap-switch/issues">Bug reports</a></li>

+ 129 - 0
methods-3.html

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

+ 238 - 0
options-3.html

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

+ 15 - 15
package.json

@@ -1,7 +1,7 @@
 {
   "name": "bootstrap-switch",
   "description": "Turn checkboxes and radio buttons in toggle switches.",
-  "version": "3.0.2",
+  "version": "3.1.0",
   "keywords": [
     "bootstrap",
     "switch",
@@ -37,22 +37,22 @@
   "license": "Apache Version 2",
   "readmeFilename": "README.md",
   "devDependencies": {
-    "gulp-coffee": "~2.1.1",
-    "gulp-util": "~3.0.0",
-    "gulp-header": "~1.0.5",
-    "gulp-uglify": "~0.3.1",
-    "gulp-coffeelint": "~0.3.3",
-    "gulp": "~3.8.6",
-    "gulp-less": "~1.3.2",
+    "gulp-coffee": "~2.2.0",
+    "gulp-util": "~3.0.1",
+    "gulp-header": "~1.1.1",
+    "gulp-uglify": "~1.0.1",
+    "gulp-coffeelint": "~0.4.0",
+    "gulp": "~3.8.8",
+    "gulp-less": "~1.3.6",
     "gulp-rename": "~1.2.0",
-    "gulp-open": "~0.2.8",
-    "gulp-load-plugins": "~0.5.3",
-    "gulp-jade": "~0.6.1",
-    "run-sequence": "~0.3.6",
+    "gulp-open": "~0.3.0",
+    "gulp-load-plugins": "~0.7.0",
+    "gulp-jade": "~0.9.0",
+    "run-sequence": "~1.0.1",
     "gulp-connect": "~2.0.6",
-    "coffee-script": "~1.7.1",
-    "gulp-changed": "~0.4.1",
-    "karma": "~0.12.22",
+    "coffee-script": "~1.8.0",
+    "gulp-changed": "~1.0.0",
+    "karma": "~0.12.24",
     "karma-firefox-launcher": "~0.1.3",
     "karma-jasmine": "~0.1.5"
   },

+ 3 - 1
src/docs/documentation-2.jade

@@ -1,7 +1,9 @@
 extends main
 
 block content
-  h1.page-header Documentation 2.0.1 (Legacy)
+  h1.page-header
+    | Documentation &nbsp;
+    small Version 2.0.1 (Legacy)
 
   #options-2
     h2.page-header Options

+ 0 - 224
src/docs/documentation-3.jade

@@ -1,224 +0,0 @@
-extends main
-
-block content
-  h1.page-header Documentation 3 (Stable)
-
-  #options-3
-    h2.page-header Options
-
-    table.table.table-bordered.table-striped.table-responsive
-      thead
-        tr
-          th Name
-          th Attribute
-          th Type
-          th Description
-          th Values
-          th Default
-      tbody
-        tr
-          td state
-          td checked
-          td Boolean
-          td The checkbox state
-          td true, false
-          td true
-        tr
-          td size
-          td data-size
-          td String
-          td The checkbox state
-          td null, 'mini', 'small', 'normal', 'large'
-          td null
-        tr
-          td animate
-          td data-animate
-          td Boolean
-          td Animate the switch
-          td true, false
-          td true
-        tr
-          td disabled
-          td disabled
-          td Boolean
-          td Disable state
-          td true, false
-          td false
-        tr
-          td readonly
-          td readonly
-          td Boolean
-          td Readonly state
-          td true, false
-          td false
-        tr
-          td indeterminate
-          td data-indeterminate
-          td Boolean
-          td Indeterminate state
-          td true, false
-          td false
-        tr
-          td inverse
-          td data-inverse
-          td Boolean
-          td Inverse switch direction
-          td true, false
-          td false
-        tr
-          td radioAllOff
-          td data-radio-all-off
-          td Boolean
-          td Allow this radio button to be unchecked by the user
-          td true, false
-          td false
-        tr
-          td onColor
-          td data-on-color
-          td String
-          td Color of the left side of the switch
-          td 'primary', 'info', 'success', 'warning', 'danger', 'default'
-          td 'primary'
-        tr
-          td offColor
-          td data-off-color
-          td String
-          td Color of the right side of the switch
-          td 'primary', 'info', 'success', 'warning', 'danger', 'default'
-          td 'default'
-        tr
-          td onText
-          td data-on-text
-          td String
-          td Text of the left side of the switch
-          td String
-          td 'ON'
-        tr
-          td offText
-          td data-off-text
-          td String
-          td Text of the right side of the switch
-          td String
-          td 'OFF'
-        tr
-          td labelText
-          td data-label-text
-          td String
-          td Text of the center handle of the switch
-          td String
-          td '&amp;nbsp;'
-        tr
-          td baseClass
-          td data-base-class
-          td String
-          td Global class prefix
-          td String
-          td 'bootstrap-switch'
-        tr
-          td wrapperClass
-          td data-wrapper-class
-          td String | Array
-          td Container element class(es)
-          td String | Array
-          td 'wrapper'
-        tr
-          td onInit
-          td
-          td Function
-          td Callback function to execute on initialization
-          td Function
-          td: pre: code.javascript function(event, state) {}
-        tr
-          td onSwitchChange
-          td
-          td Function
-          td Callback function to execute on switch state change
-          td Function
-          td: pre: code.javascript function(event, state) {}
-
-    h3 Global Defaults Overriding
-
-    p Follow the jQuery convention to override the default options of the library. For instance:
-    pre
-      code
-        | $.fn.bootstrapSwitch.defaults.size = 'large';
-        | $.fn.bootstrapSwitch.defaults.onColor = 'success';
-
-  #methods-3
-    h2.page-header Methods
-
-    p In Bootstrap Switch, every option is also a method.
-    p If the second parameter is omitted, the method return the current value.
-    p You can invoke methods as follows:
-    pre: code $('input[name="my-checkbox"]').bootstrapSwitch('state', true, true);
-
-    h3 Additional Methods
-
-    table.table.table-bordered.table-striped.table-responsive
-      thead
-        tr
-          th Name
-          th Description
-      tbody
-        tr
-          td toggleState
-          td Toggle the switch state
-        tr
-          td toggleAnimate
-          td Toggle the animate option
-        tr
-          td toggleDisabled
-          td Toggle the disabled state
-        tr
-          td toggleReadonly
-          td Toggle the readonly state
-        tr
-          td toggleIndeterminate
-          td Toggle the indeterminate state
-        tr
-          td toggleInverse
-          td Toggle the inverse option
-        tr
-          td destroy
-          td Destroy the instance of Bootstrap Switch
-
-    h3 Special Behaviours
-
-    ul
-      li The method <code>state</code> can receive an optional third parameter <code>skip</code>. if true, <code>switchChange</code> event is not executed. The default is false.
-      li The method <code>toggleState</code> can receive an optional second parameter <code>skip</code>. if true, <code>switchChange</code> event is not executed. The default is false.
-      li The method <code>wrapperClass</code> can accepts a falsy value as second parameter. If so, it resets the class to its default.
-
-  #events-3
-    h2.page-header Events
-
-    p
-      | All the events are namespaced, therefore always append <code>.bootstrapSwitch</code> when you
-      | attach your handlers.<br>
-      | You can register to the emitted events as follow:
-
-    pre: code
-      | $('input[name="my-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
-      |   console.log(this); // DOM element
-      |   console.log(event); // jQuery event
-      |   console.log(state); // true | false
-      | });
-
-    table.table.table-bordered.table-striped.table-responsive
-      thead
-        tr
-          th Name
-          th Description
-          th Parameters
-      tbody
-        tr
-          td init
-          td Triggered on initialization. 'this' refers to the DOM element.
-          td
-            | event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>)
-        tr
-          td switchChange
-          td Triggered on switch state change. 'this' refers to the DOM element.
-          td
-            | event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>),
-            | state (true | false)

+ 37 - 0
src/docs/events-3.jade

@@ -0,0 +1,37 @@
+extends main
+
+block content
+  h1.page-header
+    | Events &nbsp;
+    small Version 3 (Stable)
+
+  p
+    | All the events are namespaced, therefore always append <code>.bootstrapSwitch</code> when you
+    | attach your handlers.<br>
+    | You can register to the emitted events as follow:
+
+  pre: code
+    | $('input[name="my-checkbox"]').on('switchChange.bootstrapSwitch', function(event, state) {
+    |   console.log(this); // DOM element
+    |   console.log(event); // jQuery event
+    |   console.log(state); // true | false
+    | });
+
+  table.table.table-bordered.table-striped.table-responsive
+    thead
+      tr
+        th Name
+        th Description
+        th Parameters
+    tbody
+      tr
+        td init
+        td Triggered on initialization. 'this' refers to the DOM element.
+        td
+          | event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>)
+      tr
+        td switchChange
+        td Triggered on switch state change. 'this' refers to the DOM element.
+        td
+          | event (<a href="https://api.jquery.com/category/events/event-object/" target="_blank">jQuery Event object</a>),
+          | state (true | false)

+ 7 - 2
src/docs/main.jade

@@ -53,8 +53,13 @@ html(lang='en')
                 | Documentation
                 span.caret
               ul.dropdown-menu
-                li: a(href='/documentation-3.html') Version 3 (Stable)
-                li: a(href='/documentation-2.html') Version 2.0.1 (Legacy)
+                li.dropdown-header Version 3 (Stable)
+                li: a(href='/options-3.html') Options
+                li: a(href='/methods-3.html') Methods
+                li: a(href='/events-3.html') Events
+                li.divider
+                li.dropdown-header Version 2.0.1 (Legacy)
+                li: a(href='/documentation-2.html') Documentation
             li: a(href='https://github.com/nostalgiaz/bootstrap-switch/issues') Bug reports
 
     .container.content

+ 48 - 0
src/docs/methods-3.jade

@@ -0,0 +1,48 @@
+extends main
+
+block content
+  h1.page-header
+    | Methods &nbsp;
+    small Version 3 (Stable)
+
+  p In Bootstrap Switch, every option is also a method.
+  p If the second parameter is omitted, the method return the current value.
+  p You can invoke methods as follows:
+  pre: code $('input[name="my-checkbox"]').bootstrapSwitch('state', true, true);
+
+  h2 Additional Methods
+
+  table.table.table-bordered.table-striped.table-responsive
+    thead
+      tr
+        th Name
+        th Description
+    tbody
+      tr
+        td toggleState
+        td Toggle the switch state
+      tr
+        td toggleAnimate
+        td Toggle the animate option
+      tr
+        td toggleDisabled
+        td Toggle the disabled state
+      tr
+        td toggleReadonly
+        td Toggle the readonly state
+      tr
+        td toggleIndeterminate
+        td Toggle the indeterminate state
+      tr
+        td toggleInverse
+        td Toggle the inverse option
+      tr
+        td destroy
+        td Destroy the instance of Bootstrap Switch
+
+  h2 Special Behaviours
+
+  ul
+    li The method <code>state</code> can receive an optional third parameter <code>skip</code>. if true, <code>switchChange</code> event is not executed. The default is false.
+    li The method <code>toggleState</code> can receive an optional second parameter <code>skip</code>. if true, <code>switchChange</code> event is not executed. The default is false.
+    li The method <code>wrapperClass</code> can accepts a falsy value as second parameter. If so, it resets the class to its default.

+ 144 - 0
src/docs/options-3.jade

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