{"_id":"bootstrap-toggle","_rev":"12-8ea72bdbc781014cf35ea10a6c65ee48","name":"bootstrap-toggle","description":"Bootstrap Toggle is a highly flexible Bootstrap plugin that converts checkboxes into toggles","dist-tags":{"latest":"2.2.2"},"versions":{"1.1.0":{"name":"bootstrap-toggle","version":"1.1.0","description":"Bootstrap Toggle is a lightweight Bootstrap plugin that allows toggle switches on your pages","main":"js/bootstrap-toggle.js","repository":{"type":"git","url":"https://github.com/minhur/bootstrap-toggle.git"},"keywords":["bootstrap","toggle","bootstrap-toggle","switch","bootstrap-switch"],"author":{"name":"Min Hur","email":"min.hur@nytimes.com"},"license":"MIT","bugs":{"url":"https://github.com/minhur/bootstrap-toggle/issues"},"homepage":"https://github.com/minhur/bootstrap-toggle","gitHead":"8645d553983402917a03d9344f8ecafc42c1f27a","_id":"bootstrap-toggle@1.1.0","scripts":{},"_shasum":"97f7489b38373717e3c5dbf93e51667c58021e02","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"minhur","email":"minhur@gmail.com"},"maintainers":[{"name":"minhur","email":"minhur@gmail.com"}],"dist":{"shasum":"97f7489b38373717e3c5dbf93e51667c58021e02","tarball":"https://registry.npmjs.org/bootstrap-toggle/-/bootstrap-toggle-1.1.0.tgz","integrity":"sha512-w5jN/Whex5wa2qfyQVKFBdXbLOSVg08+FgmnJvlB5vjT7rN8jkFI48qy60hbaITLpLAY7Ie3pSFBVGBsW4+sLQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFwQS8JHOZ8np1ZIC19WzKV3koaVx0b5Wc934rwJSTDUAiEAySnUqS9hMrtPxPX6svXCZHWhphxkhwCuseo5LPuOT4w="}]},"directories":{}},"2.0.0":{"name":"bootstrap-toggle","description":"Bootstrap Toggle is a highly flexible Bootstrap plugin that converts checkboxes into toggles","version":"2.0.0","keywords":["bootstrap","toggle","bootstrap-toggle","switch","bootstrap-switch"],"homepage":"http://www.bootstraptoggle.com","repository":{"type":"git","url":"https://github.com/minhur/bootstrap-toggle.git"},"license":"MIT","author":{"name":"Min Hur","email":"min.hur@gmail.com"},"bugs":{"url":"https://github.com/minhur/bootstrap-toggle/issues"},"devDependencies":{"grunt-contrib-clean":"^0.6.0","grunt-contrib-cssmin":"^0.10.0","grunt-contrib-uglify":"^0.6.0"},"gitHead":"19225b4197c703e18730ae0500ec9df2b00c0e1f","_id":"bootstrap-toggle@2.0.0","scripts":{},"_shasum":"e148409683b568c12ee17cb418d4d14b8c43d88c","_from":".","_npmVersion":"2.0.2","_nodeVersion":"0.10.32","_npmUser":{"name":"minhur","email":"minhur@gmail.com"},"maintainers":[{"name":"minhur","email":"minhur@gmail.com"}],"dist":{"shasum":"e148409683b568c12ee17cb418d4d14b8c43d88c","tarball":"https://registry.npmjs.org/bootstrap-toggle/-/bootstrap-toggle-2.0.0.tgz","integrity":"sha512-zYSfMNQjnPWPFpqUn+NWB98WDZCZNTzvuzVeRTvKdXsc28q7eZYeJRmGNwaDZD5CFMs7knCVFtqf/kl2TV0zWQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCHwqWJtEyTH53tvAfid0fZWsfvD9nNPYdxd12Y3JmvH4CIQD+KrM/GMh8Pmoahy+w0mFwXkO7HWvMt4yN2/uX0Tk6sw=="}]},"directories":{}},"2.2.0":{"name":"bootstrap-toggle","description":"Bootstrap Toggle is a highly flexible Bootstrap plugin that converts checkboxes into toggles","version":"2.2.0","keywords":["bootstrap","toggle","bootstrap-toggle","switch","bootstrap-switch"],"homepage":"http://www.bootstraptoggle.com","repository":{"type":"git","url":"git+https://github.com/minhur/bootstrap-toggle.git"},"license":"MIT","author":{"name":"Min Hur","email":"min.hur@gmail.com"},"bugs":{"url":"https://github.com/minhur/bootstrap-toggle/issues"},"devDependencies":{"grunt-contrib-clean":"^0.6.0","grunt-contrib-cssmin":"^0.10.0","grunt-contrib-uglify":"^0.6.0"},"gitHead":"b674fd956dfdcaacc48e0fd3bcc176a8da434ee6","_id":"bootstrap-toggle@2.2.0","scripts":{},"_shasum":"65c002fef1c613518170d4a73832a250a0222df9","_from":".","_npmVersion":"2.13.1","_nodeVersion":"0.12.7","_npmUser":{"name":"minhur","email":"minhur@gmail.com"},"maintainers":[{"name":"minhur","email":"minhur@gmail.com"}],"dist":{"shasum":"65c002fef1c613518170d4a73832a250a0222df9","tarball":"https://registry.npmjs.org/bootstrap-toggle/-/bootstrap-toggle-2.2.0.tgz","integrity":"sha512-Se6AJ1US6ibBFh82v066FLqQqgTcNZKOATq1W54Y25q1MJJm/GoaCeGv14FYx+mCQXxFXSSKjc/319jr2TNUWA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIECZJw4PuuZZAD+4wwO5VZ+V8qQ1dcN5PLSx34J5SFtwAiEAqaciOFxpbFZzCCZsIUZkB6EID6P3teHuj1w9/lq9bpc="}]},"directories":{}},"2.2.1":{"name":"bootstrap-toggle","description":"Bootstrap Toggle is a highly flexible Bootstrap plugin that converts checkboxes into toggles","version":"2.2.1","keywords":["bootstrap","toggle","bootstrap-toggle","switch","bootstrap-switch"],"homepage":"http://www.bootstraptoggle.com","repository":{"type":"git","url":"git+https://github.com/minhur/bootstrap-toggle.git"},"license":"MIT","author":{"name":"Min Hur","email":"min.hur@gmail.com"},"bugs":{"url":"https://github.com/minhur/bootstrap-toggle/issues"},"devDependencies":{"grunt-contrib-clean":"^0.6.0","grunt-contrib-cssmin":"^0.10.0","grunt-contrib-uglify":"^0.6.0"},"gitHead":"8c21c6653b92afc505c646e370a0fae41c446b6e","_id":"bootstrap-toggle@2.2.1","scripts":{},"_shasum":"37d65ef7d8e46b048320f04a51610cf54e27b3a1","_from":".","_npmVersion":"2.13.1","_nodeVersion":"0.12.7","_npmUser":{"name":"minhur","email":"minhur@gmail.com"},"maintainers":[{"name":"minhur","email":"minhur@gmail.com"}],"dist":{"shasum":"37d65ef7d8e46b048320f04a51610cf54e27b3a1","tarball":"https://registry.npmjs.org/bootstrap-toggle/-/bootstrap-toggle-2.2.1.tgz","integrity":"sha512-4mFVZ1kLsfNXzl3/quZJZMqnerJo4XUknSVMH4HiUj5tEbfWakAGti7xClMZuMhqzFWYTIVtXZ22jzOWUiljhw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDaMpUEHsWVLiHlTDEkj8bdS/3snPb5pYwEaHnPqWufAAiEAhLCdYoSVYI8mO5vkQuJI6aGOBe/rNqMrWJZiw0qiXt8="}]},"directories":{}},"2.2.2":{"name":"bootstrap-toggle","description":"Bootstrap Toggle is a highly flexible Bootstrap plugin that converts checkboxes into toggles","version":"2.2.2","main":"js/bootstrap-toggle.js","keywords":["bootstrap","toggle","bootstrap-toggle","switch","bootstrap-switch"],"homepage":"http://www.bootstraptoggle.com","repository":{"type":"git","url":"git+https://github.com/minhur/bootstrap-toggle.git"},"license":"MIT","author":{"name":"Min Hur","email":"min.hur@gmail.com"},"bugs":{"url":"https://github.com/minhur/bootstrap-toggle/issues"},"devDependencies":{"grunt-contrib-clean":"^0.6.0","grunt-contrib-cssmin":"^0.10.0","grunt-contrib-uglify":"^0.6.0"},"gitHead":"187e332b7431afe3d0c07eeef92782ce59a77d66","_id":"bootstrap-toggle@2.2.2","scripts":{},"_shasum":"2b88534fc1b998674f877f98ba0d8b5b743e96fe","_from":".","_npmVersion":"2.14.20","_nodeVersion":"4.4.0","_npmUser":{"name":"minhur","email":"minhur@gmail.com"},"maintainers":[{"name":"minhur","email":"minhur@gmail.com"}],"dist":{"shasum":"2b88534fc1b998674f877f98ba0d8b5b743e96fe","tarball":"https://registry.npmjs.org/bootstrap-toggle/-/bootstrap-toggle-2.2.2.tgz","integrity":"sha512-AkYD/i3NGCEksIb/PmmUrrxpa0DYi7Si30e9Ldhou2t1HTd9npoXUsxJJjFPvlV7iLUptlysWTcYD7i3DKV6qg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBnDPzXhD9knbixLvZIWzS6PVb6yjvS1NiNGufyJsxDgAiEAoUs4w7IHj4IxujhiteYoKOWyJCfLdlZueZC3kJ13v1Y="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/bootstrap-toggle-2.2.2.tgz_1458250965422_0.4320273296907544"},"directories":{}}},"readme":"# Bootstrap Toggle\nBootstrap Toggle is a highly flexible Bootstrap plugin that converts checkboxes into toggles.\n\nVisit http://www.bootstraptoggle.com for demos.\n\n## Getting Started\n\n### Installation\nYou can [download](https://github.com/minhur/bootstrap-toggle/archive/master.zip) the latest version of Bootstrap Toggle or use CDN to load the library.\n\n`Warning` If you are using Bootstrap v2.3.2, use `bootstrap2-toggle.min.js` and `bootstrap2-toggle.min.css` instead.\n\n```html\n<link href=\"https://gitcdn.github.io/bootstrap-toggle/2.2.0/css/bootstrap-toggle.min.css\" rel=\"stylesheet\">\n<script src=\"https://gitcdn.github.io/bootstrap-toggle/2.2.0/js/bootstrap-toggle.min.js\"></script>\n```\n\n### Bower Install\n```bash\nbower install bootstrap-toggle\n```\n\n## Usage\n\n### Basic example\nSimply add `data-toggle=\"toggle\"` to convert checkboxes into toggles.\n\n```html\n<input type=\"checkbox\" checked data-toggle=\"toggle\">\n```\n\n### Stacked checkboxes\nRefer to Bootstrap Form Controls documentation to create stacked checkboxes. Simply add `data-toggle=\"toggle\"` to convert checkboxes into toggles.\n\n```html\n<div class=\"checkbox\">\n  <label>\n    <input type=\"checkbox\" data-toggle=\"toggle\">\n    Option one is enabled\n  </label>\n</div>\n<div class=\"checkbox disabled\">\n  <label>\n    <input type=\"checkbox\" disabled data-toggle=\"toggle\">\n    Option two is disabled\n  </label>\n</div>\n```\n\n### Inline Checkboxes\nRefer to Bootstrap Form Controls documentation to create inline checkboxes. Simply add `data-toggle=\"toggle\"` to a convert checkboxes into toggles.\n\n```html\n<label class=\"checkbox-inline\">\n  <input type=\"checkbox\" checked data-toggle=\"toggle\"> First\n</label>\n<label class=\"checkbox-inline\">\n  <input type=\"checkbox\" data-toggle=\"toggle\"> Second\n</label>\n<label class=\"checkbox-inline\">\n  <input type=\"checkbox\" data-toggle=\"toggle\"> Third\n</label>\n```\n\n## API\n\n### Initialize by JavaScript\nInitialize toggles with id `toggle-one` with a single line of JavaScript.\n\n```html\n<input id=\"toggle-one\" checked type=\"checkbox\">\n<script>\n  $(function() {\n    $('#toggle-one').bootstrapToggle();\n  })\n</script>\n```\n\n### Options\nOptions can be passed via data attributes or JavaScript. For data attributes, append the option name to `data-`, as in `data-on=\"Enabled\"`.\n\n```html\n<input type=\"checkbox\" data-toggle=\"toggle\" data-on=\"Enabled\" data-off=\"Disabled\">\n<input type=\"checkbox\" id=\"toggle-two\">\n<script>\n  $(function() {\n    $('#toggle-two').bootstrapToggle({\n      on: 'Enabled',\n      off: 'Disabled'\n    });\n  })\n</script>\n```\n\nName|Type|Default|Description|\n---|---|---|---\non|string/html|\"On\"|Text of the on toggle\noff|string/html|\"Off\"|Text of the off toggle\nsize|string|\"normal\"|Size of the toggle. Possible values are `large`, `normal`, `small`, `mini`.\nonstyle|string|\"primary\"|Style of the on toggle. Possible values are `default`, `primary`, `success`, `info`, `warning`, `danger`\noffstyle|string|\"default\"|Style of the off toggle. Possible values are `default`, `primary`, `success`, `info`, `warning`, `danger`\nstyle|string| |Appends the value to the class attribute of the toggle. This can be used to apply custom styles. Refer to Custom Styles for reference.\nwidth|integer|*null*|Sets the width of the toggle. if set to *null*, width will be calculated.\nheight|integer|*null*|Sets the height of the toggle. if set to *null*, height will be calculated.\n\n### Methods\nMethods can be used to control toggles directly.\n\n```html\n<input id=\"toggle-demo\" type=\"checkbox\" data-toggle=\"toggle\">\n```\n\nMethod|Example|Description\n---|---|---\ninitialize|$('#toggle-demo').bootstrapToggle()|Initializes the toggle plugin with options\ndestroy|$('#toggle-demo').bootstrapToggle('destroy')|Destroys the toggle\non|$('#toggle-demo').bootstrapToggle('on')|Sets the toggle to 'On' state\noff|$('#toggle-demo').bootstrapToggle('off')|Sets the toggle to 'Off' state\ntoggle|$('#toggle-demo').bootstrapToggle('toggle')|Toggles the state of the toggle\nenable|$('#toggle-demo').bootstrapToggle('enable')|Enables the toggle\ndisable|$('#toggle-demo').bootstrapToggle('disable')|Disables the toggle\n\n## Events\n\n### Event Propagation\nNote All events are propagated to and from input element to the toggle.\n\nYou should listen to events from the `<input type=\"checkbox\">` directly rather than look for custom events.\n\n```html\n<input id=\"toggle-event\" type=\"checkbox\" data-toggle=\"toggle\">\n<div id=\"console-event\"></div>\n<script>\n  $(function() {\n    $('#toggle-event').change(function() {\n      $('#console-event').html('Toggle: ' + $(this).prop('checked'))\n    })\n  })\n</script>\n```\n\n### API vs Input\nThis also means that using the API or Input to trigger events will work both ways.\n\n```html\n<input id=\"toggle-trigger\" type=\"checkbox\" data-toggle=\"toggle\">\n<button class=\"btn btn-success\" onclick=\"toggleOn()\">On by API</button>\n<button class=\"btn btn-danger\" onclick=\"toggleOff()\">Off by API</button>\n<button class=\"btn btn-success\" onclick=\"toggleOnByInput()\">On by Input</button>\n<button class=\"btn btn-danger\" onclick=\"toggleOffByInput()\">Off by Input</button>\n<script>\n  function toggleOn() {\n    $('#toggle-trigger').bootstrapToggle('on')\n  }\n  function toggleOff() {\n    $('#toggle-trigger').bootstrapToggle('off')  \n  }\n  function toggleOnByInput() {\n    $('#toggle-trigger').prop('checked', true).change()\n  }\n  function toggleOffByInput() {\n    $('#toggle-trigger').prop('checked', false).change()\n  }\n</script>\n```\n\n### Integration\n\n#### [KnockoutJS](http://knockoutjs.com)\n\nA binding for knockout is available here: [aAXEe/knockout-bootstrap-toggle](https://github.com/aAXEe/knockout-bootstrap-toggle)\n\n## Demos\n\nVisit http://www.bootstraptoggle.com for demos.\n","maintainers":[{"name":"minhur","email":"minhur@gmail.com"}],"time":{"modified":"2022-06-13T04:57:42.649Z","created":"2014-06-10T19:59:47.812Z","1.1.0":"2014-06-10T19:59:47.812Z","2.0.0":"2014-10-13T22:24:45.505Z","2.2.0":"2015-08-06T20:23:07.913Z","2.2.1":"2015-08-06T20:25:54.962Z","2.2.2":"2016-03-17T21:42:48.098Z"},"homepage":"http://www.bootstraptoggle.com","keywords":["bootstrap","toggle","bootstrap-toggle","switch","bootstrap-switch"],"repository":{"type":"git","url":"git+https://github.com/minhur/bootstrap-toggle.git"},"author":{"name":"Min Hur","email":"min.hur@gmail.com"},"bugs":{"url":"https://github.com/minhur/bootstrap-toggle/issues"},"license":"MIT","readmeFilename":"README.md","users":{"rocket0191":true,"noxracing":true,"yuch4n":true}}