Jelajahi Sumber

remove local jQuery and update documentation

Mattia Larentis 12 tahun lalu
induk
melakukan
72bcf83945
3 mengubah file dengan 30 tambahan dan 71 penghapusan
  1. 28 68
      README.md
  2. 2 2
      examples/index.html
  3. 0 1
      static/js/jquery.min.js

+ 28 - 68
README.md

@@ -3,103 +3,63 @@ Bootstrap-toggle-buttons
 
 Demo
 ----
-http://www.larentis.eu/bootstrap_toggle_buttons/
+http://www.larentis.eu/switch/
 
 Usage
 -----
 
-Just include Twitter Bootstrap, jQuery and Bootstrap Toggle Buttons CSS and Javascript
+Just include Twitter Bootstrap, jQuery, Bootstrap Switch CSS and Javascript
 ``` html
 <link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet">
-<link href="bootstrap-toggle-buttons.css" rel="stylesheet">
+<link href="bootstrap-switch.css" rel="stylesheet">
 
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-<script src="jquery.toggle.buttons.js"></script>
+<script src="jquery.switch.js"></script>
 ```
 
 Basic Example
 -------------
 
-HTML
 ``` html
-<div id="toggle-button">
-    <input id="checkbox1" type="checkbox" value="value1" checked="checked">
+<div class="switch">
+    <input type="checkbox">
 </div>
 ```
 
-JS
-``` javascript
-$('#toggle-button').toggleButtons();
-```
-
-Full Example
-------------
+Large, small or mini
+--------------------
 
-HTML
 ``` html
-<div id="toggle-button">
-    <input id="checkbox1" type="checkbox" value="value1" checked="checked">
+<div class="switch switch-large">  <!-- switch-small or switch-mini -->
+    <input type="checkbox">
 </div>
 ```
 
-JS
-``` javascript
-$('#toggle-button').toggleButtons({
-  onChange: function ($el, status, e) {
-    // $el = $('#toggle-button'); 
-    // status = [true, false], the value of the checkbox
-    // e = the event
-    console.log($el, status, e); 
-  },
-  width: 100,
-  height: 25,
-  font: {
-    'font-size': '20px',
-    'font-style': 'italic'
-  },
-  animated: true,
-  transitionspeed: 1, // Accepted values float or "percent" [ 1, 0.5, "150%" ]
-  label: {
-    enabled: "ON",
-    disabled: "OFF"
-  },
-  style: {
-    // Accepted values ["primary", "danger", "info", "success", "warning"] or nothing
-    enabled: "primary",
-    disabled: "danger",
-    custom: {
-      enabled: {
-        background:"#FF00FF",
-        gradient: "#D300D3",
-        color: "#FFFFFF"
-      },
-      disabled: {
-        background: "#FFAA00",
-        gradient: "#DD9900",
-        color: "#333333"
-      }
-    }
-  }
-});
+Data attributes
+---------------
 
-$('#toggle-button').toggleButtons('toggleActivation'); // to toggle the disabled status
+``` html
+<div class="switch" data-on="danger" data-off="warning">  <!-- primary, info, success, warning and danger -->
+    <input type="checkbox">
+</div>
 ```
 
-Data Attributes Example
------------------------
+Initial values
+--------------
 
-HTML
 ``` html
-<div id="data-attribute-toggle-button"
-     data-toggleButton-width="170"
-     data-toggleButton-transitionspeed="500%"
-     data-toggleButton-style-custom-enabled-background="#FF0000"
-     data-toggleButton-style-custom-enabled-gradient="#000000">
-    <input type="checkbox" checked="checked">
+<div class="switch">
+    <input type="checkbox" checked="checked" disabled="disabled">
 </div>
 ```
 
-JS
+Event handler
+-------------
+
 ``` javascript
-$('#data-attribute-toggle-button').toggleButtons();
+$('#mySwitch').on('switch-change', function (e, data) {
+    var $el = $(data.el)
+      , value = data.value;
+    console.log(e, $el, value);
+});
 ```

+ 2 - 2
examples/index.html

@@ -26,7 +26,7 @@
     </style>
 </head>
 <body style="padding-top: 50px;">
-<a href="https://github.com/nostalgiaz/bootstrap-toggle-buttons"><img
+<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>
@@ -147,7 +147,7 @@ $('#mySwitch').on('switch-change', function (e, data) {
     window.prettyPrint && prettyPrint();
     $('#mySwitch').on('switch-change', function (e, data) {
         var $el = $(data.el)
-                , value = data.value;
+          , value = data.value;
         console.log(e, $el, value);
     });
 </script>

File diff ditekan karena terlalu besar
+ 0 - 1
static/js/jquery.min.js


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini