summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-08-09 10:38:55 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-08-09 10:38:55 +0000
commit26d2e45d69e6be15f40164a9dbe80fbb7d31d1ab (patch)
tree834d79136f06a10c6b43d1e66a5c218473f37280
parent54ab58f165a4146b50796d3d6f5310e15f3e4a38 (diff)
Added global categories search back in.
AJAX now searches invisibly and only displays search box is result returned git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@146 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-inst/wp-admin/admin-functions.php11
-rw-r--r--wp-inst/wp-admin/edit-form-advanced.php2
2 files changed, 9 insertions, 4 deletions
diff --git a/wp-inst/wp-admin/admin-functions.php b/wp-inst/wp-admin/admin-functions.php
index 1d9b377..88944f4 100644
--- a/wp-inst/wp-admin/admin-functions.php
+++ b/wp-inst/wp-admin/admin-functions.php
@@ -1393,7 +1393,6 @@ function AJAX_search_box( $get_url, $search_field = 'newvalue', $search_results_
function update_AJAX_search_box( username )
{
document.getElementById("<?php echo $search_field ?>").value=username;
- document.getElementById("<?php echo $search_results_field ?>").innerHTML = "<?php _e( 'Search Results' ) ?>";
document.getElementById("<?php echo $search_results_field ?>").style.display = 'none';
return false;
}
@@ -1444,12 +1443,16 @@ function AJAX_search_box( $get_url, $search_field = 'newvalue', $search_results_
}
function doSearch() {
- displayBox.style.display = '';
- displayBox.innerHTML = "Searching ...";
xmlhttp.open("GET","<?php echo $get_url ?>"+valBox.value,true);
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4) {
- displayBox.innerHTML = xmlhttp.responseText;
+ if( xmlhttp.responseText != '' ) {
+ displayBox.style.display = '';
+ displayBox.innerHTML = xmlhttp.responseText;
+ } else {
+ valBox.focus();
+ displayBox.style.display = 'none';
+ }
}
}
xmlhttp.send(null);
diff --git a/wp-inst/wp-admin/edit-form-advanced.php b/wp-inst/wp-admin/edit-form-advanced.php
index a39fed7..84bdfca 100644
--- a/wp-inst/wp-admin/edit-form-advanced.php
+++ b/wp-inst/wp-admin/edit-form-advanced.php
@@ -87,8 +87,10 @@ addLoadEvent(focusit);
<p id="ajaxcat">
<input type="text" name="newcat" id="newcat" size="16" onkeyup="ajaxNewCatKeyUp(event);" />
<input type="button" name="Button" value="+" onclick="ajaxNewCat();" />
+ <div style='display:none; height: 60px; width: 100px; overflow: auto; border: 1px solid #ccc; background: #eee; margin: 5px; padding: 5px;' id="searchresults"><?php _e( 'Search Results' ) ?></div>
</p>
</div>
+<?php AJAX_search_box( "wpmu-edit.php?action=searchcategories&search=", "newcat", "searchresults" ); ?>
</fieldset>
<fieldset class="dbx-box">