Making WordPress.org


Ignore:
Timestamp:
06/14/2016 06:58:07 AM (10 years ago)
Author:
obenland
Message:

Plugin Directory: Updated styles for upload form.

See #1573.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php

    r3335 r3345  
    4242                        <?php endif; ?>
    4343
    44                         <form id="upload_form" enctype="multipart/form-data" method="POST" action="">
     44                        <form id="upload_form" class="plugin-upload-form" enctype="multipart/form-data" method="POST" action="">
    4545                                <?php wp_nonce_field( 'wporg-plugins-upload' ); ?>
    4646                                <input type="hidden" name="action" value="upload"/>
    4747                                <fieldset>
    48                                         <legend><?php _e( 'Plugin Categories (up to 3)', 'wporg-plugins' ); ?></legend>
    49                                         <ul class="category-checklist form-no-clear">
     48                                        <legend><?php _e( 'Select categories (up to 3)', 'wporg-plugins' ); ?></legend>
     49                                        <ul class="category-checklist">
    5050                                                <?php wp_terms_checklist( 0, array( 'taxonomy' => 'plugin_category' ) ); ?>
    5151                                        </ul>
    5252                                </fieldset>
    53                                 <input type="file" id="zip_file" name="zip_file" size="25"/>
    54                                 <input id="upload_button" class="button" type="submit" value="<?php esc_attr_e( 'Upload', 'wporg-plugins' ); ?>"/>
     53
     54                                <input type="file" id="zip_file" class="plugin-file" name="zip_file" size="25" accept=".zip"/>
     55                                <label class="button button-secondary" for="zip_file"><?php _e( 'Select File', 'wporg-plugins' ); ?></label>
     56
     57                                <input id="upload_button" class="button button-primary" type="submit" value="<?php esc_attr_e( 'Upload', 'wporg-plugins' ); ?>"/>
    5558
    5659                                <p>
    … …  
    5861                                </p>
    5962                        </form>
     63                        <script>
     64                                ( function ( $ ) {
     65                                        var $label    = $( 'label.button' ),
     66                                                labelText = $label.text();
     67
     68                                        $( '#zip_file' )
     69                                                .on( 'change', function( event ) {
     70                                                        var fileName = event.target.value.split( '\\' ).pop();
     71
     72                                                        fileName ? $label.text( fileName ) : $label.text( labelText );
     73                                                } )
     74                                                .on( 'focus', function() { $label.addClass( 'focus' ); } )
     75                                                .on( 'blur', function() { $label.removeClass( 'focus' ); } );
     76                                } ( window.jQuery ) );
     77                        </script>
    6078
    6179                <?php else : ?>
Note: See TracChangeset for help on using the changeset viewer.