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 5 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
14 changes: 12 additions & 2 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ 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
printf(
__( 'The Block Editor requires JavaScript, please try the <a href="%s">Classic Editor plugin</a>.', 'gutenberg' ),
'https://wordpress.org/plugins/classic-editor/'
) ;
?>
</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 Expand Up @@ -123,7 +133,7 @@ function is_gutenberg_page() {
*/
function gutenberg_wordpress_version_notice() {
echo '<div class="error"><p>';
echo __( 'Gutenberg requires WordPress 4.9.8 or later to function properly. Please upgrade WordPress before activating Gutenberg.', 'gutenberg' );
_e( 'Gutenberg requires WordPress 4.9.8 or later to function properly. Please upgrade WordPress before activating Gutenberg.', 'gutenberg' );
echo '</p></div>';

deactivate_plugins( array( 'gutenberg/gutenberg.php' ) );
Expand All @@ -136,7 +146,7 @@ function gutenberg_wordpress_version_notice() {
*/
function gutenberg_build_files_notice() {
echo '<div class="error"><p>';
echo __( 'Gutenberg development mode requires files to be built. Run <code>npm install</code> to install dependencies, <code>npm run build</code> to build the files or <code>npm run dev</code> to build the files and watch for changes. Read the <a href="https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md">contributing</a> file for more information.', 'gutenberg' );
_e( 'Gutenberg development mode requires files to be built. Run <code>npm install</code> to install dependencies, <code>npm run build</code> to build the files or <code>npm run dev</code> to build the files and watch for changes. Read the <a href="https://github.com/WordPress/gutenberg/blob/master/CONTRIBUTING.md">contributing</a> file for more information.', 'gutenberg' );
echo '</p></div>';
}

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