diff options
author | Jacob Thornton <jacobthornton@gmail.com> | 2012-01-27 04:12:34 +0400 |
---|---|---|
committer | Jacob Thornton <jacobthornton@gmail.com> | 2012-01-27 04:12:34 +0400 |
commit | d531f72645b72d648d52bd56698a80fcfff38043 (patch) | |
tree | 93e07bd2ac1e5caa479f4ff09317ce2f8278fca6 /docs/assets/js/application.js | |
parent | d8e1001836f869436df2de2905411b2236c8cbad (diff) |
some js for javascript for builder (stil incomplete)
Diffstat (limited to 'docs/assets/js/application.js')
-rw-r--r-- | docs/assets/js/application.js | 89 |
1 files changed, 48 insertions, 41 deletions
diff --git a/docs/assets/js/application.js b/docs/assets/js/application.js index 84227f5557..898a49d9a9 100644 --- a/docs/assets/js/application.js +++ b/docs/assets/js/application.js @@ -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 var $win = $(window) , $nav = $('.subnav') @@ -201,4 +162,50 @@ $(function () { } } }) -}(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" + }) + }) + +}) + |