-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customizer: Alert on successful save to Gist #10632
Conversation
@@ -12,6 +12,12 @@ window.onload = function () { // wait for load in a dumb way because B-0 | |||
throw err | |||
} | |||
|
|||
function showSuccess(msg { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You seem to be missing a close-paren...Has this code been tested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops! The built-in tests for Bootstrap don't lint the docs-assets. I've opened a PR for that at #11033.
IMHO, it'd be better to include the Gist and/or Customizer URLs in a README file and/or in the generated CSS+JS files. |
From the discussion in the original issue:
Anyway, incorporating this change wouldn't stop anybody from implementing that - it would just give more visual feedback as to the existence of these links. |
I guess I don't agree with your assessment of the potential complexity+performance impact. |
I'll make a pull request some time with the performance reasons why I'd argue against adding it. Anyway, I'd still implement it on top of this change. |
Pushed a rebased and revised commit. |
var hereNow = window.location.origin + window.location.pathname + '?id=' + result.id | ||
showSuccess('<strong>Success!</strong> Your configuration has been saved to <a href="' + gist +'">' + gist + '</a>\ | ||
and can be revisited here at <a href="' + hereNow +'">' + hereNow + '</a> for further customization.') | ||
history.replaceState(false, document.title, hereNow) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this check for the existence of window.history
before calling it? IE9 does not implement the history API: http://caniuse.com/#search=history
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's being polyfilled? If not, that's an issue that exists upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IE9 does not work anyway due to jszip's limitations.
@stuartpb I believe we'd be happy to accept this if it was rebased/redone so that it merges cleanly against current |
@stuartpb Ping. |
Rebased, updated and pushed. |
+1 |
@stuartpb: Tests fail. |
Apparently Bootstrap implemented linting of docs-assets in testing, with concatenation over newline escapement for multi-line strings, since I originally submitted this PR. Fixed. |
Thanks. Can you squash those 2 commits into one? |
Squashed and pushed. |
BTW, when did doc asset linting get added to the test suite? I proposed doing so in #11033 and got shot down. |
I added it some time ago. |
Lint still failing. This time due to lack of a space between the |
Fixed, tests passing. |
@@ -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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
semicolon
Removed all semicolons per @fat's complaint |
Will merge as soon as we get a chance to test it out. |
How's this change? |
It's better for sure. What I'm not sure about is the duplication. I mean, we have After this is in, we can extend an existent function instead of duplicating stuff. |
No close button? |
The close button should be there I guess (see also https://github.com/twbs/bootstrap/pull/10632/files#diff-d16c8aeafb7656f16175f3eebc03c831R19). |
Given #12955, making the alerts always dismissable could be misleading. |
Yeah but that is a general issue and not directly related to this. I simply suggested we are a little more consistent with the alerts so far. |
Looks good enough, IMO. We can always tweak it more later. |
Customizer: Alert on successful save to Gist
Thanks @stuartpb! |
✨ |
Part of my suggested solution for #9951