Making WordPress.org

Changeset 14982


Ignore:
Timestamp:
07/20/2026 08:45:02 PM (3 months ago)
Author:
obenland
Message:

Trac: Modernize wp-trac.js for jQuery 3 / Trac 1.6 and tidy ticket styling

Closes ​https://github.com/WordPress/wordpress.org/pull/722.

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

    r14981 r14982  
    399399        background: #f9f9f9;
    400400        border: 1px solid #ccc;
    401 }
    402 #content.ticket .ticketdraft {
    403         border: 1px solid #ccc;
     401        padding: 0;
    404402}
    405403#ticket > h2 {
    … …  
    764762}
    765763div.trac-content {
    766         -webkit-border-radius: 3px;
    767         border-radius: 3px;
     764        border: none;
     765        margin: 0;
    768766}
    769767.foldable :link, .foldable :visited {
    770         -webkit-border-radius: 3px;
    771         border-radius: 3px;
     768        border: none;
    772769}
    773770.foldable a:hover {
    … …  
    10981095#propertyform[action*="/newticket"] #properties table.trac-properties > tbody > tr > td#focuses {
    10991096        padding-left: 58px;
     1097}
     1098#propertyform[action*="/newticket"] ~ #commits {
     1099        display: none;
    11001100}
    11011101#propertyform > .buttons {
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js

    r14819 r14982  
    15481548                                        url: endpoint + '?trac-notifications=' + ticket,
    15491549                                        xhrFields: { withCredentials: true }
    1550                                 }).success( function( data ) {
     1550                                }).done( function( data ) {
    15511551                                        if ( data.success ) {
    15521552                                                render( data.data['notifications-box'] );
    … …  
    16841684                                                'tickets' : tickets
    16851685                                        }
    1686                                 }).success( function( data ) {
     1686                                }).done( function( data ) {
    16871687                                        if ( ! data.success ) {
    16881688                                                return;
    … …  
    17911791                                                + ( authenticated ? '&authenticated=1' : '' )
    17921792                                                + ( ( authenticated && 'URL' in window ) ? '&_lastmod=' + ( new URL( jQuery('a.timeline').last().prop('href') ) ).searchParams.get( 'from' ) : '' )
    1793                                 ).success( function( data ) {
     1793                                ).done( function( data ) {
    17941794                                        // Update the number
    17951795                                        container.find( 'h3 .trac-count' ).removeClass( 'hidden' ).find( 'span' ).text( data.length );
    … …  
    18611861                                                        + '&author=' + user
    18621862                                                        + ( authenticated ? '&authenticated=1' : '' )
    1863                                         ).success( function( ticketList ) {
     1863                                        ).done( function( ticketList ) {
    18641864                                                document.location = document.location.toString() +
    18651865                                                        ( document.location.search ? '&' : '?' ) +
    … …  
    21662166                }() ),
    21672167
    2168                 patchTracFor122Changes: function() {
    2169                         // TODO: This needs to be removed, the Trac assets on s.w.org are probably outdated and need updating.
    2170                         console.log( "wp-trac: Applying compat patches for Trac 1.2.2" );
    2171                         // From Trac 1.2.2 threaded_comments.js:
    2172                         window.applyCommentsOrder = window.applyCommentsOrder || function() {}
    2173 
    2174                         // Add Params to s.w.org scripts and stylesheets when loaded dynamically.
     2168                addDynamicAssetCacheBuster: function() {
     2169                        // Add cache-busting params to s.w.org scripts and stylesheets when loaded dynamically.
    21752170                        var cache_buster = jQuery('script[src^="https://s.w.org"][src*="v="]').attr('src');
    21762171                        if ( cache_buster ) {
    … …  
    21912186                                return oldLoadStylesheet( maybe_add_cache_buster( href ) );
    21922187                        }
    2193 
    2194                         // From Trac 1.2.2 trac.js:
    2195                         $.loadScript                = $.loadScript                || function() {}
    2196                         $.fn.exclusiveOnClick       = $.fn.exclusiveOnClick       || function() {}
    2197                         $.fn.addSelectAllCheckboxes = $.fn.addSelectAllCheckboxes || function() {}
    2198                         $.fn.disableOnSubmit        = $.fn.disableOnSubmit        || function() {}
    2199                         $.fn.disableSubmit          = $.fn.disableSubmit          || function() {}
    22002188                },
    22012189
    … …  
    22112199        // Perform this as soon as this file loads.
    22122200        wpTrac.disableTracAutoFocus();
    2213         wpTrac.patchTracFor122Changes();
     2201        wpTrac.addDynamicAssetCacheBuster();
    22142202
    22152203})(jQuery);
Note: See TracChangeset for help on using the changeset viewer.