diff options
| author | Chris Rebert <[email protected]> | 2014-06-05 13:58:22 -0700 |
|---|---|---|
| committer | Chris Rebert <[email protected]> | 2014-06-05 13:58:22 -0700 |
| commit | a8641b4db779da385782275b49abb796f64a413c (patch) | |
| tree | 31ffdca63a036df525d8c42d03c180a6c6dff0f3 /docs | |
| parent | ef436c761b9587fbd0234788ec8bed4696aec516 (diff) | |
| parent | d5d64c2e4e8afbbe8a5331ef1dd9b51f40c30160 (diff) | |
| download | bootstrap-a8641b4db779da385782275b49abb796f64a413c.tar.xz bootstrap-a8641b4db779da385782275b49abb796f64a413c.zip | |
Merge pull request #10632 from stuartpb/patch-1
Customizer: Alert on successful save to Gist
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/assets/js/_src/customizer.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/docs/assets/js/_src/customizer.js b/docs/assets/js/_src/customizer.js index 033e1c9c9..5358df9d9 100644 --- a/docs/assets/js/_src/customizer.js +++ b/docs/assets/js/_src/customizer.js @@ -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 { |
