From b5f9e2eb608012e26666ec1e851e7765051b0726 Mon Sep 17 00:00:00 2001 From: "Stuart P. Bentley" Date: Sat, 14 Sep 2013 01:11:07 -0700 Subject: [PATCH 1/2] Customizer: Alert on successful save to Gist --- docs/assets/js/_src/customizer.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/assets/js/_src/customizer.js b/docs/assets/js/_src/customizer.js index 033e1c9c91..f1e209772b 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) { + $('
' + + '' + msg + + '
').insertAfter('.bs-customize-download') + } + function showCallout(msg, showUpTop) { var callout = $('
' + '

Attention!

' + @@ -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('Success! Your configuration has been saved to ' + gistUrl + ' ' + + 'and can be revisited here at ' + customizerUrl + ' for further customization.') + history.replaceState(false, document.title, customizerUrl) + callback(gistUrl, customizerUrl) }) .error(function (err) { try { From d5d64c2e4e8afbbe8a5331ef1dd9b51f40c30160 Mon Sep 17 00:00:00 2001 From: "Stuart P. Bentley" Date: Sat, 17 May 2014 13:22:57 -0400 Subject: [PATCH 2/2] Update showSuccess to use new classes --- docs/assets/js/_src/customizer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/assets/js/_src/customizer.js b/docs/assets/js/_src/customizer.js index f1e209772b..5358df9d9d 100644 --- a/docs/assets/js/_src/customizer.js +++ b/docs/assets/js/_src/customizer.js @@ -25,7 +25,7 @@ window.onload = function () { // wait for load in a dumb way because B-0 } function showSuccess(msg) { - $('
' + + $('
' + '' + msg + '
').insertAfter('.bs-customize-download') }