Ticket #23119: 23119.10.diff
| File 23119.10.diff, 7.6 KB (added by lessbloat, 5 months ago) |
|---|
-
wp-admin/includes/nav-menu.php
80 80 } 81 81 82 82 $title = empty( $item->label ) ? $title : $item->label; 83 84 $submenu_text = ''; 85 if (0 == $depth) 86 $submenu_text = 'style="display: none;"'; 83 87 84 88 ?> 85 89 <li id="menu-item-<?php echo $item_id; ?>" class="<?php echo implode(' ', $classes ); ?>"> 86 90 <dl class="menu-item-bar"> 87 91 <dt class="menu-item-handle"> 88 <span class="item-title"><?php echo esc_html( $title ); ?> </span>92 <span class="item-title"><?php echo esc_html( $title ); ?> <span class="is-submenu" <?php echo $submenu_text; ?>><?php _e( 'sub menu' ); ?></span></span> 89 93 <span class="item-controls"> 90 94 <span class="item-type"><?php echo esc_html( $item->type_label ); ?></span> 91 95 <span class="item-order hide-if-js"> … … 383 387 function wp_nav_menu_setup() { 384 388 // Register meta boxes 385 389 if ( wp_get_nav_menus() ) 386 add_meta_box( 'nav-menu-theme-locations', __( ' Theme Locations' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' );390 add_meta_box( 'nav-menu-theme-locations', __( 'Menus within your theme' ), 'wp_nav_menu_locations_meta_box' , 'nav-menus', 'side', 'default' ); 387 391 add_meta_box( 'add-custom-links', __('Custom Links'), 'wp_nav_menu_item_link_meta_box', 'nav-menus', 'side', 'default' ); 388 392 wp_nav_menu_post_type_meta_boxes(); 389 393 wp_nav_menu_taxonomy_meta_boxes(); … … 489 493 $menu_locations = get_nav_menu_locations(); 490 494 $num_locations = count( array_keys($locations) ); 491 495 492 echo '<p class="howto">' . sprintf( _n('Your theme supports %s menu. Select which menu you would like to use.', 'Your theme supports %s menus. Select which menu appears in each location.', $num_locations ), number_format_i18n($num_locations)) . '</p>';496 echo '<p class="howto">' . _n('Select a menu to use within your theme.', 'Select the menus you will use in your theme.', $num_locations ) . '</p>'; 493 497 494 498 foreach ( $locations as $location => $description ) { 495 499 ?> -
wp-admin/js/nav-menu.js
48 48 this.initToggles(); 49 49 50 50 this.initTabManager(); 51 52 this.messageFadeIn(); 51 53 }, 52 54 53 55 jQueryExtensions : function() { … … 222 224 } 223 225 }); 224 226 }, 227 228 messageFadeIn : function() { 229 var messages = $('#message'); 230 231 // Visual change when users save menus multiple times in a row 232 if (messages.is(':visible')) 233 messages.hide().slideDown('slow'); 234 }, 225 235 226 236 initToggles : function() { 227 237 // init postboxes … … 245 255 menuEdge = api.menuList.offset().left, 246 256 body = $('body'), maxChildDepth, 247 257 menuMaxDepth = initialMenuMaxDepth(); 258 259 if( 0 != $('#menu-to-edit li').length ) 260 $('.drag-instructions').show(); 248 261 249 262 // Use the right edge if RTL. 250 263 menuEdge += api.isRTL ? api.menuList.width() : 0; … … 307 320 308 321 // Return child elements to the list 309 322 children = transport.children().insertAfter(ui.item); 323 324 // Add "sub menu" description 325 var subMenuTitle = ui.item.find('.item-title .is-submenu'); 326 if (0 < currentDepth) 327 subMenuTitle.show(); 328 else 329 subMenuTitle.hide(); 310 330 311 331 // Update depth classes 312 332 if( depthChange != 0 ) { … … 461 481 if( '' == $t.val() ) 462 482 $t.addClass( name ).val( $t.data(name) ); 463 483 }); 484 485 $('.blank-slate .input-with-default-title').focus(); 464 486 }, 465 487 466 488 attachThemeLocationsListeners : function() { … … 572 594 $.post( ajaxurl, params, function(menuMarkup) { 573 595 var ins = $('#menu-instructions'); 574 596 processMethod(menuMarkup, params); 597 // Make it stand out a bit more visually, by adding a fadeIn 598 $('li.pending').hide().fadeIn('slow'); 599 $('.drag-instructions').show(); 575 600 if( ! ins.hasClass('menu-instructions-inactive') && ins.siblings().length ) 576 601 ins.addClass('menu-instructions-inactive'); 577 602 callback(); … … 945 970 var ins = $('#menu-instructions'); 946 971 el.remove(); 947 972 children.shiftDepthClass(-1).updateParentMenuItemDBId(); 948 if( ! ins.siblings().length ) 973 if( 0 == $('#menu-to-edit li').length ) { 974 $('.drag-instructions').hide(); 949 975 ins.removeClass('menu-instructions-inactive'); 976 } 950 977 }); 951 978 }, 952 979 -
wp-admin/nav-menus.php
531 531 <form id="update-nav-menu" action="<?php echo admin_url( 'nav-menus.php' ); ?>" method="post" enctype="multipart/form-data"> 532 532 <div id="nav-menu-header"> 533 533 <div id="submitpost" class="submitbox"> 534 <div class="major-publishing-actions ">534 <div class="major-publishing-actions <?php if ( isset( $_GET['menu'] ) && 0 == $_GET['menu'] || empty( $nav_menus ) ) echo 'blank-slate'; ?>"> 535 535 <label class="menu-name-label howto open-label" for="menu-name"> 536 536 <span><?php _e('Menu Name'); ?></span> 537 537 <input name="menu-name" id="menu-name" type="text" class="menu-name regular-text menu-item-textbox input-with-default-title" title="<?php esc_attr_e('Enter menu name here'); ?>" value="<?php echo esc_attr( $nav_menu_selected_title ); ?>" /> … … 574 574 <div id="post-body"> 575 575 <div id="post-body-content"> 576 576 <?php 577 if ( isset( $edit_markup ) ) { 577 $drag_instructions = ''; 578 if ( empty( $ordered_menu_items ) ) 579 $drag_instructions = 'style="display: none;"'; 580 581 if ( isset( $edit_markup ) ) { 582 echo '<div class="drag-instructions post-body-plain" ' . $drag_instructions . '>'; 583 echo '<p>' . __('Drag each item into the order you prefer. Click an item to reveal additional configuration options.') . '</p>'; 584 echo '</div>'; 585 578 586 if ( ! is_wp_error( $edit_markup ) ) 579 587 echo $edit_markup; 580 588 } else if ( empty( $nav_menu_selected_id ) ) { 581 589 echo '<div class="post-body-plain">'; 582 echo '<p>' . __('To create a custom menu, give it a name above and click Create Menu. Then choose items like pages, categories or custom links from the left column to add to this menu.') . '</p>'; 583 echo '<p>' . __('After you have added your items, drag and drop to put them in the order you want. You can also click each item to reveal additional configuration options.') . '</p>'; 584 echo '<p>' . __('When you have finished building your custom menu, make sure you click the Save Menu button.') . '</p>'; 590 echo '<p>' . __('Give your custom menu a name above, then click Create Menu.') . '</p>'; 585 591 echo '</div>'; 586 592 } 587 593 ?> -
wp-admin/css/wp-admin.css
6785 6785 position: relative; 6786 6786 } 6787 6787 6788 .blank-slate br { 6789 display: none; 6790 } 6791 6792 .blank-slate .menu-name { 6793 height: 2em; 6794 } 6795 6796 .is-submenu { 6797 color: #999; 6798 font-style: italic; 6799 font-weight: normal; 6800 margin-left: 4px; 6801 } 6802 6788 6803 /* Menu Container */ 6789 6804 #menu-management-liquid { 6790 6805 float: left; … … 7080 7095 } 7081 7096 7082 7097 #menu-to-edit { 7083 padding: 1em 0;7098 padding: 0.1em 0; 7084 7099 } 7085 7100 7086 7101 .menu ul { … … 7326 7341 margin: 5px 0 1px; 7327 7342 } 7328 7343 7344 .nav-menus-php .blank-slate .publishing-action { 7345 float: left; 7346 margin: 1px 0 0; 7347 } 7348 7329 7349 .nav-menus-php .major-publishing-actions .delete-action { 7330 7350 vertical-align: middle; 7331 7351 text-align: left;
