Skip to content

Commit a8641b4

Browse files
committed
Merge pull request #10632 from stuartpb/patch-1
Customizer: Alert on successful save to Gist
2 parents ef436c7 + d5d64c2 commit a8641b4

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

docs/assets/js/_src/customizer.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ window.onload = function () { // wait for load in a dumb way because B-0
2424
throw err
2525
}
2626

27+
function showSuccess(msg) {
28+
$('<div class="bs-callout bs-callout-info">' +
29+
'<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>' + msg +
30+
'</div>').insertAfter('.bs-customize-download')
31+
}
32+
2733
function showCallout(msg, showUpTop) {
2834
var callout = $('<div class="bs-callout bs-callout-danger">' +
2935
'<h4>Attention!</h4>' +
@@ -60,10 +66,13 @@ window.onload = function () { // wait for load in a dumb way because B-0
6066
data: JSON.stringify(data)
6167
})
6268
.success(function (result) {
69+
var gistUrl = result.html_url;
6370
var origin = window.location.protocol + '//' + window.location.host
64-
var newUrl = origin + window.location.pathname + '?id=' + result.id
65-
history.replaceState(false, document.title, newUrl)
66-
callback(result.html_url, newUrl)
71+
var customizerUrl = origin + window.location.pathname + '?id=' + result.id
72+
showSuccess('<strong>Success!</strong> Your configuration has been saved to <a href="' + gistUrl + '">' + gistUrl + '</a> ' +
73+
'and can be revisited here at <a href="' + customizerUrl + '">' + customizerUrl + '</a> for further customization.')
74+
history.replaceState(false, document.title, customizerUrl)
75+
callback(gistUrl, customizerUrl)
6776
})
6877
.error(function (err) {
6978
try {

0 commit comments

Comments
 (0)