}
}
- // javascript build logic
-
- var inputs = $("#javascript input")
-
- // toggle all plugin checkboxes
- $('#selectAll').on('click', function (e) {
- e.preventDefault()
- inputs.attr('checked', !inputs.is(':checked'))
- })
-
- // handle build button dropdown
- var buildTypes = $('#javascriptBuilder .dropdown-menu li').on('click', function () {
- buildTypes.removeClass('active')
- $(this).addClass('active')
- })
-
- // request built javascript
- $('#javascriptBuild').on('click', function () {
-
- var names = $("#javascript input:checked")
- .map(function () { return this.value })
- .toArray()
-
- if (names[names.length - 1] == 'bootstrap-transition.js') {
- names.unshift(names.pop())
- }
-
- $.ajax({
- type: 'POST'
- , dataType: 'jsonpi'
- , params: {
- branch: '2.0-wip'
- , dir: 'js'
- , filenames: names
- , compress: buildTypes.first().hasClass('active')
- }
- , url: "http://bootstrap.herokuapp.com"
- })
- })
-
+
// fix sub nav playa
var $win = $(window)
, $nav = $('.subnav')
}
}
})
-}(jQuery);
\ No newline at end of file
+}(jQuery);
+
+ // javascript build logic
+
+$(function () {
+
+ var inputsComponent = $("#components.download input")
+ , inputsPlugin = $("#plugins.download input")
+
+ // toggle all plugin checkboxes
+ $('#components.download .toggle-all').on('click', function (e) {
+ e.preventDefault()
+ inputsComponent.attr('checked', !inputsComponent.is(':checked'))
+ })
+
+ $('#plugins.download .toggle-all').on('click', function (e) {
+ e.preventDefault()
+ inputsPlugin.attr('checked', !inputsPlugin.is(':checked'))
+ })
+
+ // request built javascript
+ $('.download-btn').on('click', function () {
+
+ var comp = $("#components.download input:checked")
+ .map(function () { return this.value })
+ .toArray()
+ , plug = $("#plugins.download input:checked")
+ .map(function () { return this.value })
+ .toArray()
+
+
+
+ $.ajax({
+ type: 'POST'
+ , dataType: 'jsonpi'
+ , params: {
+ branch: '2.0-wip'
+ , dir: 'js'
+ , filenames: names
+ , compress: buildTypes.first().hasClass('active')
+ }
+ , url: "http://bootstrap.herokuapp.com"
+ })
+ })
+
+})
+
</div>
<div class="row download-builder">
<div class="span4">
+ <label class="checkbox">
+ <input type="checkbox" checked="true" value="bootstrap-transition.js">
+ Transitions <small>(required for any animation)</small>
+ </label>
<label class="checkbox">
<input type="checkbox" checked="true" value="bootstrap-modal.js">
Modals
<input type="checkbox" checked="true" value="bootstrap-tooltip.js">
Tooltips
</label>
+ </div><!-- /span -->
+ <div class="span4">
<label class="checkbox">
<input type="checkbox" checked="true" value="bootstrap-popover.js">
Popovers <small>(requires Tooltips)</small>
</label>
- </div><!-- /span -->
- <div class="span4">
<label class="checkbox">
<input type="checkbox" checked="true" value="bootstrap-alert.js">
Alert messages
<input type="checkbox" checked="true" value="bootstrap-typeahead.js">
Typeahead
</label>
- <label class="checkbox">
- <input type="checkbox" checked="true" value="bootstrap-transition.js">
- Transitions <small>(required for any animation)</small>
- </label>
</div><!-- /span -->
<div class="span4">
<h4 class="muted">Heads up!</h4>
</div>
<div class="row download-builder">
<div class="span4">
+ <label class="checkbox">
+ <input type="checkbox" checked="true" value="bootstrap-transition.js">
+ Transitions <small>(required for any animation)</small>
+ </label>
<label class="checkbox">
<input type="checkbox" checked="true" value="bootstrap-modal.js">
Modals
<input type="checkbox" checked="true" value="bootstrap-tooltip.js">
Tooltips
</label>
+ </div><!-- /span -->
+ <div class="span4">
<label class="checkbox">
<input type="checkbox" checked="true" value="bootstrap-popover.js">
Popovers <small>(requires Tooltips)</small>
</label>
- </div><!-- /span -->
- <div class="span4">
<label class="checkbox">
<input type="checkbox" checked="true" value="bootstrap-alert.js">
Alert messages
<input type="checkbox" checked="true" value="bootstrap-typeahead.js">
Typeahead
</label>
- <label class="checkbox">
- <input type="checkbox" checked="true" value="bootstrap-transition.js">
- Transitions <small>(required for any animation)</small>
- </label>
</div><!-- /span -->
<div class="span4">
<h4 class="muted">Heads up!</h4>