mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-11 16:14:04 +02:00
some js for javascript for builder (stil incomplete)
This commit is contained in:
@@ -76,46 +76,7 @@ $(function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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
|
// fix sub nav playa
|
||||||
var $win = $(window)
|
var $win = $(window)
|
||||||
, $nav = $('.subnav')
|
, $nav = $('.subnav')
|
||||||
@@ -201,4 +162,50 @@ $(function () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}(jQuery);
|
}(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"
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
@@ -230,6 +230,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row download-builder">
|
<div class="row download-builder">
|
||||||
<div class="span4">
|
<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">
|
<label class="checkbox">
|
||||||
<input type="checkbox" checked="true" value="bootstrap-modal.js">
|
<input type="checkbox" checked="true" value="bootstrap-modal.js">
|
||||||
Modals
|
Modals
|
||||||
@@ -250,12 +254,12 @@
|
|||||||
<input type="checkbox" checked="true" value="bootstrap-tooltip.js">
|
<input type="checkbox" checked="true" value="bootstrap-tooltip.js">
|
||||||
Tooltips
|
Tooltips
|
||||||
</label>
|
</label>
|
||||||
|
</div><!-- /span -->
|
||||||
|
<div class="span4">
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input type="checkbox" checked="true" value="bootstrap-popover.js">
|
<input type="checkbox" checked="true" value="bootstrap-popover.js">
|
||||||
Popovers <small>(requires Tooltips)</small>
|
Popovers <small>(requires Tooltips)</small>
|
||||||
</label>
|
</label>
|
||||||
</div><!-- /span -->
|
|
||||||
<div class="span4">
|
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input type="checkbox" checked="true" value="bootstrap-alert.js">
|
<input type="checkbox" checked="true" value="bootstrap-alert.js">
|
||||||
Alert messages
|
Alert messages
|
||||||
@@ -276,10 +280,6 @@
|
|||||||
<input type="checkbox" checked="true" value="bootstrap-typeahead.js">
|
<input type="checkbox" checked="true" value="bootstrap-typeahead.js">
|
||||||
Typeahead
|
Typeahead
|
||||||
</label>
|
</label>
|
||||||
<label class="checkbox">
|
|
||||||
<input type="checkbox" checked="true" value="bootstrap-transition.js">
|
|
||||||
Transitions <small>(required for any animation)</small>
|
|
||||||
</label>
|
|
||||||
</div><!-- /span -->
|
</div><!-- /span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h4 class="muted">Heads up!</h4>
|
<h4 class="muted">Heads up!</h4>
|
||||||
|
12
docs/templates/pages/download.mustache
vendored
12
docs/templates/pages/download.mustache
vendored
@@ -165,6 +165,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row download-builder">
|
<div class="row download-builder">
|
||||||
<div class="span4">
|
<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">
|
<label class="checkbox">
|
||||||
<input type="checkbox" checked="true" value="bootstrap-modal.js">
|
<input type="checkbox" checked="true" value="bootstrap-modal.js">
|
||||||
Modals
|
Modals
|
||||||
@@ -185,12 +189,12 @@
|
|||||||
<input type="checkbox" checked="true" value="bootstrap-tooltip.js">
|
<input type="checkbox" checked="true" value="bootstrap-tooltip.js">
|
||||||
Tooltips
|
Tooltips
|
||||||
</label>
|
</label>
|
||||||
|
</div><!-- /span -->
|
||||||
|
<div class="span4">
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input type="checkbox" checked="true" value="bootstrap-popover.js">
|
<input type="checkbox" checked="true" value="bootstrap-popover.js">
|
||||||
Popovers <small>(requires Tooltips)</small>
|
Popovers <small>(requires Tooltips)</small>
|
||||||
</label>
|
</label>
|
||||||
</div><!-- /span -->
|
|
||||||
<div class="span4">
|
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input type="checkbox" checked="true" value="bootstrap-alert.js">
|
<input type="checkbox" checked="true" value="bootstrap-alert.js">
|
||||||
Alert messages
|
Alert messages
|
||||||
@@ -211,10 +215,6 @@
|
|||||||
<input type="checkbox" checked="true" value="bootstrap-typeahead.js">
|
<input type="checkbox" checked="true" value="bootstrap-typeahead.js">
|
||||||
Typeahead
|
Typeahead
|
||||||
</label>
|
</label>
|
||||||
<label class="checkbox">
|
|
||||||
<input type="checkbox" checked="true" value="bootstrap-transition.js">
|
|
||||||
Transitions <small>(required for any animation)</small>
|
|
||||||
</label>
|
|
||||||
</div><!-- /span -->
|
</div><!-- /span -->
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<h4 class="muted">Heads up!</h4>
|
<h4 class="muted">Heads up!</h4>
|
||||||
|
Reference in New Issue
Block a user