Skip to content
GitLab
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
a8641b4d
Commit
a8641b4d
authored
10 years ago
by
Chris Rebert
Browse files
Options
Download
Plain Diff
Merge pull request #10632 from stuartpb/patch-1
Customizer: Alert on successful save to Gist
parents
ef436c76
d5d64c2e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/assets/js/_src/customizer.js
+12
-3
docs/assets/js/_src/customizer.js
with
12 additions
and
3 deletions
+12
-3
docs/assets/js/_src/customizer.js
+
12
-
3
View file @
a8641b4d
...
...
@@ -24,6 +24,12 @@ window.onload = function () { // wait for load in a dumb way because B-0
throw
err
}
function
showSuccess
(
msg
)
{
$
(
'
<div class="bs-callout bs-callout-info">
'
+
'
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
'
+
msg
+
'
</div>
'
).
insertAfter
(
'
.bs-customize-download
'
)
}
function
showCallout
(
msg
,
showUpTop
)
{
var
callout
=
$
(
'
<div class="bs-callout bs-callout-danger">
'
+
'
<h4>Attention!</h4>
'
+
...
...
@@ -60,10 +66,13 @@ window.onload = function () { // wait for load in a dumb way because B-0
data
:
JSON
.
stringify
(
data
)
})
.
success
(
function
(
result
)
{
var
gistUrl
=
result
.
html_url
;
var
origin
=
window
.
location
.
protocol
+
'
//
'
+
window
.
location
.
host
var
newUrl
=
origin
+
window
.
location
.
pathname
+
'
?id=
'
+
result
.
id
history
.
replaceState
(
false
,
document
.
title
,
newUrl
)
callback
(
result
.
html_url
,
newUrl
)
var
customizerUrl
=
origin
+
window
.
location
.
pathname
+
'
?id=
'
+
result
.
id
showSuccess
(
'
<strong>Success!</strong> Your configuration has been saved to <a href="
'
+
gistUrl
+
'
">
'
+
gistUrl
+
'
</a>
'
+
'
and can be revisited here at <a href="
'
+
customizerUrl
+
'
">
'
+
customizerUrl
+
'
</a> for further customization.
'
)
history
.
replaceState
(
false
,
document
.
title
,
customizerUrl
)
callback
(
gistUrl
,
customizerUrl
)
})
.
error
(
function
(
err
)
{
try
{
...
...
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