diff options
| author | Stuart P. Bentley <[email protected]> | 2013-09-14 04:26:42 -0400 |
|---|---|---|
| committer | Chris Rebert <[email protected]> | 2013-10-09 17:35:26 -0700 |
| commit | 58a47b6bfd274e7018316c0ea77ce0ca40a7e53f (patch) | |
| tree | 167aefb1fa5c67b2bc33d86309294adc4234949d /docs-assets | |
| parent | d820c6d22580119f6fb631c365c47f7be6e5db5b (diff) | |
| download | bootstrap-58a47b6bfd274e7018316c0ea77ce0ca40a7e53f.tar.xz bootstrap-58a47b6bfd274e7018316c0ea77ce0ca40a7e53f.zip | |
Customizer: include config.json in bootstrap.zip
merges #10633; fixes part of #9951
Diffstat (limited to 'docs-assets')
| -rw-r--r-- | docs-assets/js/customizer.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/docs-assets/js/customizer.js b/docs-assets/js/customizer.js index 5abfe4228..cc772d222 100644 --- a/docs-assets/js/customizer.js +++ b/docs-assets/js/customizer.js @@ -31,13 +31,13 @@ window.onload = function () { // wait for load in a dumb way because B-0 return match && decodeURIComponent(match[1].replace(/\+/g, " ")); } - function createGist(configData) { + function createGist(configJson) { var data = { "description": "Bootstrap Customizer Config", "public": true, "files": { "config.json": { - "content": JSON.stringify(configData, null, 2) + "content": configJson } } } @@ -107,7 +107,7 @@ window.onload = function () { // wait for load in a dumb way because B-0 }) } - function generateZip(css, js, fonts, complete) { + function generateZip(css, js, fonts, config, complete) { if (!css && !js) return showError('<strong>Ruh roh!</strong> No Bootstrap files selected.', new Error('no Bootstrap')) var zip = new JSZip() @@ -133,6 +133,10 @@ window.onload = function () { // wait for load in a dumb way because B-0 } } + if (config) { + zip.file('config.json', config) + } + var content = zip.generate({type:"blob"}) complete(content) @@ -262,14 +266,17 @@ window.onload = function () { // wait for load in a dumb way because B-0 var $downloadBtn = $('#btn-download') $compileBtn.on('click', function (e) { + var configData = getCustomizerData() + var configJson = JSON.stringify(configData, null, 2) + e.preventDefault() $compileBtn.attr('disabled', 'disabled') - generateZip(generateCSS(), generateJavascript(), generateFonts(), function (blob) { + generateZip(generateCSS(), generateJavascript(), generateFonts(), configJson, function (blob) { $compileBtn.removeAttr('disabled') saveAs(blob, "bootstrap.zip") - createGist(getCustomizerData()) + createGist(configJson) }) }) |
