Message info
 
To:wp-svn@lists.automattic.com From:m@wordpress.org Subject:[wp-svn] [20984] trunk/wp-admin: Site/user autocomplete fixes. Date:Mon, 4 Jun 2012 14:50:50 +0000 (UTC)
 

Revision
20984
Author
ryan
Date
2012-06-04 14:50:50 +0000 (Mon, 04 Jun 2012)

Log 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

Modified Paths

Diff

Modified: trunk/wp-admin/css/wp-admin.dev.css (20983 => 20984)


--- trunk/wp-admin/css/wp-admin.dev.css	2012-06-04 14:43:19 UTC (rev 20983)
+++ trunk/wp-admin/css/wp-admin.dev.css	2012-06-04 14:50:50 UTC (rev 20984)
@@ -889,28 +889,21 @@
 	border-bottom-left-radius: 3px;
 	border-width: 1px;
 	border-style: solid;
-	border-top: none;
-
-	background-color: #efefef;
-	border-color: #bbb;
 }
 
 .ui-autocomplete li {
 	margin-bottom: 0;
 	white-space: nowrap;
 	text-align: left;
-	color: #101010;
 }
 
 .ui-autocomplete li a {
 	display: block;
 	height: 100%;
 	padding: 4px 10px;
-	color: #333;
 }
 
 .ui-autocomplete li a.ui-state-hover {
-	background-color: #ddd;
 	cursor: pointer;
 }
 

Modified: trunk/wp-admin/includes/dashboard.php (20983 => 20984)


--- trunk/wp-admin/includes/dashboard.php	2012-06-04 14:43:19 UTC (rev 20983)
+++ trunk/wp-admin/includes/dashboard.php	2012-06-04 14:50:50 UTC (rev 20984)
@@ -444,14 +444,14 @@
 
 	<form name="searchform" action="<?php echo network_admin_url('users.php'); ?>" method="get">
 		<p>
-			<input type="search" name="s" value="" size="17" id="all-user-search-input" />
+			<input type="search" name="s" value="" size="30" id="all-user-search-input" />
 			<?php submit_button( __( 'Search Users' ), 'button', 'submit', false, array( 'id' => 'submit_users' ) ); ?>
 		</p>
 	</form>
 
 	<form name="searchform" action="<?php echo network_admin_url('sites.php'); ?>" method="get">
 		<p>
-			<input type="search" name="s" value="" size="17" id="site-search-input" />
+			<input type="search" name="s" value="" size="30" id="site-search-input" />
 			<?php submit_button( __( 'Search Sites' ), 'button', 'submit', false, array( 'id' => 'submit_sites' ) ); ?>
 		</p>
 	</form>

Modified: trunk/wp-admin/js/site-search.dev.js (20983 => 20984)


--- trunk/wp-admin/js/site-search.dev.js	2012-06-04 14:43:19 UTC (rev 20983)
+++ trunk/wp-admin/js/site-search.dev.js	2012-06-04 14:50:50 UTC (rev 20984)
@@ -1,9 +1,11 @@
 jQuery( function($) {
+	var isRTL = !! ( 'undefined' != typeof isRtl && isRtl );
 	$( '#site-search-input' ).autocomplete({
-		source:   ajaxurl + '?action=autocomplete-site',
-		delay:    500,
+		source:    ajaxurl + '?action=autocomplete-site',
+		delay:     500,
 		minLength: 2,
-		open: function(e, ui) { $(this).addClass('open'); },
-		close: function(e, ui) { $(this).removeClass('open'); }
+		position:  isRTL ? { my: 'right top', at: 'right bottom', offset: '0, -1' } : { offset: '0, -1' },
+		open:      function(e, ui) { $(this).addClass('open'); },
+		close:     function(e, ui) { $(this).removeClass('open'); }
 	});
 });

Modified: trunk/wp-admin/js/user-search.dev.js (20983 => 20984)


--- trunk/wp-admin/js/user-search.dev.js	2012-06-04 14:43:19 UTC (rev 20983)
+++ trunk/wp-admin/js/user-search.dev.js	2012-06-04 14:50:50 UTC (rev 20984)
@@ -1,27 +1,38 @@
 jQuery( function($) {
-	var id = typeof( current_site_id ) != 'undefined' ? '&site_id=' + current_site_id : '';
+	var id = typeof( current_site_id ) != 'undefined' ? '&site_id=' + current_site_id : '',
+	    isRTL = !! ( 'undefined' != typeof isRtl && isRtl ),
+	    position = isRTL ? { my: 'right top', at: 'right bottom', offset: '0, -1' } : { offset: '0, -1' },
+	    open = function(e, ui) {
+	    	$(this).addClass('open');
+	    },
+	    close = function(e, ui) {
+	    	$(this).removeClass('open');
+	    };
 
 	$( '#adduser-email, #newuser' ).autocomplete({
-		source:   ajaxurl + '?action=autocomplete-user&autocomplete_type=add' + id,
-		delay:    500,
+		source:    ajaxurl + '?action=autocomplete-user&autocomplete_type=add' + id,
+		delay:     500,
 		minLength: 2,
-		open: function(e, ui) { $(this).addClass('open'); },
-		close: function(e, ui) { $(this).removeClass('open'); }
+		position:  position,
+		open:      open,
+		close:     close
 	});
 
 	$( '#user-search-input' ).autocomplete({
-		source:   ajaxurl + '?action=autocomplete-user&autocomplete_type=search' + id,
-		delay:    500,
+		source:    ajaxurl + '?action=autocomplete-user&autocomplete_type=search' + id,
+		delay:     500,
 		minLength: 2,
-		open: function(e, ui) { $(this).addClass('open'); },
-		close: function(e, ui) { $(this).removeClass('open'); }
+		position:  position,
+		open:      open,
+		close:     close
 	});
 
 	$( '#all-user-search-input' ).autocomplete({
-		source:   ajaxurl + '?action=autocomplete-user&autocomplete_type=search-all' + id,
-		delay:    500,
+		source:    ajaxurl + '?action=autocomplete-user&autocomplete_type=search-all' + id,
+		delay:     500,
 		minLength: 2,
-		open: function(e, ui) { $(this).addClass('open'); },
-		close: function(e, ui) { $(this).removeClass('open'); }
+		position:  position,
+		open:      open,
+		close:     close
 	});
 });