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:
parent
76017ffbd7
commit
0363b31fa6
|
@ -13,11 +13,11 @@
|
|||
require_once('admin.php');
|
||||
|
||||
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-dynamic-functions' );
|
||||
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( 'jquery-ui-dialog' );
|
||||
|
||||
|
@ -27,17 +27,6 @@ require_once (ABSPATH . WPINC . '/custom-navigation.php');
|
|||
wp_custom_navigation();
|
||||
|
||||
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);
|
||||
|
||||
return true;
|
||||
|
@ -410,24 +399,24 @@ function wp_custom_navigation() {
|
|||
?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
//GET PHP pages
|
||||
var dataposts = "<?php echo $page_name; ?>".split("|");
|
||||
|
||||
//Set autocomplete
|
||||
$("#page-search").autocomplete(dataposts);
|
||||
jQuery("#page-search").autocomplete(dataposts);
|
||||
|
||||
//Handle autocomplete result
|
||||
$("#page-search").result(function(event, data, formatted) {
|
||||
$('#existing-pages').css('display','block');
|
||||
$("#existing-pages dt:contains('" + data + "')").css("display", "block");
|
||||
jQuery("#page-search").result(function(event, data, formatted) {
|
||||
jQuery('#existing-pages').css('display','block');
|
||||
jQuery("#existing-pages dt:contains('" + data + "')").css("display", "block");
|
||||
|
||||
$('#show-pages').hide();
|
||||
$('#hide-pages').show();
|
||||
jQuery('#show-pages').hide();
|
||||
jQuery('#hide-pages').show();
|
||||
|
||||
});
|
||||
$('#existing-pages').css('display','none');
|
||||
jQuery('#existing-pages').css('display','none');
|
||||
});
|
||||
</script>
|
||||
|
||||
|
@ -499,24 +488,24 @@ function wp_custom_navigation() {
|
|||
?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
//GET PHP categories
|
||||
var datacats = "<?php echo $cat_name; ?>".split("|");
|
||||
|
||||
//Set autocomplete
|
||||
$("#cat-search").autocomplete(datacats);
|
||||
jQuery("#cat-search").autocomplete(datacats);
|
||||
|
||||
//Handle autocomplete result
|
||||
$("#cat-search").result(function(event, data, formatted) {
|
||||
$('#existing-categories').css('display','block');
|
||||
$("#existing-categories dt:contains('" + data + "')").css("display", "block");
|
||||
jQuery("#cat-search").result(function(event, data, formatted) {
|
||||
jQuery('#existing-categories').css('display','block');
|
||||
jQuery("#existing-categories dt:contains('" + data + "')").css("display", "block");
|
||||
|
||||
$('#show-cats').hide();
|
||||
$('#hide-cats').show();
|
||||
jQuery('#show-cats').hide();
|
||||
jQuery('#hide-cats').show();
|
||||
|
||||
});
|
||||
$('#existing-categories').css('display','none');
|
||||
jQuery('#existing-categories').css('display','none');
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -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_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_data( 'thickbox', 'group', 1 );
|
||||
$scripts->localize( 'thickbox', 'thickboxL10n', array(
|
||||
|
@ -397,14 +400,9 @@ function wp_default_scripts( &$scripts ) {
|
|||
|
||||
//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('custom-navigation-jquery'), '1.7.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_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-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' );
|
||||
|
|
Loading…
Reference in New Issue