Ticket #14045: 14045.6.diff
File 14045.6.diff, 6.3 KB (added by , 12 years ago) |
---|
-
wp-admin/js/nav-menu.js
42 42 43 43 this.attachUnsavedChangesListener(); 44 44 45 if ( api.menuList.length )45 if ( api.menuList.length ) 46 46 this.initSortables(); 47 47 48 if ( menu.oneThemeLocationNoMenus )48 if ( menus.oneThemeLocationNoMenus ) 49 49 $( '#posttype-page' ).addSelectedToMenu( api.addMenuItemToBottom ); 50 50 51 51 this.initAccessibility(); … … 162 162 163 163 return this.each(function() { 164 164 var t = $(this), menuItems = {}, 165 checkboxes = ( menu .oneThemeLocationNoMenus && 0 == t.find('.tabs-panel-active .categorychecklist li input:checked').length ) ? t.find('#page-all li input[type="checkbox"]') : t.find('.tabs-panel-active .categorychecklist li input:checked'),165 checkboxes = ( menus.oneThemeLocationNoMenus && 0 == t.find('.tabs-panel-active .categorychecklist li input:checked').length ) ? t.find('#page-all li input[type="checkbox"]') : t.find('.tabs-panel-active .categorychecklist li input:checked'), 166 166 re = new RegExp('menu-item\\[(\[^\\]\]*)'); 167 167 168 168 processMethod = processMethod || api.addMenuItemToBottom; … … 428 428 429 429 // Where can they move this menu item? 430 430 if ( 0 !== position ) { 431 var thisLink = menuItem.find( '.menus-move-up' ), 432 thisLinkText = thisLink.text(); 433 thisLink.prop('title', menus.move + ' ' + thisLinkText).show(); 431 var thisLink = menuItem.find( '.menus-move-up' ); 432 thisLink.prop( 'title', menus.moveUp ).show(); 434 433 } 435 434 436 435 if ( 0 !== position && isPrimaryMenuItem ) { 437 var thisLink = menuItem.find( '.menus-move-top' ), 438 thisLinkText = thisLink.text(); 439 thisLink.prop('title', menus.move + ' ' + thisLinkText).show(); 436 var thisLink = menuItem.find( '.menus-move-top' ); 437 thisLink.prop( 'title', menus.moveToTop ).show(); 440 438 } 441 439 442 440 if ( position + 1 !== totalMenuItems && 0 !== position ) { 443 var thisLink = menuItem.find( '.menus-move-down' ), 444 thisLinkText = thisLink.text(); 445 thisLink.prop('title', menus.move + ' ' + thisLinkText).show(); 441 var thisLink = menuItem.find( '.menus-move-down' ); 442 thisLink.prop( 'title', menus.moveDown ).show(); 446 443 } 447 444 448 445 if ( 0 === position && 0 !== hasSameDepthSibling ) { 449 var thisLink = menuItem.find( '.menus-move-down' ), 450 thisLinkText = thisLink.text(); 451 thisLink.prop('title', menus.move + ' ' + thisLinkText).show(); 446 var thisLink = menuItem.find( '.menus-move-down' ); 447 thisLink.prop( 'title', menus.moveDown ).show(); 452 448 } 453 449 454 450 if ( ! isPrimaryMenuItem ) { 455 451 var thisLink = menuItem.find( '.menus-move-left' ), 456 thisLinkText = menus.outFrom + ' ' + prevItemNameLeft;457 thisLink.prop( 'title', menus.move + ' ' + thisLinkText).html(thisLinkText).show();452 thisLinkText = menus.outFrom.replace( '%s', prevItemNameLeft ); 453 thisLink.prop( 'title', menus.moveOutFrom.replace( '%s', prevItemNameLeft ) ).html( thisLinkText ).show(); 458 454 } 459 455 460 456 if ( 0 !== position ) { 461 457 if ( menuItem.find( '.menu-item-data-parent-id' ).val() !== menuItem.prev().find( '.menu-item-data-db-id' ).val() ) { 462 458 var thisLink = menuItem.find( '.menus-move-right' ), 463 thisLinkText = menus.under + ' ' + prevItemNameRight;464 thisLink.prop( 'title', menus.move + ' ' + thisLinkText).html(thisLinkText).show();459 thisLinkText = menus.under.replace( '%s', prevItemNameRight ); 460 thisLink.prop( 'title', menus.moveUnder.replace( '%s', prevItemNameRight ) ).html( thisLinkText ).show(); 465 461 } 466 462 } 467 463 … … 471 467 totalMenuItems = primaryItems.length, 472 468 473 469 // String together help text for primary menu items 474 title = itemName + '. ' + menus.menuFocus.replace('%d', itemPosition).replace('%d', totalMenuItems) + '.';470 title = menus.menuFocus.replace( '%1$s', itemName ).replace( '%2$d', itemPosition ).replace( '%3$d', totalMenuItems ); 475 471 } else { 476 472 var parentItem = menuItem.prevAll( '.menu-item-depth-' + parseInt( depth - 1 ) ).first(), 477 473 parentItemId = parentItem.find( '.menu-item-data-db-id' ).val(), 478 474 parentItemName = parentItem.find( '.menu-item-title' ).text(), 479 475 subItems = $( '.menu-item .menu-item-data-parent-id[value="' + parentItemId + '"]' ), 480 itemPosition = $( subItems.parents('.menu-item').get().reverse()).index( menuItem ) + 1;476 itemPosition = $( subItems.parents('.menu-item').get().reverse() ).index( menuItem ) + 1; 481 477 482 478 // String together help text for sub menu items 483 484 title = itemName + '. ' + menus.subMenuFocus.replace('%d', itemPosition) + parentItemName + '.'; 479 title = menus.subMenuFocus.replace( '%1$s', itemName ).replace( '%2$d', itemPosition ).replace( '%3$s', parentItemName ); 485 480 } 486 481 487 482 $this.prop('title', title).html( title ); -
wp-admin/nav-menus.php
355 355 $one_theme_location_no_menus = ( 1 == count( get_registered_nav_menus() ) && ! $add_new_screen && empty( $nav_menus ) && ! empty( $page_count->publish ) ) ? true : false; 356 356 357 357 $l10n = array( 358 "oneThemeLocationNoMenus" => ( $one_theme_location_no_menus ) ? 'true' : 'false', 359 "move" => __( 'Move' ), 360 "menuFocus" => __( 'Menu item %d of %d' ), 361 "subMenuFocus" => __( 'Sub item number %d under' ), 362 "under" => __( 'Under' ), 363 "outFrom" => __( 'Out from under' ) 358 'oneThemeLocationNoMenus' => $one_theme_location_no_menus, 359 'moveUp' => __( 'Move up one' ), 360 'moveDown' => __( 'Move down one' ), 361 'moveToTop' => __( 'Move to the top' ), 362 /* translators: %s: previous item name */ 363 'moveUnder' => __( 'Move under %s' ), 364 /* translators: %s: previous item name */ 365 'moveOutFrom' => __( 'Move out from under %s' ), 366 /* translators: %s: previous item name */ 367 'under' => __( 'Under %s' ), 368 /* translators: %s: previous item name */ 369 'outFrom' => __( 'Out from under %s' ), 370 /* translators: 1: item name, 2: item position, 3: total number of items */ 371 'menuFocus' => __( '%1$s. Menu item %2$d of %3$d.' ), 372 /* translators: 1: item name, 2: item position, 3: parent item name */ 373 'subMenuFocus' => __( '%1$s. Sub item number %2$d under %3$s.' ), 364 374 ); 365 375 wp_localize_script( 'nav-menu', 'menus', $l10n ); 366 376