Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
c64a8cfc
Commit
c64a8cfc
authored
11 years ago
by
fat
Browse files
Options
Download
Email Patches
Plain Diff
add glyphicons to customizer
parent
c15b259f
No related merge requests found
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Gruntfile.js
+3
-3
Gruntfile.js
assets/js/customizer.js
+16
-2
assets/js/customizer.js
customize.html
+4
-2
customize.html
validation-status.json
+1
-0
validation-status.json
with
24 additions
and
7 deletions
+24
-7
Gruntfile.js
+
3
-
3
View file @
c64a8cfc
...
@@ -202,7 +202,7 @@ module.exports = function(grunt) {
...
@@ -202,7 +202,7 @@ module.exports = function(grunt) {
var
files
=
{}
var
files
=
{}
fs
.
readdirSync
(
type
)
fs
.
readdirSync
(
type
)
.
filter
(
function
(
path
)
{
.
filter
(
function
(
path
)
{
return
new
RegExp
(
'
\\
.
'
+
type
+
'
$
'
).
test
(
path
)
return
type
==
'
fonts
'
?
true
:
new
RegExp
(
'
\\
.
'
+
type
+
'
$
'
).
test
(
path
)
})
})
.
forEach
(
function
(
path
)
{
.
forEach
(
function
(
path
)
{
return
files
[
path
]
=
fs
.
readFileSync
(
type
+
'
/
'
+
path
,
'
utf8
'
)
return
files
[
path
]
=
fs
.
readFileSync
(
type
+
'
/
'
+
path
,
'
utf8
'
)
...
@@ -211,7 +211,7 @@ module.exports = function(grunt) {
...
@@ -211,7 +211,7 @@ module.exports = function(grunt) {
}
}
var
customize
=
fs
.
readFileSync
(
'
customize.html
'
,
'
utf-8
'
)
var
customize
=
fs
.
readFileSync
(
'
customize.html
'
,
'
utf-8
'
)
var
files
=
'
<!-- generated -->
\n
<script id="files">
\n
'
+
getFiles
(
'
js
'
)
+
getFiles
(
'
less
'
)
+
'
<
\
/script>
\n
<!-- /generated -->
'
var
files
=
'
<!-- generated -->
\n
<script id="files">
\n
'
+
getFiles
(
'
js
'
)
+
getFiles
(
'
less
'
)
+
getFiles
(
'
fonts
'
)
+
'
<
\
/script>
\n
<!-- /generated -->
'
fs
.
writeFileSync
(
'
customize.html
'
,
customize
.
replace
(
/<!-- generated -->
(
.|
[\n\r])
*<!--
\/
generated -->/
,
files
)
)
fs
.
writeFileSync
(
'
customize.html
'
,
customize
.
replace
(
/<!-- generated -->
(
.|
[\n\r])
*<!--
\/
generated -->/
,
''
)
+
files
)
});
});
};
};
This diff is collapsed.
Click to expand it.
assets/js/customizer.js
+
16
-
2
View file @
c64a8cfc
...
@@ -107,7 +107,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
...
@@ -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
'
))
if
(
!
css
&&
!
js
)
return
showError
(
'
<strong>Ruh roh!</strong> No Bootstrap files selected.
'
,
new
Error
(
'
no Bootstrap
'
))
var
zip
=
new
JSZip
()
var
zip
=
new
JSZip
()
...
@@ -126,6 +126,13 @@ window.onload = function () { // wait for load in a dumb way because B-0
...
@@ -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
"
})
var
content
=
zip
.
generate
({
type
:
"
blob
"
})
complete
(
content
)
complete
(
content
)
...
@@ -141,6 +148,13 @@ window.onload = function () { // wait for load in a dumb way because B-0
...
@@ -141,6 +148,13 @@ window.onload = function () { // wait for load in a dumb way because B-0
return
result
+
'
\n\n
'
return
result
+
'
\n\n
'
}
}
function
generateFonts
()
{
var
glyphicons
=
$
(
'
#less-section [value="glyphicons.less"]:checked
'
)
if
(
glyphicons
.
length
)
{
return
__fonts
}
}
function
generateCSS
()
{
function
generateCSS
()
{
var
$checked
=
$
(
'
#less-section input:checked
'
)
var
$checked
=
$
(
'
#less-section input:checked
'
)
...
@@ -252,7 +266,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
...
@@ -252,7 +266,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
$compileBtn
.
attr
(
'
disabled
'
,
'
disabled
'
)
$compileBtn
.
attr
(
'
disabled
'
,
'
disabled
'
)
generateZip
(
generateCSS
(),
generateJavascript
(),
function
(
blob
)
{
generateZip
(
generateCSS
(),
generateJavascript
(),
generateFonts
(),
function
(
blob
)
{
$compileBtn
.
removeAttr
(
'
disabled
'
)
$compileBtn
.
removeAttr
(
'
disabled
'
)
saveAs
(
blob
,
"
bootstrap.zip
"
)
saveAs
(
blob
,
"
bootstrap.zip
"
)
createGist
(
getCustomizerData
())
createGist
(
getCustomizerData
())
...
...
This diff is collapsed.
Click to expand it.
customize.html
+
4
-
2
View file @
c64a8cfc
This diff is collapsed.
Click to expand it.
validation-status.json
0 → 100644
+
1
-
0
View file @
c64a8cfc
{
"_gh_pages/components/index.html"
:
true
,
"_gh_pages/css/index.html"
:
true
,
"_gh_pages/customize/index.html"
:
true
,
"_gh_pages/examples/carousel/index.html"
:
true
,
"_gh_pages/examples/grid/index.html"
:
true
,
"_gh_pages/examples/jumbotron-narrow/index.html"
:
true
,
"_gh_pages/examples/jumbotron/index.html"
:
true
,
"_gh_pages/examples/justified-nav/index.html"
:
true
,
"_gh_pages/examples/navbar-fixed-top/index.html"
:
true
,
"_gh_pages/examples/navbar-static-top/index.html"
:
true
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets