1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-26 13:29:06 +02:00

add glyphicons to customizer

This commit is contained in:
fat
2013-08-19 12:19:00 -07:00
parent c15b259f43
commit c64a8cfc72
4 changed files with 24 additions and 7 deletions

View File

@@ -107,7 +107,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
})
}
function generateZip(css, js, complete) {
function generateZip(css, js, fonts, complete) {
if (!css && !js) return showError('<strong>Ruh roh!</strong> No Bootstrap files selected.', new Error('no Bootstrap'))
var zip = new JSZip()
@@ -126,6 +126,13 @@ window.onload = function () { // wait for load in a dumb way because B-0
}
}
if (fonts) {
var fontsFolder = zip.folder('fonts')
for (var fileName in fonts) {
fontsFolder.file(fileName, fonts[fileName])
}
}
var content = zip.generate({type:"blob"})
complete(content)
@@ -141,6 +148,13 @@ window.onload = function () { // wait for load in a dumb way because B-0
return result + '\n\n'
}
function generateFonts() {
var glyphicons = $('#less-section [value="glyphicons.less"]:checked')
if (glyphicons.length) {
return __fonts
}
}
function generateCSS() {
var $checked = $('#less-section input:checked')
@@ -252,7 +266,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
$compileBtn.attr('disabled', 'disabled')
generateZip(generateCSS(), generateJavascript(), function (blob) {
generateZip(generateCSS(), generateJavascript(), generateFonts(), function (blob) {
$compileBtn.removeAttr('disabled')
saveAs(blob, "bootstrap.zip")
createGist(getCustomizerData())