Making WordPress.org

Ticket #3992: 3992.diff

File 3992.diff, 2.6 KB (added by dufresnesteven, 5 years ago)

What about something like this? A css hack could also work but i prefer not to have anything in the DOM for indexing purposes.

  • wordpress.org/public_html/wp-content/themes/pub/gutenberg/front-page.php

    diff --git wordpress.org/public_html/wp-content/themes/pub/gutenberg/front-page.php wordpress.org/public_html/wp-content/themes/pub/gutenberg/front-page.php
    index 58aa80e6f..4dda8f4ac 100644
     
    55                <meta name="viewport" content="width=device-width, initial-scale=1">
    66                <link rel="profile" href="http://gmpg.org/xfn/11">
    77                <?php wp_head(); ?>
     8                <script>
     9                        window.noSupportString = "<?php printf( esc_html__( 'You are using an out of date browser.', 'gutenbergtheme' )); ?>"
     10                </script>
    811        </head>
    912
    1013        <body <?php body_class( 'folded' ); ?>>
  • wordpress.org/public_html/wp-content/themes/pub/gutenberg/functions.php

    diff --git wordpress.org/public_html/wp-content/themes/pub/gutenberg/functions.php wordpress.org/public_html/wp-content/themes/pub/gutenberg/functions.php
    index 9674c4f01..4fa4eb156 100644
    function gutenbergtheme_fonts_url() { 
    878878 * Enqueue scripts and styles.
    879879 */
    880880function gutenbergtheme_scripts() {
     881        wp_enqueue_script( 'gutenbergtheme-unsupportedbrowser', get_template_directory_uri() . '/js/unsupported-browser.js', array(), '1', true );
     882
    881883        wp_enqueue_style( 'gutenbergtheme-style', get_stylesheet_uri(), [], 13 );
    882884
    883885        wp_enqueue_style( 'gutenbergthemeblocks-style', get_template_directory_uri() . '/blocks.css');
  • new file wordpress.org/public_html/wp-content/themes/pub/gutenberg/js/unsupported-browser.js

    diff --git wordpress.org/public_html/wp-content/themes/pub/gutenberg/js/unsupported-browser.js wordpress.org/public_html/wp-content/themes/pub/gutenberg/js/unsupported-browser.js
    new file mode 100644
    index 000000000..3bc8ec78f
    - +  
     1( function ( $ ) {
     2        if ( $.browser && $.browser.version < 11 ) {
     3        var htmlString = '<div class="unsupported-browser-msg"><h2>' + window.noSupportString + '</h2></div>'
     4                $( '#editor' ).append( htmlString );
     5        }
     6} )( jQuery );
  • wordpress.org/public_html/wp-content/themes/pub/gutenberg/style.css

    diff --git wordpress.org/public_html/wp-content/themes/pub/gutenberg/style.css wordpress.org/public_html/wp-content/themes/pub/gutenberg/style.css
    index cc2a783bd..0dd7c89b3 100644
    a.github-edit:hover > * { 
    16931693a.github-edit img {
    16941694        height: .8em;
    16951695}
     1696
     1697.unsupported-browser-msg {
     1698        width: 992px;
     1699        margin: 24px auto;
     1700        padding: 24px;
     1701        background: #fef8e7;
     1702        border: 1px solid #f7dba4;
     1703        text-align: center;
     1704        font-weight: normal;
     1705}
     1706 No newline at end of file