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
58a47b6b
Commit
58a47b6b
authored
Sep 14, 2013
by
Stuart P. Bentley
Committed by
Chris Rebert
Oct 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Customizer: include config.json in bootstrap.zip
merges #10633; fixes part of #9951
parent
d820c6d2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
docs-assets/js/customizer.js
docs-assets/js/customizer.js
+12
-5
No files found.
docs-assets/js/customizer.js
View file @
58a47b6b
...
@@ -31,13 +31,13 @@ window.onload = function () { // wait for load in a dumb way because B-0
...
@@ -31,13 +31,13 @@ window.onload = function () { // wait for load in a dumb way because B-0
return
match
&&
decodeURIComponent
(
match
[
1
].
replace
(
/
\+
/g
,
"
"
));
return
match
&&
decodeURIComponent
(
match
[
1
].
replace
(
/
\+
/g
,
"
"
));
}
}
function
createGist
(
config
Data
)
{
function
createGist
(
config
Json
)
{
var
data
=
{
var
data
=
{
"
description
"
:
"
Bootstrap Customizer Config
"
,
"
description
"
:
"
Bootstrap Customizer Config
"
,
"
public
"
:
true
,
"
public
"
:
true
,
"
files
"
:
{
"
files
"
:
{
"
config.json
"
:
{
"
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
...
@@ -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
,
co
nfig
,
co
mplete
)
{
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
()
...
@@ -133,6 +133,10 @@ window.onload = function () { // wait for load in a dumb way because B-0
...
@@ -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
"
})
var
content
=
zip
.
generate
({
type
:
"
blob
"
})
complete
(
content
)
complete
(
content
)
...
@@ -262,14 +266,17 @@ window.onload = function () { // wait for load in a dumb way because B-0
...
@@ -262,14 +266,17 @@ window.onload = function () { // wait for load in a dumb way because B-0
var
$downloadBtn
=
$
(
'
#btn-download
'
)
var
$downloadBtn
=
$
(
'
#btn-download
'
)
$compileBtn
.
on
(
'
click
'
,
function
(
e
)
{
$compileBtn
.
on
(
'
click
'
,
function
(
e
)
{
var
configData
=
getCustomizerData
()
var
configJson
=
JSON
.
stringify
(
configData
,
null
,
2
)
e
.
preventDefault
()
e
.
preventDefault
()
$compileBtn
.
attr
(
'
disabled
'
,
'
disabled
'
)
$compileBtn
.
attr
(
'
disabled
'
,
'
disabled
'
)
generateZip
(
generateCSS
(),
generateJavascript
(),
generateFonts
(),
function
(
blob
)
{
generateZip
(
generateCSS
(),
generateJavascript
(),
generateFonts
(),
configJson
,
function
(
blob
)
{
$compileBtn
.
removeAttr
(
'
disabled
'
)
$compileBtn
.
removeAttr
(
'
disabled
'
)
saveAs
(
blob
,
"
bootstrap.zip
"
)
saveAs
(
blob
,
"
bootstrap.zip
"
)
createGist
(
getCustomizerData
()
)
createGist
(
configJson
)
})
})
})
})
...
...
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