Making WordPress.org

Changeset 6668


Ignore:
Timestamp:
02/17/2018 07:09:06 AM (9 years ago)
Author:
obenland
Message:

Trac: Rename Reporter and Owner fields for themes.

Fixes #765.

File:
1 edited

Legend:

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

    r6527 r6668  
    11/* globals wpTracAutoCompleteUsers, wpTracContributorLabels, wpTracCurrentUser */
    2 var wpTrac, coreKeywordList, gardenerKeywordList, reservedTerms, coreFocusesList;
     2var wpTrac, coreKeywordList, gardenerKeywordList, reservedTerms, coreFocusesList, $body;
    33
    44(function($){
    … …  
    5757        ];
    5858
     59        $body = $( document.body );
     60
    5961        wpTrac = {
    6062
    … …  
    7577                        wpTrac.linkMentions();
    7678
    77                         if ( ! $(document.body).hasClass( 'plugins' ) ) {
     79                        if ( ! $body.hasClass( 'plugins' ) ) {
    7880                                wpTrac.workflow.init();
    79                                 if ( $(document.body).hasClass( 'core' ) ) {
     81                                if ( $body.hasClass( 'core' ) ) {
    8082                                        wpTrac.reports();
    8183                                        wpTrac.focuses.init();
    … …  
    180182
    181183                hacks: function() {
    182                         var content = $( '#content' ),
    183                                 $body = $( document.body );
     184                        var content = $( '#content' );
    184185
    185186                        // Add deprecated notice for core's test repository.
    … …  
    195196                                        } ) );
    196197                                }
     198                        }
     199
     200                        if ( $body.hasClass( 'themes' ) ) {
     201                                $( '#h_reporter' ).text( 'Developer:' );
     202                                $( '#h_owner' ).text( 'Reviewer:' );
    197203                        }
    198204
    … …  
    527533                        }
    528534
    529                         if ( $(document.body).hasClass( 'core' ) && content.hasClass( 'search' ) ) {
     535                        if ( $body.hasClass( 'core' ) && content.hasClass( 'search' ) ) {
    530536                                // Remove 'Wiki' and 'Milestone' from search.
    531537                                $( '#fullsearch #milestone' ).next().remove().end().remove();
    … …  
    541547
    542548                        // If we're on /newticket (based on the field-owner check), declutter.
    543                         if ( $('#field-owner').length && $(document.body).hasClass( 'core' ) ) {
     549                        if ( $('#field-owner').length && $body.hasClass( 'core' ) ) {
    544550                                $('#field-priority, #field-severity, #field-milestone, #field-cc, #field-keywords').parents('td').hide().prev().hide();
    545551                                if ( $('#field-focuses').length ) {
    … …  
    600606                                        }).done( function( data ) {
    601607                                                $( data ).find( '.ticket-reports' ).appendTo( popup );
    602                                                 $(document.body).addClass( 'ticket-reports-open' );
     608                                                $body.addClass( 'ticket-reports-open' );
    603609                                        }).fail( function() {
    604610                                                failed = true;
    605611                                        });
    606612                                } else {
    607                                         $(document.body).toggleClass( 'ticket-reports-open' );
     613                                        $body.toggleClass( 'ticket-reports-open' );
    608614                                        event.preventDefault();
    609615                                }
    … …  
    613619                        });
    614620                        $( '#report-popup' ).on( 'click', '.close', function() {
    615                                 $(document.body).removeClass( 'ticket-reports-open' );
     621                                $body.removeClass( 'ticket-reports-open' );
    616622                                return false;
    617623                        });
Note: See TracChangeset for help on using the changeset viewer.