Ticket #31289: 31289.patch
| File 31289.patch, 7.9 KB (added by , 11 years ago) |
|---|
-
src/wp-admin/css/customize-controls.css
862 862 animation: customize-reload .75s; 863 863 } 864 864 865 .control-section-themes .accordion-section-title { 866 margin: 15px 0; 867 } 868 869 .customize-themes-panel .accordion-section-title { 870 margin: 15px -8px; 871 } 872 873 .control-section-themes .accordion-section-title { 874 padding-right: 100px; /* Space for the button */ 875 } 876 877 .control-section-themes .accordion-section-title span { 878 font-size: small; 879 display: block; 880 font-weight: 400; 881 } 882 883 .control-section-themes .accordion-section-title .change-theme { 884 position: absolute; 885 right: 10px; 886 top: 50%; 887 margin-top: -14px; 888 font-weight: normal; 889 } 890 865 891 .customize-themes-panel { 866 892 display: none; 867 893 padding: 0 8px; … … 869 895 box-sizing: border-box; 870 896 -webkit-box-sizing: border-box; 871 897 -moz-box-sizing: border-box; 898 box-sizing: border-box; 872 899 } 873 900 874 901 .control-section.open .customize-themes-panel { … … 913 940 width: 100%; 914 941 } 915 942 916 917 .wp-customizer .theme-browser .theme.active:hover, 918 .wp-customizer .theme-browser .theme.active:focus { 919 cursor: default; 920 } 921 922 .wp-customizer .theme-browser .theme.active .more-details { 943 #accordion-section-themes .accordion-section-title:after { 923 944 display: none; 924 945 } 925 946 926 .wp-customizer .theme-browser .theme.active .theme-name {927 padding-right: 15px;928 }929 930 .wp-customizer .theme-browser.rendered .theme.active:hover .theme-screenshot img,931 .wp-customizer .theme-browser.rendered .theme.active:focus .theme-screenshot img {932 opacity: 1;933 }934 935 /* Panel-like behavior */936 #accordion-section-themes .accordion-section-title:after {937 content: "\f148";938 }939 940 .rtl #accordion-section-themes .accordion-section-title:after {941 -webkit-transform: rotate(180deg);942 -ms-transform: rotate(180deg);943 transform: rotate(180deg);944 }945 946 947 #customize-theme-controls .control-section-themes.current-panel > h3.accordion-section-title { 947 948 left: 0; 948 949 } … … 960 961 left: 100%; 961 962 } 962 963 963 .in-themes-panel .control-panel-back:before {964 content: "\f345";965 left: 14px;966 }967 968 .in-themes-panel .control-panel-back {969 left: 0;970 }971 972 .in-themes-panel .control-panel-back:before {973 }974 975 964 /* Details View */ 976 965 .wp-customizer .theme-overlay { 977 966 display: none; … … 1019 1008 } 1020 1009 } 1021 1010 1022 1023 /** Handle cheaters. */ 1011 /* Handle cheaters. */ 1024 1012 body.cheatin { 1025 1013 font-size: medium; 1026 1014 height: auto; -
src/wp-admin/js/customize-controls.js
604 604 } 605 605 }); 606 606 607 608 $( '#customize-header-actions' ).on( 'click keydown', '.control-panel-back', function( event ) {609 if ( api.utils.isKeydownButNotEnterEvent( event ) ) {610 return;611 }612 613 event.preventDefault(); // Keep this AFTER the key filter above614 615 if ( section.expanded() ) {616 section.collapse();617 }618 });619 620 607 // Theme navigation in details view. 621 608 section.container.on( 'click keydown', '.left', function( event ) { 622 609 if ( api.utils.isKeydownButNotEnterEvent( event ) ) { … … 692 679 container = section.closest( '.wp-full-overlay-sidebar-content' ), 693 680 siblings = container.find( '.open' ), 694 681 topPanel = overlay.find( '#customize-theme-controls > ul > .accordion-section > .accordion-section-title' ).add( '#customize-info > .accordion-section-title' ), 695 backBtn = overlay.find( '.control-panel-back' ),682 backBtn = section.find( '.customize-section-title' ), 696 683 panelTitle = section.find( '.accordion-section-title' ).first(), 697 684 content = section.find( '.control-panel-content' ); 698 685 … … 722 709 } 723 710 } ); 724 711 topPanel.attr( 'tabindex', '-1' ); 725 backBtn.attr( 'tabindex', '0' );726 712 backBtn.focus(); 727 713 } else { 728 714 siblings.removeClass( 'open' ); … … 735 721 } 736 722 } ); 737 723 topPanel.attr( 'tabindex', '0' ); 738 backBtn.attr( 'tabindex', '-1' );739 724 panelTitle.focus(); 740 725 container.scrollTop( 0 ); 741 726 } … … 1899 1884 return; 1900 1885 } 1901 1886 1902 if ( $( this ).hasClass( 'active' ) ) {1903 return;1904 }1905 1906 1887 var previewUrl = $( this ).data( 'previewUrl' ); 1907 1888 1908 1889 $( '.wp-full-overlay' ).addClass( 'customize-loading' ); -
src/wp-includes/class-wp-customize-manager.php
1148 1148 /* Themes */ 1149 1149 1150 1150 $this->add_section( new WP_Customize_Themes_Section( $this, 'themes', array( 1151 'title' => sprintf( __( 'Theme: %s' ), $this->theme()->display('Name')),1151 'title' => $this->theme()->display( 'Name' ), 1152 1152 'capability' => 'switch_themes', 1153 'priority' => 0,1153 'priority' => 0, 1154 1154 ) ) ); 1155 1155 1156 1156 // Themes Setting (unused - the theme is considerably more fundamental to the Customizer experience). … … 1163 1163 // Theme Controls. 1164 1164 $themes = wp_prepare_themes_for_js(); 1165 1165 foreach ( $themes as $theme ) { 1166 if ( $theme['active'] ) { 1167 continue; 1168 } 1169 1166 1170 $theme_id = 'theme_' . $theme['id']; 1167 1171 $this->add_control( new WP_Customize_Theme_Control( $this, $theme_id, array( 1168 'theme' => $theme,1169 'section' => 'themes',1172 'theme' => $theme, 1173 'section' => 'themes', 1170 1174 'settings' => 'active_theme', 1171 1175 ) ) ); 1172 1176 } -
src/wp-includes/class-wp-customize-section.php
342 342 ?> 343 343 <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>"> 344 344 <h3 class="accordion-section-title" tabindex="0"> 345 <?php echo esc_html( $this->title ); ?> 345 <?php 346 if ( $this->manager->is_theme_active() ) { 347 /* translators: %s: theme name */ 348 printf( __( '<span>Active theme</span> %s' ), $this->title ); 349 } else { 350 /* translators: %s: theme name */ 351 printf( __( '<span>Previewing theme</span> %s' ), $this->title ); 352 } 353 ?> 354 355 <button type="button" class="button change-theme"><?php _ex( 'Change', 'theme' ); ?></button> 346 356 <span class="screen-reader-text"><?php _e( 'Press return or enter to expand' ); ?></span> 347 357 </h3> 348 358 <div class="customize-themes-panel control-panel-content themes-php"> 349 <h2><?php esc_html_e( 'Themes' ); ?> 350 <span class="title-count theme-count"><?php echo count( $this->controls ) - 1; ?></span> 359 <h2> 360 <?php _e( 'Themes' ); ?> 361 <span class="title-count theme-count"><?php echo count( $this->controls ); ?></span> 351 362 </h2> 363 364 <h3 class="accordion-section-title customize-section-title" tabindex="0"> 365 <?php 366 if ( $this->manager->is_theme_active() ) { 367 /* translators: %s: theme name */ 368 printf( __( '<span>Active theme</span> %s' ), $this->title ); 369 } else { 370 /* translators: %s: theme name */ 371 printf( __( '<span>Previewing theme</span> %s' ), $this->title ); 372 } 373 ?> 374 <button type="button" class="button change-theme"><?php _e( 'Customize' ); ?></button> 375 <span class="screen-reader-text"><?php _e( 'Press return or enter to return to customize' ); ?></span> 376 </h3> 377 352 378 <div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div> 379 353 380 <div id="customize-container"></div> 354 <?php if ( 6 < count( $this->controls )) : ?>381 <?php if ( count( $this->controls ) > 5 ) : ?> 355 382 <p><label for="themes-filter"> 356 383 <span class="screen-reader-text"><?php _e( 'Search installed themes...' ); ?></span> 357 384 <input type="search" id="themes-filter" placeholder="<?php esc_attr_e( 'Search installed themes...' ); ?>" />