Changeset 14267
- Timestamp:
- 04/28/2010 04:09:00 AM (15 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/nav-menu.dev.css
r14252 r14267 88 88 } 89 89 90 form.processing .add-to-menu {90 .processing .add-to-menu { 91 91 background: url("../images/wpspin_light.gif") no-repeat top center; 92 92 display:block; -
trunk/wp-admin/includes/nav-menu.php
r14248 r14267 261 261 **/ 262 262 function wp_nav_menu_meta_boxes_setup() { 263 add_meta_box( 'add-custom-links', __(' AddCustom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' );263 add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' ); 264 264 wp_nav_menu_post_type_meta_boxes(); 265 265 wp_nav_menu_taxonomy_meta_boxes(); … … 311 311 foreach ( $post_types as $post_type ) { 312 312 $id = $post_type->name; 313 add_meta_box( "add-{$id}", sprintf( __('Add %s'), $post_type->label ), 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type );313 add_meta_box( "add-{$id}", $post_type->label, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type ); 314 314 } 315 315 } … … 328 328 foreach ( $taxonomies as $tax ) { 329 329 $id = $tax->name; 330 add_meta_box( "add-{$id}", sprintf( __('Add %s'), $tax->label ), 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax );330 add_meta_box( "add-{$id}", $tax->label, 'wp_nav_menu_item_taxonomy_meta_box', 'nav-menus', 'side', 'default', $tax ); 331 331 } 332 332 } … … 487 487 $error = '<li id="error">'. sprintf( __( 'No %s exists' ), $post_type['args']->label ) .'</li>'; 488 488 489 $current_tab = ' search';489 $current_tab = 'all'; 490 490 if ( isset( $_REQUEST[$post_type_name . '-tab'] ) && in_array( $_REQUEST[$post_type_name . '-tab'], array('all', 'search') ) ) { 491 491 $current_tab = $_REQUEST[$post_type_name . '-tab']; … … 508 508 <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv"> 509 509 <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs"> 510 <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="menu-tab-link" href="<?php echo add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args)); ?>#<?php echo $post_type_name; ?>-all"><?php _e('View All'); ?></a></li> 510 511 <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="menu-tab-link" href="<?php echo add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args)); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search"><?php _e('Search'); ?></a></li> 511 <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>><a class="menu-tab-link" href="<?php echo add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args)); ?>#<?php echo $post_type_name; ?>-all"><?php _e('View All'); ?></a></li>512 512 </ul> 513 513 -
trunk/wp-admin/js/nav-menu.dev.js
r14248 r14267 112 112 }, 113 113 114 /** 115 * Get the parent element with the matching class, but go no higher than the form. 116 * 117 * @param DOM-element el The descendant element up from which we'll be searching 118 * @param string parentClass The class name of the desired parent element. 119 * @return DOM-element The parent element. 120 */ 121 getParentWrapper = function( el, parentClass ) { 122 var form = document.getElementById('nav-menu-meta'), 123 i; 124 125 while ( 126 el.parentNode && 127 ( ! el.className || -1 == el.className.indexOf(parentClass) ) && 128 el.parentNode != form 129 ) { 130 el = el.parentNode; 131 } 132 133 return el; 134 }, 135 114 136 makeDroppable = function(el) { 115 137 var that = this; … … 427 449 */ 428 450 eventSubmitMetaForm : function(thisForm, e) { 429 var inputs = thisForm.getElementsByTagName('input'), 451 var ancestor, 452 inputs = thisForm.getElementsByTagName('input'), 430 453 i = inputs.length, 431 454 j, … … 437 460 re = new RegExp('menu-item\\[(\[^\\]\]*)'); 438 461 439 thisForm.className = thisForm.className + ' processing',440 462 that = this; 441 463 … … 465 487 } 466 488 489 ancestor = getParentWrapper(inputs[i], 'inside'); 467 490 inputs[i].checked = false; 468 491 … … 474 497 -1 != inputs[i].className.search(/quick-search\b[^-]/) 475 498 ) { 499 ancestor = getParentWrapper(inputs[i], 'inside'); 476 500 params['action'] = 'menu-quick-search'; 477 501 params['q'] = inputs[i].value; … … 481 505 } 482 506 } 507 508 if ( ancestor ) 509 ancestor.className = ancestor.className + ' processing', 510 483 511 params['menu'] = thisForm.elements['menu'].value; 484 512 params['menu-settings-column-nonce'] = thisForm.elements['menu-settings-column-nonce'].value; … … 486 514 $.post( ajaxurl, params, function(menuMarkup) { 487 515 processMethod.call(that, menuMarkup, params); 488 thisForm.className = thisForm.className.replace(/processing/g, '');516 ancestor.className = ancestor.className.replace(/processing/g, ''); 489 517 }); 490 518 … … 593 621 resultList = document.getElementById(req.object_type + '-search-checklist'); 594 622 if ( resultList ) { 623 resultList.innerHTML = ''; 595 624 resultList.appendChild(items[0]); 596 625 } … … 600 629 resultList = document.getElementById(matched[1] + '-search-checklist'); 601 630 if ( resultList ) { 631 resultList.innerHTML = ''; 602 632 i = items.length; 603 633 while( i-- ) {
Note: See TracChangeset
for help on using the changeset viewer.