Ticket #31289: 31289.2.patch
| File 31289.2.patch, 8.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 cursor: default; 867 } 868 869 #customize-theme-controls .control-section-themes .accordion-section-title:hover, 870 #customize-theme-controls .control-section-themes .accordion-section-title:focus { 871 color: #555555; 872 background-color: #fff; 873 } 874 875 .control-section-themes .accordion-section-title { 876 margin: 15px 0; 877 } 878 879 .customize-themes-panel .accordion-section-title { 880 margin: 15px -8px; 881 } 882 883 .control-section-themes .accordion-section-title { 884 padding-right: 100px; /* Space for the button */ 885 } 886 887 .control-section-themes .accordion-section-title span { 888 font-size: small; 889 display: block; 890 font-weight: 400; 891 } 892 893 .control-section-themes .accordion-section-title .change-theme, 894 .control-section-themes .accordion-section-title .customize-theme { 895 position: absolute; 896 right: 10px; 897 top: 50%; 898 margin-top: -14px; 899 font-weight: normal; 900 } 901 865 902 .customize-themes-panel { 866 903 display: none; 867 904 padding: 0 8px; … … 869 906 box-sizing: border-box; 870 907 -webkit-box-sizing: border-box; 871 908 -moz-box-sizing: border-box; 909 box-sizing: border-box; 872 910 } 873 911 912 913 .customize-themes-panel > h2 { 914 padding: 15px 8px 0 8px; 915 } 916 874 917 .control-section.open .customize-themes-panel { 875 918 display: block; 876 919 } … … 913 956 width: 100%; 914 957 } 915 958 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 { 959 #accordion-section-themes .accordion-section-title:after { 923 960 display: none; 924 961 } 925 962 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 963 #customize-theme-controls .control-section-themes.current-panel > h3.accordion-section-title { 947 964 left: 0; 948 965 } … … 960 977 left: 100%; 961 978 } 962 979 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 980 /* Details View */ 976 981 .wp-customizer .theme-overlay { 977 982 display: none; … … 1019 1024 } 1020 1025 } 1021 1026 1022 1023 /** Handle cheaters. */ 1027 /* Handle cheaters. */ 1024 1028 body.cheatin { 1025 1029 font-size: medium; 1026 1030 height: auto; -
src/wp-admin/js/customize-controls.js
591 591 var section = this; 592 592 593 593 // Expand/Collapse section/panel. 594 section.container.find( '. accordion-section-title' ).on( 'click keydown', function( event ) {594 section.container.find( '.change-theme, .customize-theme' ).on( 'click keydown', function( event ) { 595 595 if ( api.utils.isKeydownButNotEnterEvent( event ) ) { 596 596 return; 597 597 } … … 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' ),696 panelTitle = section.find( '.accordion-section-title' ).first(),682 customizeBtn = section.find( '.customize-theme' ), 683 changeBtn = section.find( '.change-theme' ), 697 684 content = section.find( '.control-panel-content' ); 698 685 699 686 if ( expanded ) { … … 722 709 } 723 710 } ); 724 711 topPanel.attr( 'tabindex', '-1' ); 725 backBtn.attr( 'tabindex', '0' ); 726 backBtn.focus(); 712 customizeBtn.focus(); 727 713 } else { 728 714 siblings.removeClass( 'open' ); 729 715 section.removeClass( 'current-panel' ); … … 735 721 } 736 722 } ); 737 723 topPanel.attr( 'tabindex', '0' ); 738 backBtn.attr( 'tabindex', '-1' ); 739 panelTitle.focus(); 724 changeBtn.focus(); 740 725 container.scrollTop( 0 ); 741 726 } 742 727 }, … … 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
341 341 $classes = 'accordion-section control-section control-section-' . $this->type; 342 342 ?> 343 343 <li id="accordion-section-<?php echo esc_attr( $this->id ); ?>" class="<?php echo esc_attr( $classes ); ?>"> 344 <h3 class="accordion-section-title" tabindex="0"> 345 <?php echo esc_html( $this->title ); ?> 346 <span class="screen-reader-text"><?php _e( 'Press return or enter to expand' ); ?></span> 344 <h3 class="accordion-section-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> 347 356 </h3> 348 357 <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> 358 <h2> 359 <?php _e( 'Themes' ); ?> 360 <span class="title-count theme-count"><?php echo count( $this->controls ); ?></span> 351 361 </h2> 362 363 <h3 class="accordion-section-title customize-section-title"> 364 <?php 365 if ( $this->manager->is_theme_active() ) { 366 /* translators: %s: theme name */ 367 printf( __( '<span>Active theme</span> %s' ), $this->title ); 368 } else { 369 /* translators: %s: theme name */ 370 printf( __( '<span>Previewing theme</span> %s' ), $this->title ); 371 } 372 ?> 373 <button type="button" class="button customize-theme"><?php _e( 'Customize' ); ?></button> 374 </h3> 375 352 376 <div class="theme-overlay" tabindex="0" role="dialog" aria-label="<?php esc_attr_e( 'Theme Details' ); ?>"></div> 377 353 378 <div id="customize-container"></div> 354 <?php if ( 6 < count( $this->controls )) : ?>379 <?php if ( count( $this->controls ) > 5 ) : ?> 355 380 <p><label for="themes-filter"> 356 381 <span class="screen-reader-text"><?php _e( 'Search installed themes...' ); ?></span> 357 382 <input type="search" id="themes-filter" placeholder="<?php esc_attr_e( 'Search installed themes...' ); ?>" />