Changeset 20352
- Timestamp:
- 04/04/2012 09:02:29 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-themes-list-table.php
r20104 r20352 132 132 home_url( '/' ) ) ); 133 133 134 $customize_attributes = 'title="' . esc_attr( sprintf( __( 'Customize “%s”' ), $title ) ) . '" 135 . data-customize-template="' . esc_attr( $template ) . '" data-customize-stylesheet="' . esc_attr( $stylesheet ) . '"'; 136 134 137 $actions = array(); 135 138 $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' 136 139 . esc_attr( sprintf( __( 'Activate “%s”' ), $title ) ) . '">' . __( 'Activate' ) . '</a>'; 137 $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' 138 . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '">' . __( 'Preview' ) . '</a>'; 140 $actions[] = '<a href="' . $preview_link . '" class="hide-if-js" title="' 141 . esc_attr( sprintf( __( 'Preview “%s”' ), $title ) ) . '">' . __( 'Preview' ) . '</a>' 142 . '<a href="#" class="load-customize hide-if-no-js" ' . $customize_attributes . '>' . __( 'Customize' ) . '</a>'; 139 143 if ( ! is_multisite() && current_user_can( 'delete_themes' ) ) 140 144 $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url( "themes.php?action=delete&template=$stylesheet", 'delete-theme_' . $stylesheet ) … … 146 150 $actions = implode ( ' | ', $actions ); 147 151 ?> 148 <a href="<?php echo $preview_link; ?>" class=" thickbox thickbox-preview screenshot">152 <a href="<?php echo $preview_link; ?>" class="load-customize screenshot" <?php echo $customize_attributes; ?>> 149 153 <?php if ( $screenshot = $theme->get_screenshot() ) : ?> 150 154 <img src="<?php echo esc_url( $screenshot ); ?>" alt="" /> -
trunk/wp-includes/js/customize-loader.dev.js
r20250 r20352 42 42 Loader.initialize(); 43 43 44 // Override 'preview' links on themes page. 45 $('.thickbox-preview').click( function( event ) { 46 var href, template, stylesheet; 44 $('#current-theme, #availablethemes').on( 'click', '.load-customize', function( event ) { 45 var load = $(this); 47 46 48 // Stop the thickbox.49 47 event.preventDefault(); 50 event.stopImmediatePropagation();51 52 // Extract the template/stylesheet from the preview link's url.53 href = $(this).attr('href');54 template = href.match('template=([^&]*)')[1];55 stylesheet = href.match('stylesheet=([^&]*)')[1];56 48 57 49 // Load the theme. 58 50 Loader.open({ 59 template: template,60 stylesheet: stylesheet51 template: load.data('customizeTemplate'), 52 stylesheet: load.data('customizeStylesheet') 61 53 }); 62 }).filter( function() { 63 return 'Preview' == $(this).text(); 64 }).text('Customize'); 54 }); 65 55 }); 66 56
Note: See TracChangeset
for help on using the changeset viewer.