Move autocomplete to standard jquery directory. Use core jQuery. Use jQuery instead of $. see #11817

git-svn-id: http://svn.automattic.com/wordpress/trunk@13263 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-02-20 23:35:05 +00:00
parent 76017ffbd7
commit 0363b31fa6
4 changed files with 22 additions and 35 deletions

View File

@ -13,11 +13,11 @@
require_once('admin.php'); require_once('admin.php');
wp_admin_css( 'custom-navigation' ); wp_admin_css( 'custom-navigation' );
wp_enqueue_script( 'custom-navigation-jquery' ); wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'custom-navigation-ui-custom' ); wp_enqueue_script( 'custom-navigation-ui-custom' );
wp_enqueue_script( 'custom-navigation-dynamic-functions' ); wp_enqueue_script( 'custom-navigation-dynamic-functions' );
wp_enqueue_script( 'custom-navigation-default-items' ); wp_enqueue_script( 'custom-navigation-default-items' );
wp_enqueue_script( 'custom-navigation-autocomplete' ); wp_enqueue_script( 'jquery-autocomplete' );
wp_enqueue_script( 'custom-navigation-php-functions' ); wp_enqueue_script( 'custom-navigation-php-functions' );
wp_enqueue_script( 'jquery-ui-dialog' ); wp_enqueue_script( 'jquery-ui-dialog' );
@ -27,17 +27,6 @@ require_once (ABSPATH . WPINC . '/custom-navigation.php');
wp_custom_navigation(); wp_custom_navigation();
function wp_custom_nav_reset() { function wp_custom_nav_reset() {
global $wpdb;
$table_name = $wpdb->prefix . "custom_nav_records";
//DROP existing menu records
$wpdb->query("DELETE FROM ".$table_name);
$table_name_menus = $wpdb->prefix . "custom_nav_menus";
//DELETE existing menus
$wpdb->query("DELETE FROM ".$table_name_menus);
wp_custom_navigation_setup(true); wp_custom_navigation_setup(true);
return true; return true;
@ -410,24 +399,24 @@ function wp_custom_navigation() {
?> ?>
<script> <script>
$(document).ready(function(){ jQuery(document).ready(function(){
//GET PHP pages //GET PHP pages
var dataposts = "<?php echo $page_name; ?>".split("|"); var dataposts = "<?php echo $page_name; ?>".split("|");
//Set autocomplete //Set autocomplete
$("#page-search").autocomplete(dataposts); jQuery("#page-search").autocomplete(dataposts);
//Handle autocomplete result //Handle autocomplete result
$("#page-search").result(function(event, data, formatted) { jQuery("#page-search").result(function(event, data, formatted) {
$('#existing-pages').css('display','block'); jQuery('#existing-pages').css('display','block');
$("#existing-pages dt:contains('" + data + "')").css("display", "block"); jQuery("#existing-pages dt:contains('" + data + "')").css("display", "block");
$('#show-pages').hide(); jQuery('#show-pages').hide();
$('#hide-pages').show(); jQuery('#hide-pages').show();
}); });
$('#existing-pages').css('display','none'); jQuery('#existing-pages').css('display','none');
}); });
</script> </script>
@ -499,24 +488,24 @@ function wp_custom_navigation() {
?> ?>
<script> <script>
$(document).ready(function(){ jQuery(document).ready(function(){
//GET PHP categories //GET PHP categories
var datacats = "<?php echo $cat_name; ?>".split("|"); var datacats = "<?php echo $cat_name; ?>".split("|");
//Set autocomplete //Set autocomplete
$("#cat-search").autocomplete(datacats); jQuery("#cat-search").autocomplete(datacats);
//Handle autocomplete result //Handle autocomplete result
$("#cat-search").result(function(event, data, formatted) { jQuery("#cat-search").result(function(event, data, formatted) {
$('#existing-categories').css('display','block'); jQuery('#existing-categories').css('display','block');
$("#existing-categories dt:contains('" + data + "')").css("display", "block"); jQuery("#existing-categories dt:contains('" + data + "')").css("display", "block");
$('#show-cats').hide(); jQuery('#show-cats').hide();
$('#hide-cats').show(); jQuery('#hide-cats').show();
}); });
$('#existing-categories').css('display','none'); jQuery('#existing-categories').css('display','none');
}); });
</script> </script>

View File

@ -164,6 +164,9 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array('jquery', 'jquery-hotkeys'), '20090102' ); $scripts->add( 'jquery-table-hotkeys', "/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js", array('jquery', 'jquery-hotkeys'), '20090102' );
$scripts->add_data( 'jquery-table-hotkeys', 'group', 1 ); $scripts->add_data( 'jquery-table-hotkeys', 'group', 1 );
$scripts->add( 'jquery-autocomplete', "/wp-includes/js/jquery/autocomplete$suffix.js", array('jquery'), '1.1' );
$scripts->add_data( 'jquery-autocomplete', 'group', 1 );
$scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20100108'); $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20100108');
$scripts->add_data( 'thickbox', 'group', 1 ); $scripts->add_data( 'thickbox', 'group', 1 );
$scripts->localize( 'thickbox', 'thickboxL10n', array( $scripts->localize( 'thickbox', 'thickboxL10n', array(
@ -397,14 +400,9 @@ function wp_default_scripts( &$scripts ) {
//Custom Navigation //Custom Navigation
$scripts->add( 'custom-navigation-jquery', '/wp-admin/js/custom-navigation-custom-jquery-1.3.2.js', false, '1.3.2' ); $scripts->add( 'custom-navigation-ui-custom', '/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.js', array('jquery'), '1.7.2' );
$scripts->add( 'custom-navigation-ui-custom', '/wp-admin/js/custom-navigation-custom-jquery-ui-1.7.2.js', array('custom-navigation-jquery'), '1.7.2' );
$scripts->add_data( 'custom-navigation-ui-custom', 'group', 1 ); $scripts->add_data( 'custom-navigation-ui-custom', 'group', 1 );
$scripts->add( 'custom-navigation-autocomplete', '/wp-admin/js/custom-navigation-custom-jquery-autocomplete.js', array('custom-navigation-jquery'), '1.0.0' );
$scripts->add_data( 'custom-navigation-autocomplete', 'group', 1 );
$scripts->add( 'custom-navigation-default-items', '/wp-admin/js/custom-navigation-default-items.js', false, '1.0.0' ); $scripts->add( 'custom-navigation-default-items', '/wp-admin/js/custom-navigation-default-items.js', false, '1.0.0' );
$scripts->add( 'custom-navigation-dynamic-functions', '/wp-admin/js/custom-navigation-dynamic-functions.js', false, '1.0.0' ); $scripts->add( 'custom-navigation-dynamic-functions', '/wp-admin/js/custom-navigation-dynamic-functions.js', false, '1.0.0' );
$scripts->add( 'custom-navigation-php-functions', '/wp-admin/js/custom-navigation-php-functions.js', false, '1.0.0' ); $scripts->add( 'custom-navigation-php-functions', '/wp-admin/js/custom-navigation-php-functions.js', false, '1.0.0' );