diff options
| author | Mark Otto <[email protected]> | 2012-01-11 21:59:33 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2012-01-11 21:59:33 -0800 |
| commit | 620d987f9f4a6e5d7bcf270159aea10e01d32a35 (patch) | |
| tree | ba4f28d0061aed2585591ed4455fd58169e2adfc /docs/assets | |
| parent | 32c628725924ca014df208fa57de4c5a4050733e (diff) | |
| parent | 19090ea33322e9d4309497f838f8627ca21734bf (diff) | |
| download | bootstrap-620d987f9f4a6e5d7bcf270159aea10e01d32a35.tar.xz bootstrap-620d987f9f4a6e5d7bcf270159aea10e01d32a35.zip | |
Merge branch '2.0-wip' of github.com:twitter/bootstrap into 2.0-wip
Conflicts:
bootstrap.css
Diffstat (limited to 'docs/assets')
| -rw-r--r-- | docs/assets/css/docs.css | 9 | ||||
| -rw-r--r-- | docs/assets/js/application.js | 83 |
2 files changed, 87 insertions, 5 deletions
diff --git a/docs/assets/css/docs.css b/docs/assets/css/docs.css index f37067203..134224e56 100644 --- a/docs/assets/css/docs.css +++ b/docs/assets/css/docs.css @@ -466,7 +466,7 @@ form.well { /* Icons ------------------------- */ .the-icons { - + } .the-icons i { display: block; @@ -481,6 +481,13 @@ form.well { width: 100px; } +#javascript input[type='checkbox'] { +display: inline; +margin-left: 6px; +position: relative; +top: -1px; +} + /* Responsive Docs -------------------------------------------------- */ diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index c31fc97a0..0e14a5350 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -48,18 +48,18 @@ $(function(){ setTimeout(function () { $(el).select() }, 0) }) - if ($.fn.twipsy) { + if ($.fn.tooltip) { // position static twipsies for components page if ($(".twipsies a").length) { $(window).on('load resize', function () { $(".twipsies a").each(function () { $(this) - .twipsy({ + .tooltip({ placement: $(this).attr('title') , trigger: 'manual' }) - .twipsy('show') + .tooltip('show') }) }) } @@ -67,7 +67,7 @@ $(function(){ // add tipsies to grid for scaffolding if ($('#grid-system').length) { - $('#grid-system').twipsy({ + $('#grid-system').tooltip({ selector: '.show-grid > div' , title: function () { return $(this).width() + 'px' } }) @@ -75,4 +75,79 @@ $(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" + }) + }) + }) + + +// Modified from the original jsonpi https://github.com/benvinegar/jquery-jsonpi +// by the talented Ben Vinegar +!function($) { + $.ajaxTransport('jsonpi', function(opts, originalOptions, jqXHR) { + var url = opts.url; + + return { + send: function(_, completeCallback) { + var name = 'jQuery_iframe_' + jQuery.now(), + iframe, form; + + iframe = $('<iframe>') + .attr('name', name) + .appendTo('head'); + + form = $('<form>') + .attr('method', opts.type) // GET or POST + .attr('action', url) + .attr('target', name); + + $.each(opts.params, function(k, v) { + $('<input>') + .attr('type', 'hidden') + .attr('name', k) + .attr('value', v) + .appendTo(form); + }); + + form.appendTo('body').submit(); + } + }; + }); +}(jQuery);
\ No newline at end of file |
