Making WordPress.org

Changeset 1963


Ignore:
Timestamp:
10/11/2015 09:36:28 PM (8 years ago)
Author:
nacin
Message:

Trac: JS and CSS for new 'Component Maintainer' commenter labels.

Location:
sites/trunk/wordpress.org/public_html/style/trac
Files:
2 edited

Legend:

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

    r1960 r1963  
    281281/* =roadmap.css */
    282282table.progress td.closed {
    283     background-color: #83B4D8;
    284     background-image: linear-gradient(bottom, rgb(114,167,207) 0%, rgb(144,197,238) 100%);
    285     background-image: -o-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(144,197,238) 100%);
    286     background-image: -moz-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(144,197,238) 100%);
    287     background-image: -webkit-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(144,197,238) 100%);
    288     background-image: -ms-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(144,197,238) 100%);
     283    background-color: #83B4D8;
     284    background-image: linear-gradient(bottom, rgb(114,167,207) 0%, rgb(144,197,238) 100%);
     285    background-image: -o-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(144,197,238) 100%);
     286    background-image: -moz-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(144,197,238) 100%);
     287    background-image: -webkit-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(144,197,238) 100%);
     288    background-image: -ms-linear-gradient(bottom, rgb(114,167,207) 0%, rgb(144,197,238) 100%);
    289289}
    290290table.progress {
     
    682682    margin: 0 8px 0 -4px;
    683683}
     684span.contributor-label {
     685    font-size: 0.9em;
     686    background: #ddd;
     687    color: #222;
     688    padding: 3px 4px;
     689    margin: 0 2px 0 3px;
     690}
    684691#changelog span:target {
    685692    background-clip: content-box;
     
    943950#notifications .star-list a.star:before {
    944951    color: #fff;
    945     display: inline-block;
     952    display: inline-block;
    946953    margin: 25px 0 0 26px;
    947     width: 14px;
    948     height: 14px;
     954    width: 14px;
     955    height: 14px;
    949956    position: absolute;
    950957    color: #fff;
    951958    -webkit-text-stroke-width: 1px;
    952959    -webkit-text-stroke-color: #333;
    953     -webkit-font-smoothing: antialiased;
    954     font-size: 14px;
    955     line-height: 1;
    956     font-family: "dashicons";
    957     text-decoration: inherit;
    958     font-weight: normal;
    959     font-style: normal;
    960     vertical-align: top;
    961     text-align: center;
     960    -webkit-font-smoothing: antialiased;
     961    font-size: 14px;
     962    line-height: 1;
     963    font-family: "dashicons";
     964    text-decoration: inherit;
     965    font-weight: normal;
     966    font-style: normal;
     967    vertical-align: top;
     968    text-align: center;
    962969    content: "\f155";
    963970}
     
    16291636/* =Report screens */
    16301637.create-new-ticket.button {
    1631     margin: 10px 10px 0;
    1632     float: right;
    1633     clear: right;
    1634     font-size: 15px;
    1635     min-height: 40px;
    1636     padding: 0;
     1638    margin: 10px 10px 0;
     1639    float: right;
     1640    clear: right;
     1641    font-size: 15px;
     1642    min-height: 40px;
     1643    padding: 0;
    16371644}
    16381645.create-new-ticket a {
    1639     line-height: 38px;
    1640     color: #fff !important;
    1641     background: none !important;
    1642     border: none !important;
    1643     display: block;
    1644     height: 100%;
    1645     width: 100%;
    1646     padding: 0 12px 2px;
     1646    line-height: 38px;
     1647    color: #fff !important;
     1648    background: none !important;
     1649    border: none !important;
     1650    display: block;
     1651    height: 100%;
     1652    width: 100%;
     1653    padding: 0 12px 2px;
    16471654}
    16481655.create-new-ticket .ext-link .icon {
    1649     display: none;
     1656    display: none;
    16501657}
    16511658.create-new-ticket a:active {
    1652     color: rgba(255,255,255,0.95) !important;
     1659    color: rgba(255,255,255,0.95) !important;
    16531660}
    16541661#content.report #prefs {
     
    16591666}
    16601667#content.report #prefs div {
    1661     display: inline;
     1668    display: inline;
    16621669}
    16631670body.core #ctxtnav a[href="/report"] {
     
    19671974    }
    19681975    .milestone .info .progress {
    1969         width: 85%;
     1976        width: 85%;
    19701977    }
    19711978    #content.timeline dl {
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js

    r1960 r1963  
    6969        showContributorLabels: function( labels ) {
    7070            $( 'h3.change .username' ).each( function() {
    71                 var $el = $( this ),
     71                var html,
     72                    $el = $( this ),
    7273                    username = $el.data( 'username' );
    7374
    7475                if ( username in labels ) {
    75                     $el.parent( 'a.profile-link' ).after( ' <span class="contributor-label">(' + labels[ username ] + ')</span>' );
     76                    if ( typeof labels[ username ] === 'object' ) {
     77                        html = $( '<span />', {'class': 'contributor-label', 'title': labels[ username ].title }).text( labels[ username ].text );
     78                    } else {
     79                        html = $( '<span />', {'class': 'contributor-label'}).text( labels[ username ]);
     80                    }
     81                    $el.parent( 'a.profile-link' ).after( '&ensp;' + html.prop('outerHTML') );
    7682                }
    7783            });
     
    882888                }).success( function( data ) {
    883889                    if ( data.success ) {
    884                         $( render( data ) );
    885                     }
    886                 });
     890                        render( data.data['notifications-box'] );
     891                        if ( data.data.maintainers ) {
     892                            maintainerLabels( data.data.maintainers );
     893                        }
     894                    }
     895                });
     896            }
     897
     898            function maintainerLabels( maintainers ) {
     899                var i, len, labels = {};
     900                for ( i = 0, len = maintainers.length; i < len; i++ ) {
     901                    labels[ maintainers[i] ] = {
     902                        text:  'Component Maintainer',
     903                        title: '@' + maintainers[i] + ' maintains the ' + $.trim( $('td[headers="h_component"]').text() ) + ' component'
     904                    };
     905                }
     906                wpTrac.showContributorLabels( labels );
    887907            }
    888908
    889909            function render( data ) {
    890                 $( '#propertyform' ).before( data.data['notifications-box'] );
     910                $( '#propertyform' ).before( data );
    891911                notifications = $('#notifications');
    892912                notifications.on( 'click', '.watch-this-ticket', subscribe )
Note: See TracChangeset for help on using the changeset viewer.