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

Add message if JavaScript is disabled #11642

Merged
merged 9 commits into from
Nov 13, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ function the_gutenberg_project() {
global $post_type_object;
?>
<div class="block-editor gutenberg">
<noscript>
<div class="error" style='margin-top:32px'><p>
Copy link
Member

Choose a reason for hiding this comment

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

The admin bar has different heights depending on the viewport.

Copy link
Member Author

Choose a reason for hiding this comment

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

The margin was simply to give some spacing from the bottom of the admin bar, so the error message isn't squished up against the top.

<?php
echo __( 'The block editor requires Javascript to be enabled.', 'gutenberg' );
Copy link
Member

Choose a reason for hiding this comment

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

echo __() => _e()

Copy link
Member Author

Choose a reason for hiding this comment

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

The echo __() function is used in numerous spots in gutenberg.php, I just mirrored it to stay consistent within the same file.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thumbs down is not really a productive response.
I've switched each of the occurrences to the shorter function.

?>
</p></div>
</noscript>
<h1 class="screen-reader-text"><?php echo esc_html( $post_type_object->labels->edit_item ); ?></h1>
<div id="editor" class="block-editor__container gutenberg__editor"></div>
<div id="metaboxes" style="display: none;">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
body.is-fullscreen-mode {
Copy link
Member

Choose a reason for hiding this comment

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

See also #11677

body.is-fullscreen-mode:not(.no-js) {
mkaz marked this conversation as resolved.
Show resolved Hide resolved
// Reset the html.wp-topbar padding
// Because this uses negative margins, we have to compensate for the height.
margin-top: -$admin-bar-height-big;
Expand Down