Ticket #21283: 21283.7.diff
File 21283.7.diff, 10.3 KB (added by , 12 years ago) |
---|
-
wp-includes/class-wp-customize-section.php
80 80 protected function render() { 81 81 ?> 82 82 <li id="customize-section-<?php echo esc_attr( $this->id ); ?>" class="control-section customize-section"> 83 <h3 class="customize-section-title" t itle="<?php echo esc_attr( $this->description ); ?>"><?php echo esc_html( $this->title ); ?></h3>83 <h3 class="customize-section-title" tabindex="0" title="<?php echo esc_attr( $this->description ); ?>"><?php echo esc_html( $this->title ); ?></h3> 84 84 <ul class="customize-section-content"> 85 85 <?php 86 86 foreach ( $this->controls as $control ) -
wp-includes/class-wp-customize-control.php
521 521 <span class="customize-control-title"><?php echo esc_html( $this->label ); ?></span> 522 522 523 523 <div class="customize-control-content"> 524 <div class="dropdown preview-thumbnail" >524 <div class="dropdown preview-thumbnail" tabindex="0"> 525 525 <div class="dropdown-content"> 526 526 <?php if ( empty( $src ) ): ?> 527 527 <img style="display:none;" /> … … 537 537 <div class="library"> 538 538 <ul> 539 539 <?php foreach ( $this->tabs as $id => $tab ): ?> 540 <li data-customize-tab='<?php echo esc_attr( $id ); ?>' >540 <li data-customize-tab='<?php echo esc_attr( $id ); ?>' tabindex='0'> 541 541 <?php echo esc_html( $tab['label'] ); ?> 542 542 </li> 543 543 <?php endforeach; ?> -
wp-admin/customize.php
67 67 <body class="<?php echo esc_attr( $body_class ); ?>"> 68 68 <div class="wp-full-overlay expanded"> 69 69 <form id="customize-controls" class="wrap wp-full-overlay-sidebar"> 70 <div id="customize-header-actions" class="wp-full-overlay-header">71 <?php72 $save_text = $wp_customize->is_theme_active() ? __( 'Save & Publish' ) : __( 'Save & Activate' );73 submit_button( $save_text, 'primary', 'save', false );74 ?>75 <span class="spinner"></span>76 <a class="back button" href="<?php echo esc_url( $return ? $return : admin_url( 'themes.php' ) ); ?>">77 <?php _e( 'Cancel' ); ?>78 </a>79 </div>80 70 81 71 <?php 82 72 $screenshot = $wp_customize->theme()->get_screenshot(); 83 73 $cannot_expand = ! ( $screenshot || $wp_customize->theme()->get('Description') ); 84 74 ?> 85 75 86 <div class="wp-full-overlay-sidebar-content" >76 <div class="wp-full-overlay-sidebar-content" tabindex="-1"> 87 77 <div id="customize-info" class="customize-section<?php if ( $cannot_expand ) echo ' cannot-expand'; ?>"> 88 <div class="customize-section-title" >78 <div class="customize-section-title" aria-label="Theme Customizer Options" tabindex="0"> 89 79 <span class="preview-notice"><?php 90 80 /* translators: %s is the theme name in the Customize/Live Preview pane */ 91 81 echo sprintf( __( 'You are previewing %s' ), '<strong class="theme-name">' . $wp_customize->theme()->display('Name') . '</strong>' ); … … 113 103 </div> 114 104 115 105 <div id="customize-footer-actions" class="wp-full-overlay-footer"> 106 <?php 107 $save_text = $wp_customize->is_theme_active() ? __( 'Save & Publish' ) : __( 'Save & Activate' ); 108 submit_button( $save_text, 'primary save', 'save', false ); 109 ?> 110 <span class="spinner"></span> 111 <a class="back button" href="<?php echo esc_url( $return ? $return : admin_url( 'themes.php' ) ); ?>"> 112 <?php _e( 'Cancel' ); ?> 113 </a> 114 116 115 <a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>"> 117 116 <span class="collapse-sidebar-arrow"></span> 118 117 <span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span> -
wp-admin/js/customize-controls.js
94 94 else 95 95 statuses.hide(); 96 96 }; 97 97 98 var toggleFreeze = false; 99 98 100 // Support the .dropdown class to open/close complex elements 99 this.container.on( 'click ', '.dropdown', function( event ) {101 this.container.on( 'click focus', '.dropdown', function( event ) { 100 102 event.preventDefault(); 101 control.container.toggleClass('open'); 103 104 if (!toggleFreeze) 105 control.container.toggleClass('open'); 106 107 // Don't want to fire focus and click at same time 108 toggleFreeze = true; 109 setTimeout(function () { 110 toggleFreeze = false; 111 }, 400); 102 112 }); 103 113 104 114 this.setting.bind( update ); … … 210 220 }); 211 221 212 222 // Bind tab switch events 213 this.library.children('ul').on( 'click', 'li', function( event ) { 223 this.library.children('ul').on( 'click keydown', 'li', function( event ) { 224 225 if ( event.type === 'keydown' && 13 !== event.which ) 226 return; 227 214 228 var id = $(this).data('customizeTab'), 215 229 tab = control.tabs[ id ]; 216 230 … … 225 239 }); 226 240 227 241 // Bind events to switch image urls. 228 this.library.on( 'click', 'a', function( event ) { 242 this.library.on( 'click keydown', 'a', function( event ) { 243 if ( event.type === 'keydown' && 13 !== event.which ) // enter 244 return; 245 229 246 var value = $(this).data('customizeImageValue'); 230 247 231 248 if ( value ) { … … 364 381 if ( -1 === index || index < response.lastIndexOf('</html>') ) { 365 382 deferred.rejectWith( self, [ 'unsigned' ] ); 366 383 return; 367 384 e} 368 385 369 386 // Strip the signature from the request. 370 387 response = response.slice( 0, index ) + response.slice( index + signature.length ); … … 774 791 activated = state.create('activated'); 775 792 776 793 state.bind( 'change', function() { 777 var save = $(' #save'),794 var save = $('.save'), 778 795 back = $('.back'); 779 796 780 797 if ( ! activated() ) { … … 814 831 }()); 815 832 816 833 // Temporary accordion code. 817 $('.customize-section-title').click( function( event ) { 834 var accordianFrozen = false; 835 $('.customize-section-title').bind('click keydown', function( event ) { 836 837 if ( event.type === 'keydown' && 13 !== event.which ) // enter 838 return; 839 818 840 var clicked = $( this ).parents( '.customize-section' ); 819 841 820 if ( clicked.hasClass('cannot-expand') )842 if ( clicked.hasClass('cannot-expand') || accordianFrozen ) 821 843 return; 844 845 // Don't want to fire focus and click at same time 846 accordianFrozen = true; 847 setTimeout(function () { 848 accordianFrozen = false; 849 }, 400); 850 851 // Scroll up if on #customize-section-title_tagline 852 if ('customize-section-title_tagline' === clicked.attr('id')) 853 $('.wp-full-overlay-sidebar-content').scrollTop(0); 822 854 823 855 $( '.customize-section' ).not( clicked ).removeClass( 'open' ); 824 856 clicked.toggleClass( 'open' ); … … 826 858 }); 827 859 828 860 // Button bindings. 829 $(' #save').click( function( event ) {861 $('.save').click( function( event ) { 830 862 previewer.save(); 831 863 event.preventDefault(); 864 }).keydown( function( event ) { 865 if ( 9 === event.which ) // tab 866 return; 867 if ( 13 === event.which ) // enter 868 previewer.save(); 869 event.preventDefault(); 832 870 }); 871 872 $('.back').keydown( function( event ) { 873 if ( 9 === event.which ) // tab 874 return; 875 var thisHref = $(this).attr('href'); 876 if ( 13 === event.which ) // enter 877 window.location = thisHref; 878 event.preventDefault(); 879 }); 833 880 834 881 $('.collapse-sidebar').click( function( event ) { 835 882 overlay.toggleClass( 'collapsed' ).toggleClass( 'expanded' ); … … 948 995 }); 949 996 950 997 api.trigger( 'ready' ); 998 999 // Make sure left column gets focus 1000 var topFocus = $('#customize-info .customize-section-title'); 1001 topFocus.focus(); 1002 setTimeout(function () { 1003 topFocus.focus(); 1004 }, 200); 1005 951 1006 }); 952 1007 953 })( wp, jQuery ); 954 No newline at end of file 1008 })( wp, jQuery ); -
wp-admin/css/wp-admin.css
5464 5464 height: 100%; 5465 5465 } 5466 5466 5467 .wp-full-overlay-sidebar .wp-full-overlay-header,5468 5467 .wp-full-overlay-sidebar .wp-full-overlay-footer { 5469 5468 position: absolute; 5470 5469 left: 0; 5471 5470 right: 0; 5472 height: 45px;5471 height: 80px; 5473 5472 padding: 0 20px; 5474 5473 line-height: 45px; 5475 5474 z-index: 10; 5476 5475 margin: 0; 5477 5476 } 5478 5477 5479 .wp-full-overlay-sidebar .wp-full-overlay-header {5480 top: 0;5481 border-top: 0;5482 border-bottom: 1px solid #fff;5483 box-shadow: inset 0 -1px 0 0px #dfdfdf;5484 }5485 5486 5478 .wp-full-overlay-sidebar .wp-full-overlay-footer { 5487 5479 bottom: 0; 5488 5480 border-bottom: 0; … … 5492 5484 5493 5485 .wp-full-overlay-sidebar .wp-full-overlay-sidebar-content { 5494 5486 position: absolute; 5495 top: 45px;5496 bottom: 45px;5487 top: 0; 5488 bottom: 80px; 5497 5489 left: 0; 5498 5490 right: 0; 5499 5491 overflow: auto; -
wp-admin/css/customize-controls.css
67 67 68 68 .control-section:hover .customize-section-title, 69 69 .control-section .customize-section-title:hover, 70 .control-section.open .customize-section-title { 70 .control-section.open .customize-section-title, 71 .customize-section-title:focus { 71 72 color: #fff; 72 73 text-shadow: 0 -1px 0 #333; 73 74 background: #808080; … … 126 127 color: #999; 127 128 } 128 129 130 #customize-info .customize-section-title:focus .preview-notice { 131 color: #ccc; 132 text-shadow: 0 -1px 0 #333; 133 } 134 129 135 #customize-info .theme-name { 130 136 font-size: 20px; 131 137 font-weight: 200; … … 135 141 text-shadow: 0 1px 0 #fff; 136 142 } 137 143 144 #customize-info .customize-section-title:focus .theme-name { 145 color: #fff; 146 text-shadow: 0 -1px 0 #333; 147 } 148 138 149 #customize-info .theme-screenshot { 139 150 width: 258px; 140 151 border: 1px solid #ccc; … … 155 166 margin: 0; 156 167 } 157 168 169 #customize-footer-actions .button-primary, 158 170 #customize-header-actions .button-primary { 159 171 float: right; 160 172 margin-top: 10px; 161 173 } 162 174 175 #customize-footer-actions .spinner, 163 176 #customize-header-actions .spinner { 164 177 margin-top: 16px; 165 178 margin-right: 4px; 166 179 } 167 180 181 .saving #customize-footer-actions .spinner, 168 182 .saving #customize-header-actions .spinner { 169 183 display: block; 170 184 }