Making WordPress.org

Changeset 306


Ignore:
Timestamp:
01/22/2014 06:34:41 PM (11 years ago)
Author:
nacin
Message:

Trac: More focuses updates. see #287.

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

    r301 r306  
    11231123/* =Focuses */
    11241124#properties table td#focuses {
    1125     padding: .6em 0 .3em;
     1125    padding: .6em 0 .3em 100px;
    11261126    height: 66px;
    11271127}
     
    11311131#focuses ul {
    11321132    float: left;
    1133     width: 356px;
     1133    width: 256px;
    11341134    margin: 0;
    11351135    padding: 0;
  • sites/trunk/wordpress.org/public_html/style/trac/wp-trac.js

    r305 r306  
    2929    coreFocusesList = {
    3030        'ui' : 'UI or design related.',
     31        'accessibility' : 'Accessibility focus.',
    3132        'javascript' : 'Heavy JavaScript focus.',
    32         // 'accessibility' : 'Accessibility focus.',
    33         'unit tests' : 'PHP or JS unit tests.',
    34         'docs' : 'Documentation focus.',
    35         'rtl' : 'Right-to-left languages.',
    36         'administration' : 'Dashboard related, but assigned a more specifc component.',
    37         'template' : 'Relating to theme template functions, but assigned a more specific component.',
     33        // 'unit tests' : 'PHP or JS unit tests.',
     34        // 'administration' : 'Dashboard related, but assigned a more specifc component.',
     35        // 'template' : 'Relating to theme template functions, but assigned a more specific component.',
     36        'docs' : 'Inline documentation focus.',
     37        'multisite' : 'Relating to multisite, but assigned a more specific component.',
    3838        'performance' : 'Performance or caching (but not the Cache API component).',
    39         // 'multisite' : 'Relating to multisite, but assigned a more specific component.'
     39        'rtl' : 'Right-to-left languages.'
    4040    };
    4141
     
    4848        init: function() {
    4949            wpTrac.hacks();
     50            wpTrac.nonGardeners();
    5051            if ( ! $(document.body).hasClass( 'plugins' ) ) {
    5152                wpTrac.workflow.init();
    52             }
    53             wpTrac.nonGardeners();
     53                if ( $(document.body).hasClass( 'core' ) ) {
     54                    // wpTrac.focuses.init();
     55                }
     56            }
    5457        },
    5558
     
    147150                window.onbeforeunload = function() {
    148151                    if ( window.location.pathname === '/newticket' ) {
    149                         if ( 0 === $( '#field-description' ).val().length && 0 === $( '#field-summary' ).val().length ) {
     152                        if ( ! $( '#field-description' ).val() && ! $( '#field-summary' ).val() ) {
    150153                            return;
    151154                        }
    152                     } else if ( 0 === $( '#comment' ).val().length ) {
     155                    } else if ( ! $( '#comment' ).val() ) {
    153156                        return;
     157                   
    154158                    }
    155159                    return 'The changes you made will be lost if you navigate away from this page.';
     
    256260            if ( $('#field-owner').length ) {
    257261                $('#field-priority, #field-severity, #field-milestone, #field-cc, #field-keywords').parents('td').hide().prev().hide();
     262                if ( $('#field-focuses').length ) {
     263                    $('#field-focuses').closest('td').attr( 'colspan', 3 );
     264                    $('#field-component').parent().add( $('#field-component').parent().prev() ).wrapAll( '<tr />' ).insertBefore( $( '#field-focuses' ).parents( 'tr' ) );
     265                }
    258266            }
    259267
     
    527535                }
    528536                $('label[for="field-focuses"]').parent().remove();
    529                 field.parent().attr({ colspan: 2, id: 'focuses' });
     537                if ( field.parent().attr( 'colspan' ) == 3 ) {
     538                    field.parent().attr( 'id', 'focuses' );
     539                } else {
     540                    field.parent().attr({ colspan: 2, id: 'focuses' });
     541                }
    530542                field.hide();
    531543
     
    556568                container.on( 'click', 'a', addRemove );
    557569                container.closest( 'form' ).on( 'submit', submit );
     570                $( '#field-component' ).on( 'change', componentSync );
    558571            }
    559572
     
    569582
    570583            function add( focus ) {
     584                if ( typeof focus === 'string' ) {
     585                    focus = container.find( 'li.' + focus );
     586                }
    571587                focus.addClass( 'active' );
    572588                focuses.push( focus.data( 'focus' ) );
     
    575591
    576592            function remove( focus ) {
     593                if ( typeof focus === 'string' ) {
     594                    focus = container.find( 'li.' + focus );
     595                }
    577596                focus.removeClass( 'active' );
    578597                var remove = focus.data( 'focus' );
     
    591610                });
    592611                field.val( orderedFocuses.join( ', ' ) );
     612            }
     613
     614            function componentSync() {
     615                var component = $(this).val();
     616                if ( component === 'Network Admin' || component === 'Networks/Sites' ) {
     617                    add( 'multisite' );
     618                }
    593619            }
    594620
Note: See TracChangeset for help on using the changeset viewer.