- Timestamp:
- 10/11/2015 09:36:28 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js
r1960 r1963 69 69 showContributorLabels: function( labels ) { 70 70 $( 'h3.change .username' ).each( function() { 71 var $el = $( this ), 71 var html, 72 $el = $( this ), 72 73 username = $el.data( 'username' ); 73 74 74 75 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( ' ' + html.prop('outerHTML') ); 76 82 } 77 83 }); … … 882 888 }).success( function( data ) { 883 889 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 ); 887 907 } 888 908 889 909 function render( data ) { 890 $( '#propertyform' ).before( data .data['notifications-box']);910 $( '#propertyform' ).before( data ); 891 911 notifications = $('#notifications'); 892 912 notifications.on( 'click', '.watch-this-ticket', subscribe )
Note: See TracChangeset
for help on using the changeset viewer.