Changeset 31994
- Timestamp:
- 04/03/2015 02:31:11 AM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/themes.css
r31952 r31994 1139 1139 font-style: normal; 1140 1140 margin: 0; 1141 padding: 100px 00;1141 padding: 0; 1142 1142 text-align: center; 1143 1143 display: none; -
trunk/src/wp-admin/js/theme.js
r31690 r31994 80 80 // Render and append 81 81 this.view.render(); 82 this.$el.find( '.themes' ).remove(); 83 this.$el.append( this.view.el ).addClass( 'rendered' ); 82 this.$el.empty().append( this.view.el ).addClass( 'rendered' ); 84 83 this.$el.append( '<br class="clear"/>' ); 85 84 }, … … 158 157 if ( this.terms === '' ) { 159 158 this.reset( themes.data.themes ); 159 $( 'body' ).removeClass( 'no-results' ); 160 160 } 161 161 … … 832 832 count: $( '.wp-core-ui .theme-count' ), 833 833 834 // The live themes count 835 liveThemeCount: 0, 836 834 837 initialize: function( options ) { 835 838 var self = this; … … 855 858 if ( _.isNumber( count ) ) { 856 859 self.count.text( count ); 860 self.announceSearchResults( count ); 857 861 } else { 858 862 self.count.text( self.collection.length ); 863 self.announceSearchResults( self.collection.length ); 859 864 } 860 865 }); … … 927 932 928 933 // Display a live theme count for the collection 929 this.count.text( this.collection.count ? this.collection.count : this.collection.length ); 934 this.liveThemeCount = this.collection.count ? this.collection.count : this.collection.length; 935 this.count.text( this.liveThemeCount ); 936 937 this.announceSearchResults( this.liveThemeCount ); 930 938 }, 931 939 … … 1079 1087 1080 1088 } 1089 }, 1090 1091 // Dispatch audible search results feedback message 1092 announceSearchResults: function( count ) { 1093 if ( 0 === count ) { 1094 wp.a11y.speak( l10n.noThemesFound ); 1095 } else { 1096 wp.a11y.speak( l10n.themesFound.replace( '%d', count ) ); 1097 } 1081 1098 } 1082 1099 }); … … 1092 1109 attributes: { 1093 1110 placeholder: l10n.searchPlaceholder, 1094 type: 'search' 1111 type: 'search', 1112 'aria-describedby': 'live-search-desc' 1095 1113 }, 1096 1114 1097 1115 events: { 1098 'input': 'search', 1099 'keyup': 'search', 1100 'change': 'search', 1101 'search': 'search', 1102 'blur': 'pushState' 1116 'input': 'search', 1117 'keyup': 'search', 1118 'blur': 'pushState' 1103 1119 }, 1104 1120 … … 1113 1129 }, 1114 1130 1115 // Runs a search on the theme collection.1116 1131 search: function( event ) { 1117 var options = {};1118 1119 1132 // Clear on escape. 1120 1133 if ( event.type === 'keyup' && event.which === 27 ) { … … 1122 1135 } 1123 1136 1124 // Lose input focus when pressing enter 1125 if ( event.which === 13 ) { 1126 this.$el.trigger( 'blur' ); 1127 } 1137 /** 1138 * Since doSearch is debounced, it will only run when user input comes to a rest 1139 */ 1140 this.doSearch( event ); 1141 }, 1142 1143 // Runs a search on the theme collection. 1144 doSearch: _.debounce( function( event ) { 1145 var options = {}; 1128 1146 1129 1147 this.collection.doSearch( event.target.value ); … … 1142 1160 themes.router.navigate( themes.router.baseUrl( '' ) ); 1143 1161 } 1144 }, 1162 }, 500 ), 1145 1163 1146 1164 pushState: function( event ) { … … 1253 1271 1254 1272 events: { 1273 'input': 'search', 1255 1274 'keyup': 'search' 1256 1275 }, … … 1306 1325 // Set route 1307 1326 themes.router.navigate( themes.router.baseUrl( themes.router.searchPath + value ), { replace: true } ); 1308 }, 300 )1327 }, 500 ) 1309 1328 }); 1310 1329 -
trunk/src/wp-admin/theme-install.php
r31704 r31994 45 45 'l10n' => array( 46 46 'addNew' => __( 'Add New Theme' ), 47 'search' 47 'search' => __( 'Search Themes' ), 48 48 'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis) 49 49 'upload' => __( 'Upload Theme' ), 50 50 'back' => __( 'Back' ), 51 'error' => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ) 51 'error' => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), 52 'themesFound' => __( 'Number of Themes found: %d' ), 53 'noThemesFound' => __( 'No themes found. Try a different search.' ), 52 54 ), 53 55 'installedThemes' => array_keys( $installed_themes ), … … 71 73 $help_overview = 72 74 '<p>' . sprintf(__('You can find additional themes for your site by using the Theme Browser/Installer on this screen, which will display themes from the <a href="%s" target="_blank">WordPress.org Theme Directory</a>. These themes are designed and developed by third parties, are available free of charge, and are compatible with the license WordPress uses.'), 'https://wordpress.org/themes/') . '</p>' . 73 '<p>' . __('You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter. Alternately, you can browse the themes that are Featured, Popular, or Latest. When you find a theme you like, you can preview it or install it.') . '</p>' . 75 '<p>' . __( 'You can Search for themes by keyword, author, or tag, or can get more specific and search by criteria listed in the feature filter.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>' . 76 '<p>' . __( 'Alternately, you can browse the themes that are Featured, Popular, or Latest. When you find a theme you like, you can preview it or install it.' ) . '</p>' . 74 77 '<p>' . __('You can Upload a theme manually if you have already downloaded its ZIP archive onto your computer (make sure it is from a trusted and original source). You can also do it the old-fashioned way and copy a downloaded theme’s folder via FTP into your <code>/wp-content/themes</code> directory.') . '</p>'; 75 78 … … 167 170 </div> 168 171 </div> 169 <div class="theme-browser content-filterable" aria-live="polite"> 170 <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> 171 </div> 172 <div class="theme-browser content-filterable"></div> 172 173 <div class="theme-install-overlay wp-full-overlay expanded"></div> 174 175 <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> 173 176 <span class="spinner"></span> 174 177 -
trunk/src/wp-admin/themes.php
r31973 r31994 48 48 '<li>' . __( 'Click on the theme to see the theme name, version, author, description, tags, and the Delete link' ) . '</li>' . 49 49 '<li>' . __( 'Click Customize for the current theme or Live Preview for any other theme to see a live preview' ) . '</li></ul>' . 50 '<p>' . __( 'The current theme is displayed highlighted as the first theme.' ) . '</p>'; 50 '<p>' . __( 'The current theme is displayed highlighted as the first theme.' ) . '</p>' . 51 '<p>' . __( 'The search for installed themes will search for terms in their name, description, author, or tag.' ) . ' <span id="live-search-desc">' . __( 'The search results will be updated as you type.' ) . '</span></p>'; 51 52 52 53 get_current_screen()->add_help_tab( array( … … 108 109 ), 109 110 'l10n' => array( 110 'addNew' => __( 'Add New Theme' ),111 'search' => __( 'Search Installed Themes' ),111 'addNew' => __( 'Add New Theme' ), 112 'search' => __( 'Search Installed Themes' ), 112 113 'searchPlaceholder' => __( 'Search installed themes...' ), // placeholder (no ellipsis) 114 'themesFound' => __( 'Number of Themes found: %d' ), 115 'noThemesFound' => __( 'No themes found. Try a different search.' ), 113 116 ), 114 117 ) ); … … 199 202 ?> 200 203 201 <div class="theme-browser" aria-live="polite">204 <div class="theme-browser"> 202 205 <div class="themes"> 203 206 … … 256 259 <br class="clear" /> 257 260 </div> 258 <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>259 261 </div> 260 262 <div class="theme-overlay"></div> 263 264 <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p> 261 265 262 266 <?php -
trunk/src/wp-admin/update.php
r30649 r31994 202 202 wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) ); 203 203 204 include_once( ABSPATH . 'wp-admin/includes/ theme-install.php' ); //for themes_api..204 include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' ); //for themes_api.. 205 205 206 206 check_admin_referer( 'install-theme_' . $theme ); -
trunk/src/wp-includes/script-loader.php
r31992 r31994 501 501 $scripts->add( 'admin-widgets', "/wp-admin/js/widgets$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), false, 1 ); 502 502 503 $scripts->add( 'theme', "/wp-admin/js/theme$suffix.js", array( 'wp-backbone' ), false, 1 );503 $scripts->add( 'theme', "/wp-admin/js/theme$suffix.js", array( 'wp-backbone', 'wp-a11y' ), false, 1 ); 504 504 505 505 $scripts->add( 'inline-edit-post', "/wp-admin/js/inline-edit-post$suffix.js", array( 'jquery', 'suggest' ), false, 1 );
Note: See TracChangeset
for help on using the changeset viewer.