Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
6248b711
Commit
6248b711
authored
Aug 19, 2013
by
Mark Otto
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '3.0.0-wip' of github.com:twbs/bootstrap into 3.0.0-wip
parents
3f87bf46
c2d58612
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
8 deletions
+24
-8
Gruntfile.js
Gruntfile.js
+4
-4
assets/js/customizer.js
assets/js/customizer.js
+16
-2
customize.html
customize.html
+4
-2
No files found.
Gruntfile.js
View file @
6248b711
...
...
@@ -169,7 +169,7 @@ module.exports = function(grunt) {
grunt
.
registerTask
(
'
validate-html
'
,
[
'
jekyll
'
,
'
validation
'
]);
// Test task.
var
testSubtasks
=
[
'
dist-css
'
,
'
jshint
'
,
'
qunit
'
,
'
validate-html
'
];
var
testSubtasks
=
[
'
dist-css
'
,
'
jshint
'
,
'
qunit
'
];
// Only run BrowserStack tests under Travis
if
(
process
.
env
.
TRAVIS
)
{
// Only run BrowserStack tests if this is a mainline commit in twbs/bootstrap, or you have your own BrowserStack key
...
...
@@ -202,7 +202,7 @@ module.exports = function(grunt) {
var
files
=
{}
fs
.
readdirSync
(
type
)
.
filter
(
function
(
path
)
{
return
new
RegExp
(
'
\\
.
'
+
type
+
'
$
'
).
test
(
path
)
return
type
==
'
fonts
'
?
true
:
new
RegExp
(
'
\\
.
'
+
type
+
'
$
'
).
test
(
path
)
})
.
forEach
(
function
(
path
)
{
return
files
[
path
]
=
fs
.
readFileSync
(
type
+
'
/
'
+
path
,
'
utf8
'
)
...
...
@@ -211,7 +211,7 @@ module.exports = function(grunt) {
}
var
customize
=
fs
.
readFileSync
(
'
customize.html
'
,
'
utf-8
'
)
var
files
=
'
<!-- generated -->
\n
<script id="files">
\n
'
+
getFiles
(
'
js
'
)
+
getFiles
(
'
less
'
)
+
'
<
\
/script>
\n
<!-- /generated -->
'
fs
.
writeFileSync
(
'
customize.html
'
,
customize
.
replace
(
/<!-- generated -->
(
.|
[\n\r])
*<!--
\/
generated -->/
,
files
)
)
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
)
});
};
assets/js/customizer.js
View file @
6248b711
...
...
@@ -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
())
...
...
customize.html
View file @
6248b711
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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