Skip to content
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

Warning on javascript or feature not supported #759

Merged
merged 7 commits into from
Apr 29, 2022

Conversation

NiedziolkaMichal
Copy link
Member

This PR changes how interactive examples are shown, when java script is disabled or shown feature is not supported.

Currently, part of the example is shown as plain text. I remember there was reported issue about scrollbar-width in chrome shown like that, but I couldn't find it.
image

Attached changes makes window look like this:
image
image

--background-warning: rgba(216, 64, 0, 0.1); contains "--background-warning" value copied from yari.
.editor-container.hidden is added, because simple .hidden selector has too low specificity.
Headers were added back, because whole dialog looks better with them.

I didn't change how JavaScript and WebAssembly are shown, because they have intentional fallback to plain text which looks quite ok.

@wbamberg

@wbamberg
Copy link
Collaborator

I won't review the code here but I'm +1 on the idea. I wish we could simply hide the editor in these cases (mdn/interactive-examples#532) but since we can't, this is better than what we have now.

Also though, I think we should treat it as a content bug when this happens in Chrome or Firefox (or Safari, probably).

@NiedziolkaMichal
Copy link
Member Author

Yes it would be better to hide the editor. Although user might see a warning and then try different browser to see the example.

Co-authored-by: wbamberg <[email protected]>
@schalkneethling schalkneethling added enhancement Improves an existing feature. community Contributions by the community labels Apr 20, 2022
Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase your branch to resolve the merge conflict, and make sure that all of your commits are signed.

(Please see the documentation about signed commits and how to sign yours on GitHub.)

# Conflicts:
#	editor/css/editor-libs/common.css
@NiedziolkaMichal
Copy link
Member Author

@caugner Current state is ok? I used merge to resolve common.css conflict and signed it.

@caugner
Copy link
Contributor

caugner commented Apr 27, 2022

Current state is ok?

@NiedziolkaMichal Unfortunately there is a new merge conflict in editor/tmpl/live-tabbed-tmpl.html. 😕

# Conflicts:
#	editor/tmpl/live-tabbed-tmpl.html
@NiedziolkaMichal
Copy link
Member Author

@caugner That was expected. Everything should be fine now.
Could you check #763 later too?

Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one possible nit.

editor/css/editable-css.css Outdated Show resolved Hide resolved
Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Contributions by the community enhancement Improves an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants