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
5458134f
Commit
5458134f
authored
Mar 27, 2014
by
Chris Rebert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Gist & Customizer URLs to customized files & config.json
Fixes #9951 Fixes #12865
parent
440cedee
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
12 deletions
+27
-12
Gruntfile.js
Gruntfile.js
+3
-0
docs/assets/js/_src/customizer.js
docs/assets/js/_src/customizer.js
+24
-12
No files found.
Gruntfile.js
View file @
5458134f
...
...
@@ -78,6 +78,9 @@ module.exports = function (grunt) {
src
:
'
<%= jshint.test.src %>
'
},
assets
:
{
options
:
{
requireCamelCaseOrUpperCaseIdentifiers
:
null
},
src
:
'
<%= jshint.assets.src %>
'
}
},
...
...
docs/assets/js/_src/customizer.js
View file @
5458134f
...
...
@@ -43,7 +43,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
return
match
&&
decodeURIComponent
(
match
[
1
].
replace
(
/
\+
/g
,
'
'
))
}
function
createGist
(
configJson
)
{
function
createGist
(
configJson
,
callback
)
{
var
data
=
{
description
:
'
Bootstrap Customizer Config
'
,
'
public
'
:
true
,
...
...
@@ -61,10 +61,13 @@ window.onload = function () { // wait for load in a dumb way because B-0
})
.
success
(
function
(
result
)
{
var
origin
=
window
.
location
.
protocol
+
'
//
'
+
window
.
location
.
host
history
.
replaceState
(
false
,
document
.
title
,
origin
+
window
.
location
.
pathname
+
'
?id=
'
+
result
.
id
)
var
newUrl
=
origin
+
window
.
location
.
pathname
+
'
?id=
'
+
result
.
id
history
.
replaceState
(
false
,
document
.
title
,
newUrl
)
callback
(
result
.
html_url
,
newUrl
)
})
.
error
(
function
(
err
)
{
showError
(
'
<strong>Ruh roh!</strong> Could not save gist file, configuration not saved.
'
,
err
)
callback
(
'
<none>
'
,
'
<none>
'
)
})
}
...
...
@@ -221,7 +224,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
})
}
function
generateCSS
()
{
function
generateCSS
(
preamble
)
{
var
oneChecked
=
false
var
lessFileIncludes
=
{}
$
(
'
#less-section input
'
).
each
(
function
()
{
...
...
@@ -242,8 +245,8 @@ window.onload = function () { // wait for load in a dumb way because B-0
$
(
this
).
val
()
&&
(
vars
[
$
(
this
).
prev
().
text
()]
=
$
(
this
).
val
())
})
var
bsLessSource
=
generateLESS
(
'
bootstrap.less
'
,
lessFileIncludes
,
vars
)
var
themeLessSource
=
generateLESS
(
'
theme.less
'
,
lessFileIncludes
,
vars
)
var
bsLessSource
=
preamble
+
generateLESS
(
'
bootstrap.less
'
,
lessFileIncludes
,
vars
)
var
themeLessSource
=
preamble
+
generateLESS
(
'
theme.less
'
,
lessFileIncludes
,
vars
)
try
{
compileLESS
(
bsLessSource
,
'
bootstrap
'
,
result
)
...
...
@@ -255,7 +258,7 @@ window.onload = function () { // wait for load in a dumb way because B-0
return
result
}
function
generateJavascript
()
{
function
generateJavascript
(
preamble
)
{
var
$checked
=
$
(
'
#plugin-section input:checked
'
)
if
(
!
$checked
.
length
)
return
false
...
...
@@ -265,8 +268,8 @@ window.onload = function () { // wait for load in a dumb way because B-0
.
join
(
'
\n
'
)
return
{
'
bootstrap.js
'
:
js
,
'
bootstrap.min.js
'
:
cw
+
uglify
(
js
)
'
bootstrap.js
'
:
preamble
+
js
,
'
bootstrap.min.js
'
:
preamble
+
cw
+
uglify
(
js
)
}
}
...
...
@@ -322,10 +325,19 @@ window.onload = function () { // wait for load in a dumb way because B-0
$compileBtn
.
attr
(
'
disabled
'
,
'
disabled
'
)
generateZip
(
generateCSS
(),
generateJavascript
(),
generateFonts
(),
configJson
,
function
(
blob
)
{
createGist
(
configJson
,
function
(
gistUrl
,
customizerUrl
)
{
configData
.
customizerUrl
=
customizerUrl
configJson
=
JSON
.
stringify
(
configData
,
null
,
2
)
var
preamble
=
'
/*!
\n
'
+
'
* Generated using the Bootstrap Customizer (
'
+
customizerUrl
+
'
)
\n
'
+
'
* Config saved to config.json and
'
+
gistUrl
+
'
\n
'
+
'
*/
\n
'
generateZip
(
generateCSS
(
preamble
),
generateJavascript
(
preamble
),
generateFonts
(),
configJson
,
function
(
blob
)
{
$compileBtn
.
removeAttr
(
'
disabled
'
)
saveAs
(
blob
,
'
bootstrap.zip
'
)
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