Make WordPress Core

Changeset 20984


Ignore:
Timestamp:
06/04/2012 02:50:50 PM (13 years ago)
Author:
ryan
Message:

Site/user autocomplete fixes.

  • Lengthen the inputs in the Right Now network dashboard widget
  • Border around the whole autocomplete widget/list
  • Handle long strings
  • Remove some CSS color cruft from the main stylesheet and de-dupe the JS closures for open/close callbacks.

Props helenyhou
fixes #20584

Location:
trunk/wp-admin
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/wp-admin.dev.css

    r20977 r20984  
    890890    border-width: 1px;
    891891    border-style: solid;
    892     border-top: none;
    893 
    894     background-color: #efefef;
    895     border-color: #bbb;
    896892}
    897893
     
    900896    white-space: nowrap;
    901897    text-align: left;
    902     color: #101010;
    903898}
    904899
     
    907902    height: 100%;
    908903    padding: 4px 10px;
    909     color: #333;
    910904}
    911905
    912906.ui-autocomplete li a.ui-state-hover {
    913     background-color: #ddd;
    914907    cursor: pointer;
    915908}
  • trunk/wp-admin/includes/dashboard.php

    r20781 r20984  
    445445    <form name="searchform" action="<?php echo network_admin_url('users.php'); ?>" method="get">
    446446        <p>
    447             <input type="search" name="s" value="" size="17" id="all-user-search-input" />
     447            <input type="search" name="s" value="" size="30" id="all-user-search-input" />
    448448            <?php submit_button( __( 'Search Users' ), 'button', 'submit', false, array( 'id' => 'submit_users' ) ); ?>
    449449        </p>
     
    452452    <form name="searchform" action="<?php echo network_admin_url('sites.php'); ?>" method="get">
    453453        <p>
    454             <input type="search" name="s" value="" size="17" id="site-search-input" />
     454            <input type="search" name="s" value="" size="30" id="site-search-input" />
    455455            <?php submit_button( __( 'Search Sites' ), 'button', 'submit', false, array( 'id' => 'submit_sites' ) ); ?>
    456456        </p>
  • trunk/wp-admin/js/site-search.dev.js

    r20705 r20984  
    11jQuery( function($) {
     2    var isRTL = !! ( 'undefined' != typeof isRtl && isRtl );
    23    $( '#site-search-input' ).autocomplete({
    3         source:   ajaxurl + '?action=autocomplete-site',
    4         delay:    500,
     4        source:    ajaxurl + '?action=autocomplete-site',
     5        delay:     500,
    56        minLength: 2,
    6         open: function(e, ui) { $(this).addClass('open'); },
    7         close: function(e, ui) { $(this).removeClass('open'); }
     7        position:  isRTL ? { my: 'right top', at: 'right bottom', offset: '0, -1' } : { offset: '0, -1' },
     8        open:      function(e, ui) { $(this).addClass('open'); },
     9        close:     function(e, ui) { $(this).removeClass('open'); }
    810    });
    911});
  • trunk/wp-admin/js/user-search.dev.js

    r20705 r20984  
    11jQuery( function($) {
    2     var id = typeof( current_site_id ) != 'undefined' ? '&site_id=' + current_site_id : '';
     2    var id = typeof( current_site_id ) != 'undefined' ? '&site_id=' + current_site_id : '',
     3        isRTL = !! ( 'undefined' != typeof isRtl && isRtl ),
     4        position = isRTL ? { my: 'right top', at: 'right bottom', offset: '0, -1' } : { offset: '0, -1' },
     5        open = function(e, ui) {
     6            $(this).addClass('open');
     7        },
     8        close = function(e, ui) {
     9            $(this).removeClass('open');
     10        };
    311
    412    $( '#adduser-email, #newuser' ).autocomplete({
    5         source:   ajaxurl + '?action=autocomplete-user&autocomplete_type=add' + id,
    6         delay:    500,
     13        source:    ajaxurl + '?action=autocomplete-user&autocomplete_type=add' + id,
     14        delay:     500,
    715        minLength: 2,
    8         open: function(e, ui) { $(this).addClass('open'); },
    9         close: function(e, ui) { $(this).removeClass('open'); }
     16        position:  position,
     17        open:      open,
     18        close:     close
    1019    });
    1120
    1221    $( '#user-search-input' ).autocomplete({
    13         source:   ajaxurl + '?action=autocomplete-user&autocomplete_type=search' + id,
    14         delay:    500,
     22        source:    ajaxurl + '?action=autocomplete-user&autocomplete_type=search' + id,
     23        delay:     500,
    1524        minLength: 2,
    16         open: function(e, ui) { $(this).addClass('open'); },
    17         close: function(e, ui) { $(this).removeClass('open'); }
     25        position:  position,
     26        open:      open,
     27        close:     close
    1828    });
    1929
    2030    $( '#all-user-search-input' ).autocomplete({
    21         source:   ajaxurl + '?action=autocomplete-user&autocomplete_type=search-all' + id,
    22         delay:    500,
     31        source:    ajaxurl + '?action=autocomplete-user&autocomplete_type=search-all' + id,
     32        delay:     500,
    2333        minLength: 2,
    24         open: function(e, ui) { $(this).addClass('open'); },
    25         close: function(e, ui) { $(this).removeClass('open'); }
     34        position:  position,
     35        open:      open,
     36        close:     close
    2637    });
    2738});
Note: See TracChangeset for help on using the changeset viewer.