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 all 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
23 changes: 21 additions & 2 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@
function the_gutenberg_project() {
global $post_type_object;
?>
<noscript>
<div class="error" style="position:absolute;top:32px;z-index:40"><p>
<?php
// Using Gutenberg as Plugin
if ( is_plugin_active( 'gutenberg/gutenberg.php' ) ) {
$current_url = esc_url( add_query_arg( 'classic-editor', true, $_SERVER['REQUEST_URI'] ) );
printf(
__( 'The Block Editor requires JavaScript. You can use the <a href="%s">Classic Editor</a>.', 'gutenberg' ),
$current_url
) ;
} else { // Using Gutenberg in Core
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>
<div class="block-editor gutenberg">
<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>
Expand Down Expand Up @@ -123,7 +142,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 +155,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.js.is-fullscreen-mode {
// 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