Make WordPress Core

Ticket #37230: 37230.diff

File 37230.diff, 7.4 KB (added by swissspidy, 9 years ago)
  • src/wp-admin/css/forms.css

    diff --git src/wp-admin/css/forms.css src/wp-admin/css/forms.css
    index f219831..15be606 100644
    p.search-box { 
    564564        margin: 0 4px 0 0;
    565565}
    566566
     567.js.plugins-php .search-box .wp-filter-search {
     568        margin: 0;
     569        width: 280px;
     570        font-size: 16px;
     571        font-weight: 300;
     572        line-height: 1.5;
     573        padding: 3px 5px;
     574        height: 32px;
     575}
     576
    567577input[type="text"].ui-autocomplete-loading,
    568578input[type="email"].ui-autocomplete-loading {
    569579        background-image: url(../images/loading.gif);
  • src/wp-admin/includes/ajax-actions.php

    diff --git src/wp-admin/includes/ajax-actions.php src/wp-admin/includes/ajax-actions.php
    index 44cfcf4..cb5e780 100644
    function wp_ajax_search_plugins() { 
    38023802
    38033803        ob_start();
    38043804        $wp_list_table->display();
     3805        $status['count'] = count( $wp_list_table->items );
    38053806        $status['items'] = ob_get_clean();
    38063807
    38073808        wp_send_json_success( $status );
  • src/wp-admin/includes/class-wp-plugins-list-table.php

    diff --git src/wp-admin/includes/class-wp-plugins-list-table.php src/wp-admin/includes/class-wp-plugins-list-table.php
    index 39d70e2..1cf6bb5 100644
    class WP_Plugins_List_Table extends WP_List_Table { 
    342342        }
    343343
    344344        /**
     345         * Display the search box.
     346         *
     347         * @since 3.1.0
     348         * @access public
     349         *
     350         * @param string $text The search button text
     351         * @param string $input_id The search input id
     352         */
     353        public function search_box( $text, $input_id ) {
     354                if ( empty( $_REQUEST['s'] ) && ! $this->has_items() ) {
     355                        return;
     356                }
     357
     358                $input_id = $input_id . '-search-input';
     359
     360                if ( ! empty( $_REQUEST['orderby'] ) ) {
     361                        echo '<input type="hidden" name="orderby" value="' . esc_attr( $_REQUEST['orderby'] ) . '" />';
     362                }
     363                if ( ! empty( $_REQUEST['order'] ) ) {
     364                        echo '<input type="hidden" name="order" value="' . esc_attr( $_REQUEST['order'] ) . '" />';
     365                }
     366                ?>
     367                <p class="search-box">
     368                        <label class="screen-reader-text" for="<?php echo $input_id ?>"><?php echo $text; ?>:</label>
     369                        <input type="search" id="<?php echo $input_id ?>" class="wp-filter-search" name="s" value="<?php _admin_search_query(); ?>" placeholder="<?php echo esc_attr( 'Search installed plugins...' ); ?>"/>
     370                        <input type="submit" id="search-submit" class="button hide-if-js" value="<?php echo esc_attr( $text ); ?>">
     371                </p>
     372                <?php
     373        }
     374
     375        /**
    345376         *
    346377         * @global string $status
    347378         * @return array
  • src/wp-admin/js/updates.js

    diff --git src/wp-admin/js/updates.js src/wp-admin/js/updates.js
    index 053aabc..d38ded3 100644
     
    15901590        $( function() {
    15911591                var $pluginFilter    = $( '#plugin-filter' ),
    15921592                        $bulkActionForm  = $( '#bulk-action-form' ),
    1593                         $filesystemModal = $( '#request-filesystem-credentials-dialog' );
     1593                        $filesystemModal = $( '#request-filesystem-credentials-dialog' ),
     1594                        $pluginSearch    = $( '.plugins-php .wp-filter-search' );
    15941595
    15951596                /*
    15961597                 * Whether a user needs to submit filesystem credentials.
     
    19781979                 *
    19791980                 * @since 4.6.0
    19801981                 */
    1981                 $( 'input.wp-filter-search, .wp-filter input[name="s"]' ).on( 'keyup search', _.debounce( function() {
     1982                $( '.plugin-install-php .wp-filter-search' ).on( 'keyup search', _.debounce( function() {
    19821983                        var $form = $( '#plugin-filter' ).empty(),
    19831984                                data  = _.extend( {
    19841985                                        _ajax_nonce: wp.updates.ajaxNonce,
     
    19931994                                wp.updates.searchTerm = data.s;
    19941995                        }
    19951996
    1996                         history.pushState( null, '', location.href.split( '?' )[0] + '?' + $.param( _.omit( data, '_ajax_nonce' ) ) );
     1997                        if ( history.pushState ) {
     1998                                history.pushState( null, '', location.href.split( '?' )[ 0 ] + '?' + $.param( _.omit( data, '_ajax_nonce' ) ) );
     1999                        }
    19972000
    19982001                        if ( 'undefined' !== typeof wp.updates.searchRequest ) {
    19992002                                wp.updates.searchRequest.abort();
     
    20072010                        } );
    20082011                }, 500 ) );
    20092012
     2013                if ( $pluginSearch.length > 0 ) {
     2014                        $pluginSearch.attr( 'aria-describedby', 'live-search-desc' );
     2015                }
     2016
    20102017                /**
    20112018                 * Handles changes to the plugin search box on the Installed Plugins screen,
    20122019                 * searching the plugin list dynamically.
    20132020                 *
    20142021                 * @since 4.6.0
    20152022                 */
    2016                 $( '#plugin-search-input' ).on( 'keyup search', _.debounce( function() {
     2023                $pluginSearch.on( 'keyup search', _.debounce( function() {
    20172024                        var data = {
    20182025                                _ajax_nonce: wp.updates.ajaxNonce,
    20192026                                s:           $( '<p />' ).html( $( this ).val() ).text()
     
    20252032                                wp.updates.searchTerm = data.s;
    20262033                        }
    20272034
    2028                         history.pushState( null, '', location.href.split( '?' )[0] + '?s=' + data.s );
     2035                        if ( history.pushState ) {
     2036                                history.pushState( null, '', location.href.split( '?' )[ 0 ] + '?s=' + data.s );
     2037                        }
    20292038
    20302039                        if ( 'undefined' !== typeof wp.updates.searchRequest ) {
    20312040                                wp.updates.searchRequest.abort();
     
    20512060                                $( 'body' ).removeClass( 'loading-content' );
    20522061                                $bulkActionForm.append( response.items );
    20532062                                delete wp.updates.searchRequest;
     2063
     2064                                if ( 0 === response.count ) {
     2065                                        wp.a11y.speak( wp.updates.l10n.noPluginsFound );
     2066                                } else {
     2067                                        wp.a11y.speak( wp.updates.l10n.pluginsFound.replace( '%d', response.count ) );
     2068                                }
    20542069                        } );
    20552070                }, 500 ) );
    20562071
  • src/wp-admin/plugins.php

    diff --git src/wp-admin/plugins.php src/wp-admin/plugins.php
    index 6010784..fd90515 100644
    get_current_screen()->add_help_tab( array( 
    371371'title'         => __('Overview'),
    372372'content'       =>
    373373        '<p>' . __('Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.') . '</p>' .
     374        '<p>' . __( 'The search for installed plugins will search for terms in their name, description, or author.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __( 'The search results will be updated as you type.' ) . '</span></p>' .
    374375        '<p>' . sprintf(
    375376                /* translators: %s: WordPress Plugin Directory URL */
    376377                __( 'If you would like to see more plugins to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional plugins from the <a href="%s" target="_blank">WordPress.org Plugin Directory</a>. Plugins in the WordPress.org Plugin Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!' ),
  • src/wp-includes/script-loader.php

    diff --git src/wp-includes/script-loader.php src/wp-includes/script-loader.php
    index 3b1e8fa..2945b48 100644
    function wp_default_scripts( &$scripts ) { 
    653653                                'activateTheme'              => is_network_admin() ? __( 'Network Enable' ) : __( 'Activate' ),
    654654                                'activateImporter'           => __( 'Activate importer' ),
    655655                                'unknownError'               => __( 'An unknown error occured' ),
     656                                'pluginsFound'               => __( 'Number of plugins found: %d' ),
     657                                'noPluginsFound'             => __( 'No plugins found. Try a different search.' ),
    656658                        ),
    657659                ) );
    658660
  • tests/qunit/fixtures/updates.js

    diff --git tests/qunit/fixtures/updates.js tests/qunit/fixtures/updates.js
    index 657ef73..d570aa6 100644
    window._wpUpdatesSettings = { 
    3939                'activatePlugin': 'Activate',
    4040                'activateTheme': 'Activate',
    4141                'activateImporter': 'Activate importer',
    42                 'unknownError': 'An unknown error occured'
     42                'unknownError': 'An unknown error occured',
     43                'pluginsFound': 'Number of plugins found: %d',
     44                'noPluginsFound': 'No plugins found. Try a different search.'
    4345        }
    4446};
    4547window._wpUpdatesItemCounts = {