Making WordPress.org

Changeset 4102


Ignore:
Timestamp:
09/19/2016 11:01:05 AM (9 years ago)
Author:
ocean90
Message:

Trac: Add deprecated notice for core's test repository.

Props jorbin.
Fixes #1754.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js

    r3821 r4102  
    175175
    176176        hacks: function() {
    177             var content = $( '#content' );
     177            var content = $( '#content' ),
     178                $body = $( document.body );
     179
     180            // Add deprecated notice for core's test repository.
     181            if ( $body.hasClass( 'core' ) && content.hasClass( 'browser' ) ) {
     182                $( '#repoindex tbody .odd .name a[href="/browser/tests"]' )
     183                    .parent()
     184                    .append( '<p style="display:inline">Deprecated. <a href="/browser/trunk/tests">Please see default repository</a>.' );
     185
     186                if ( window.location.pathname.substring( 0, 14 ) === '/browser/tests' ) {
     187                    content.before( $( '<div />', {
     188                        'class': 'system-message warning',
     189                        'html': 'You are currently viewing the <strong>deprecated</strong> test repository. You may want to <a href="/browser/trunk/tests">view the tests in the default repository</a>.',
     190                    } ) );
     191                }
     192            }
    178193
    179194            // Change 'Comments' and 'Stars' columns to dashicons glyphs to save space
     
    194209            // Ticket-only tweaks.
    195210            if ( content.hasClass( 'ticket' ) ) {
    196                 if ( $(document.body).hasClass( 'core' ) ) {
     211                if ( $body.hasClass( 'core' ) ) {
    197212                    wpTrac.coreToMeta();
    198213                }
Note: See TracChangeset for help on using the changeset viewer.