Make WordPress Core

Changeset 10592


Ignore:
Timestamp:
02/18/2009 10:32:42 PM (16 years ago)
Author:
ryan
Message:

More theme preview tidying. see #8652

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/theme-install.php

    r10590 r10592  
    314314            $action_links = array();
    315315            $action_links[] = '<a href="' . admin_url('theme-install.php?tab=theme-information&amp;theme=' . $theme->slug .
    316                                 '&amp;TB_iframe=true&amp;width=600&amp;height=800') . '" class="button thickbox onclick">' . __('Install') . '</a>';
    317             $action_links[] = '<a href="' . $preview_link . '" class="button thickbox onclick previewlink">' . __('Preview') . '</a>';
     316                                '&amp;TB_iframe=true&amp;width=600&amp;height=800') . '" class="button thickbox onclick" title="' . attribute_escape(sprintf(__('Install "%s"'), $name)) . '">' . __('Install') . '</a>';
     317            $action_links[] = '<a href="' . $preview_link . '" class="button thickbox thickbox-preview onclick previewlink" title="' . attribute_escape(sprintf(__('Preview "%s"'), $name)) . '">' . __('Preview') . '</a>';
    318318
    319319            $action_links = apply_filters('theme_install_action_links', $action_links, $theme);
     
    321321            echo "
    322322        <div class='theme-item available-theme'>
    323             <a class='thickbox screenshot' href='$preview_link'>
     323            <a class='thickbox thickbox-preview screenshot' href='$preview_link' title='" . attribute_escape(sprintf(__('Preview "%s"'), $name)) . "'>
    324324            <img src='{$theme->screenshot_url}' width='150' />
    325325            </a>
  • trunk/wp-admin/js/theme-preview.dev.js

    r10590 r10592  
    1414        };
    1515
    16         return $('a.thickbox').each( function() {
    17             var href = $(this).attr('href');
     16        return $('a.thickbox-preview').each( function() {
     17            var href = $(this).parents('.available-theme').find('.previewlink').attr('href');
    1818            if ( ! href ) return;
    1919            href = href.replace(/&width=[0-9]+/g, '');
  • trunk/wp-admin/js/theme-preview.js

    r10590 r10592  
    1 var thickDims;jQuery(document).ready(function(a){thickDims=function(){var d=a("#TB_window"),c=a(window).height(),b=a(window).width();if(d.size()){d.width(b-90).height(c-60);a("#TB_iframeContent").width(b-90).height(c-90);d.css({"margin-left":"-"+parseInt(((b-90)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){d.css({top:"30px","margin-top":"0"})}}return a("a.thickbox").each(function(){var e=a(this).attr("href");if(!e){return}e=e.replace(/&width=[0-9]+/g,"");e=e.replace(/&height=[0-9]+/g,"");a(this).attr("href",e+"&width="+(b-110)+"&height="+(c-100))})};thickDims().click(function(){var c=a(this).parents(".available-theme").find(".activatelink"),b=c.attr("href"),d=c.html();if(null==d){d=""}a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});a("#TB_closeAjaxWindow").css({"float":"left"});a("#TB_ajaxWindowTitle").css({"float":"right"}).append('&nbsp;<a href="'+b+'" target="_top" class="tb-theme-preview-link">'+d+"</a>");a("#TB_iframeContent").width("100%");return false});a(window).resize(function(){thickDims()})});function tb_position(){thickDims()};
     1var thickDims;jQuery(document).ready(function(a){thickDims=function(){var d=a("#TB_window"),c=a(window).height(),b=a(window).width();if(d.size()){d.width(b-90).height(c-60);a("#TB_iframeContent").width(b-90).height(c-90);d.css({"margin-left":"-"+parseInt(((b-90)/2),10)+"px"});if(typeof document.body.style.maxWidth!="undefined"){d.css({top:"30px","margin-top":"0"})}}return a("a.thickbox-preview").each(function(){var e=a(this).parents(".available-theme").find(".previewlink").attr("href");if(!e){return}e=e.replace(/&width=[0-9]+/g,"");e=e.replace(/&height=[0-9]+/g,"");a(this).attr("href",e+"&width="+(b-110)+"&height="+(c-100))})};thickDims().click(function(){var c=a(this).parents(".available-theme").find(".activatelink"),b=c.attr("href"),d=c.html();if(null==d){d=""}a("#TB_title").css({"background-color":"#222",color:"#cfcfcf"});a("#TB_closeAjaxWindow").css({"float":"left"});a("#TB_ajaxWindowTitle").css({"float":"right"}).append('&nbsp;<a href="'+b+'" target="_top" class="tb-theme-preview-link">'+d+"</a>");a("#TB_iframeContent").width("100%");return false});a(window).resize(function(){thickDims()})});function tb_position(){thickDims()};
  • trunk/wp-admin/themes.php

    r10591 r10592  
    175175    $preview_text = attribute_escape( sprintf( __('Preview of "%s"'), $title ) );
    176176    $tags = $themes[$theme_name]['Tags'];
    177     $thickbox_class = 'thickbox';
     177    $thickbox_class = 'thickbox thickbox-preview';
    178178    $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=".urlencode($template)."&amp;stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template);
    179179    $activate_text = attribute_escape( sprintf( __('Activate "%s"'), $title ) );
    180180?>
    181         <a href="<?php echo $preview_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
     181        <a href="<?php echo $activate_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
    182182<?php if ( $screenshot ) : ?>
    183183            <img src="<?php echo WP_CONTENT_URL . $stylesheet_dir . '/' . $screenshot; ?>" alt="" />
    184184<?php endif; ?>
    185185        </a>
    186         <h3><a class="<?php echo $thickbox_class; ?>" href="<?php echo $preview_link; ?>"><?php echo $title; ?></a></h3>
     186        <h3><a class="<?php echo $thickbox_class; ?>" href="<?php echo $activate_link; ?>"><?php echo $title; ?></a></h3>
    187187        <p><?php echo $description; ?></p>
    188188<?php if ( $tags ) : ?>
  • trunk/wp-includes/script-loader.php

    r10590 r10592  
    342342        ));
    343343
    344         $scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20090218' );
     344        $scripts->add( 'theme-preview', "/wp-admin/js/theme-preview$suffix.js", array( 'thickbox', 'jquery' ), '20090219' );
    345345        $scripts->add_data( 'theme-preview', 'group', 1 );
    346346
Note: See TracChangeset for help on using the changeset viewer.