Make WordPress Core

Ticket #5486: theme-preview3.diff

File theme-preview3.diff, 27.2 KB (added by azaozz, 18 years ago)
  • wp-admin/admin-header.php

     
    4949        do_action('admin_print_scripts-' . $page_hook);
    5050else if ( isset($plugin_page) )
    5151        do_action('admin_print_scripts-' . $plugin_page);
     52else if ( isset($pagenow) )
     53        do_action('admin_print_scripts-' . $pagenow);
    5254do_action('admin_print_scripts');
    5355
    5456if ( isset($page_hook) )
    5557        do_action('admin_head-' . $page_hook);
    5658else if ( isset($plugin_page) )
    5759        do_action('admin_head-' . $plugin_page);
     60else if ( isset($pagenow) )
     61        do_action('admin_head-' . $pagenow);
    5862do_action('admin_head');
    5963?>
    6064</head>
  • wp-admin/comment.php

     
    2121        $title = __('Edit Comment');
    2222
    2323        wp_enqueue_script('comment');
    24         //wp_enqueue_script('thickbox');
     24
    2525        require_once('admin-header.php');
    2626
    2727        $comment_id = absint( $_GET['c'] );
  • wp-admin/css/press-this.css

     
    112112*:first-child+html .ui-tabs-nav  { /* @ IE 7 Standards Mode - do not group selectors, otherwise IE 6 will ignore complete rule (because of the unknown + combinator)... */
    113113    display: inline-block;
    114114}
    115 
    116115/* end jquery tabs css */
    117 /* jquery thickbox css */
    118 /* ----------------------------------------------------------------------------------------------------------------*/
    119 /* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/
    120 /* ----------------------------------------------------------------------------------------------------------------*/
    121 *{padding: 0; margin: 0;}
    122116
    123 /* ----------------------------------------------------------------------------------------------------------------*/
    124 /* ---------->>> thickbox specific link and font settings <<<------------------------------------------------------*/
    125 /* ----------------------------------------------------------------------------------------------------------------*/
    126 #TB_window {
    127         font: 12px Arial, Helvetica, sans-serif;
    128         color: #333333;
    129 }
    130 
    131 #TB_secondLine {
    132         font: 10px Arial, Helvetica, sans-serif;
    133         color:#666666;
    134 }
    135 
    136 #TB_window a:link {color: #666666;}
    137 #TB_window a:visited {color: #666666;}
    138 #TB_window a:hover {color: #000;}
    139 #TB_window a:active {color: #666666;}
    140 #TB_window a:focus{color: #666666;}
    141 
    142 /* ----------------------------------------------------------------------------------------------------------------*/
    143 /* ---------->>> thickbox settings <<<-----------------------------------------------------------------------------*/
    144 /* ----------------------------------------------------------------------------------------------------------------*/
    145 #TB_overlay {
    146         position: fixed;
    147         z-index:100;
    148         top: 0px;
    149         left: 0px;
    150         background-color:#000;
    151         filter:alpha(opacity=75);
    152         -moz-opacity: 0.75;
    153         opacity: 0.75;
    154         height:100%;
    155         width:100%;
    156 }
    157 
    158 * html #TB_overlay { /* ie6 hack */
    159      position: absolute;
    160      height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
    161 }
    162 
    163 #TB_window {
    164         position: fixed;
    165         background: #ffffff;
    166         z-index: 102;
    167         color:#000000;
    168         display:none;
    169         border: 4px solid #525252;
    170         text-align:left;
    171         top:50%;
    172         left:50%;
    173 }
    174 
    175 * html #TB_window { /* ie6 hack */
    176 position: absolute;
    177 margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
    178 }
    179 
    180 #TB_window img#TB_Image {
    181         display:block;
    182         margin: 15px 0 0 15px;
    183         border-right: 1px solid #ccc;
    184         border-bottom: 1px solid #ccc;
    185         border-top: 1px solid #666;
    186         border-left: 1px solid #666;
    187 }
    188 
    189 #TB_caption{
    190         height:25px;
    191         padding:7px 30px 10px 25px;
    192         float:left;
    193 }
    194 
    195 #TB_closeWindow{
    196         height:25px;
    197         padding:11px 25px 10px 0;
    198         float:right;
    199 }
    200 
    201 #TB_closeAjaxWindow{
    202         padding:7px 10px 5px 0;
    203         margin-bottom:1px;
    204         text-align:right;
    205         float:right;
    206 }
    207 
    208 #TB_ajaxWindowTitle{
    209         float:left;
    210         padding:7px 0 5px 10px;
    211         margin-bottom:1px;
    212 }
    213 
    214 #TB_title{
    215         background-color:#e8e8e8;
    216         height:27px;
    217 }
    218 
    219 #TB_ajaxContent{
    220         clear:both;
    221         padding:2px 15px 15px 15px;
    222         overflow:auto;
    223         text-align:left;
    224         line-height:1.4em;
    225 }
    226 
    227 #TB_ajaxContent.TB_modal{
    228         padding:15px;
    229 }
    230 
    231 #TB_ajaxContent p{
    232         padding:5px 0px 5px 0px;
    233 }
    234 
    235 #TB_load{
    236         position: fixed;
    237         display:none;
    238         height:13px;
    239         width:208px;
    240         z-index:103;
    241         top: 50%;
    242         left: 50%;
    243         margin: -6px 0 0 -104px; /* -height/2 0 0 -width/2 */
    244 }
    245 
    246 * html #TB_load { /* ie6 hack */
    247 position: absolute;
    248 margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
    249 }
    250 
    251 #TB_HideSelect{
    252         z-index:99;
    253         position:fixed;
    254         top: 0;
    255         left: 0;
    256         background-color:#fff;
    257         border:none;
    258         filter:alpha(opacity=0);
    259         -moz-opacity: 0;
    260         opacity: 0;
    261         height:100%;
    262         width:100%;
    263 }
    264 
    265 * html #TB_HideSelect { /* ie6 hack */
    266      position: absolute;
    267      height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
    268 }
    269 
    270 #TB_iframeContent{
    271         clear:both;
    272         border:none;
    273         margin-bottom:-1px;
    274         margin-top:1px;
    275         _margin-bottom:1px;
    276 }
    277 /* end jquery thickbox css */
    278 
    279117/* quickpost css */
    280118div#container {
    281119        background-color: #fff;
  • wp-admin/gears-manifest.php

     
    3333?>
    3434{
    3535"betaManifestVersion" : 1,
    36 "version" : "<?php echo $version; ?>_20080511",
     36"version" : "<?php echo $version; ?>_20080520",
    3737"entries" : [
    3838<?php echo $default_js; ?>
    3939
    4040{ "url" : "wp-admin.css?version=2.6-bleeding" },
    4141{ "url" : "rtl.css?version=2.6-bleeding" },
    42 { "url" : "../wp-includes/js/thickbox/thickbox.css?ver=20080430" },
     42{ "url" : "../wp-includes/js/thickbox/thickbox.css?version=2.6-bleeding" },
    4343{ "url" : "css/colors-classic-rtl.css?version=2.6-bleeding" },
    4444{ "url" : "css/colors-classic.css?version=2.6-bleeding" },
    4545{ "url" : "css/colors-fresh-rtl.css?version=2.6-bleeding" },
     
    5656{ "url" : "css/login.css?version=2.6-bleeding" },
    5757{ "url" : "css/media-rtl.css?version=2.6-bleeding" },
    5858{ "url" : "css/media.css?version=2.6-bleeding" },
     59{ "url" : "css/press-this.css?version=2.6-bleeding" },
    5960{ "url" : "css/theme-editor-rtl.css?version=2.6-bleeding" },
    6061{ "url" : "css/theme-editor.css?version=2.6-bleeding" },
    6162{ "url" : "css/upload-rtl.css?version=2.6-bleeding" },
  • wp-admin/includes/media.php

     
    167167        $audio_title = __('Add Audio');
    168168        $out = <<<EOF
    169169
    170         <a href="{$image_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>
    171         <a href="{$video_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>
    172         <a href="{$audio_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a>
    173         <a href="{$media_upload_iframe_src}&amp;TB_iframe=true&amp;height=500&amp;width=640" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>
     170        <a href="{$image_upload_iframe_src}&amp;TB_iframe=true" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>
     171        <a href="{$video_upload_iframe_src}&amp;TB_iframe=true" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>
     172        <a href="{$audio_upload_iframe_src}&amp;TB_iframe=true" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a>
     173        <a href="{$media_upload_iframe_src}&amp;TB_iframe=true" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>
    174174
    175175EOF;
    176176        printf($context, $out);
    177177}
    178178add_action( 'media_buttons', 'media_buttons' );
    179179
    180 function media_buttons_head() {
    181 $siteurl = get_option('siteurl');
    182 echo "<style type='text/css' media='all'>
    183         @import '{$siteurl}/wp-includes/js/thickbox/thickbox.css?ver=20080430';
    184         div#TB_title {
    185                 background-color: #222222;
    186                 color: #cfcfcf;
    187         }
    188         div#TB_title a, div#TB_title a:visited {
    189                 color: #cfcfcf;
    190         }
    191         #TB_window {
    192                 top: 20px;
    193         }
    194 </style>\n";
    195 }
     180add_action( 'admin_print_scripts-post-new.php', 'add_thickbox' );
     181add_action( 'admin_print_scripts-post.php', 'add_thickbox' );
     182add_action( 'admin_print_scripts-page-new.php', 'add_thickbox' );
     183add_action( 'admin_print_scripts-page.php', 'add_thickbox' );
    196184
    197 add_action( 'admin_print_scripts', 'media_buttons_head' );
    198 
    199185function media_admin_css() {
    200186        wp_admin_css('css/media');
    201187}
  • wp-admin/js/media-upload.js

     
    2121                if ( tbWindow.size() ) {
    2222                        tbWindow.width( W - 50 ).height( H - 45 );
    2323                        $('#TB_iframeContent').width( W - 50 ).height( H - 75 );
    24                         tbWindow.css({marginLeft: '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
     24                        tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px','top':'20px','margin-top':'0'});
     25                        $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
     26                        if ( $.browser.msie && $.browser.version.substr(0,1) < 7 )
     27                                tbWindow.css({'margin-top':document.documentElement.scrollTop+'px'});
    2528                };
    2629
    2730                return $('a.thickbox').each( function() {
  • wp-admin/js/theme-preview.js

     
     1
     2jQuery(function($) {
     3        if ( 'undefined' == typeof $.fn.pngFix )
     4                $.fn.pngFix = function() { return this; }
     5
     6        var thickDims = function() {
     7                var tbWindow = $('#TB_window');
     8                var H = $(window).height();
     9                var W = $(window).width();
     10
     11                if ( tbWindow.size() ) {
     12                        tbWindow.width( W - 100 ).height( H - 60 );
     13                        $('#TB_iframeContent').width( W - 100 ).height( H - 90 );
     14                        tbWindow.css({'margin-left': '-' + parseInt((( W - 100 ) / 2),10) + 'px','top':'30px','margin-top':'0'});
     15                        if ( $.browser.msie && $.browser.version.substr(0,1) < 7 )
     16                                tbWindow.css({'margin-top':document.documentElement.scrollTop+'px'});
     17                };
     18
     19                return $('a.thickbox').each( function() {
     20                        var href = $(this).parents('.available-theme').find('.previewlink').attr('href');
     21                        if ( ! href ) return;
     22                        href = href.replace(/&width=[0-9]+/g, '');
     23                        href = href.replace(/&height=[0-9]+/g, '');
     24                        $(this).attr( 'href', href + '&width=' + ( W - 100 ) + '&height=' + ( H - 100 ) );
     25                });
     26        };
     27
     28        thickDims()
     29        .click( function() {
     30                var alink = $(this).parents('.available-theme').find('.activatelink');
     31                var url = alink.attr('href');
     32                var text = alink.html();
     33
     34                $('#TB_title').css({'background-color':'#222','color':'#cfcfcf'});
     35                $('#TB_closeAjaxWindow').css({'float':'left'});
     36                $('#TB_ajaxWindowTitle').css({'float':'right'})
     37                        .append('&nbsp;<a href="' + url + '" target="_top" class="tb-theme-preview-link">' + text + '</a>');
     38
     39                $('#TB_iframeContent').width('100%');
     40                return false;
     41        } );
     42
     43        $(window).resize( function() { thickDims() } );
     44});
  • wp-admin/link-add.php

     
    1313
    1414wp_enqueue_script('link');
    1515wp_enqueue_script('xfn');
    16 wp_enqueue_script('thickbox');
    1716
    1817require('admin-header.php');
    1918?>
  • wp-admin/link.php

     
    8585        case 'edit' :
    8686                wp_enqueue_script('link');
    8787                wp_enqueue_script('xfn');
    88                 wp_enqueue_script('thickbox');
    8988
    9089                $parent_file = 'edit.php';
    9190                $submenu_file = 'link-manager.php';
  • wp-admin/page-new.php

     
    77wp_enqueue_script('page');
    88if ( user_can_richedit() )
    99        wp_enqueue_script('editor');
    10 wp_enqueue_script('thickbox');
    1110wp_enqueue_script('media-upload');
    1211wp_enqueue_script('word-count');
    1312
  • wp-admin/page.php

     
    8181        wp_enqueue_script('page');
    8282        if ( user_can_richedit() )
    8383                wp_enqueue_script('editor');
    84         wp_enqueue_script('thickbox');
    8584        wp_enqueue_script('media-upload');
    8685        wp_enqueue_script('word-count');
    8786
  • wp-admin/post-new.php

     
    77wp_enqueue_script('post');
    88if ( user_can_richedit() )
    99        wp_enqueue_script('editor');
    10 wp_enqueue_script('thickbox');
    1110wp_enqueue_script('media-upload');
    1211wp_enqueue_script('word-count');
    1312
  • wp-admin/post.php

     
    8888        wp_enqueue_script('post');
    8989        if ( user_can_richedit() )
    9090                wp_enqueue_script('editor');
    91         wp_enqueue_script('thickbox');
    9291        wp_enqueue_script('media-upload');
    9392        wp_enqueue_script('word-count');
    9493
  • wp-admin/press-this.php

     
    184184
    185185<?php
    186186        wp_enqueue_script('jquery-ui-tabs');
    187         wp_enqueue_script('thickbox');
     187        add_thickbox();
    188188        wp_enqueue_script('post');
    189189        do_action('admin_print_scripts'); do_action('admin_head');
    190190        wp_admin_css('css/press-this');
  • wp-admin/themes.php

     
    1313
    1414$title = __('Manage Themes');
    1515$parent_file = 'themes.php';
     16
     17add_thickbox();
     18wp_enqueue_script( 'theme-preview' );
     19
    1620require_once('admin-header.php');
    1721?>
    1822
     
    2933
    3034<div class="wrap">
    3135<h2><?php _e('Current Theme'); ?></h2>
    32 <div id="currenttheme">
     36<div id="current-theme">
    3337<?php if ( $ct->screenshot ) : ?>
    3438<img src="<?php echo get_option('siteurl') . '/' . $ct->stylesheet_dir . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" />
    3539<?php endif; ?>
    3640<h3><?php printf(_c('%1$s %2$s by %3$s|1: theme title, 2: theme version, 3: theme author'), $ct->title, $ct->version, $ct->author) ; ?></h3>
    37 <p><?php echo $ct->description; ?></p>
     41<p class="description"><?php echo $ct->description; ?></p>
    3842<?php if ($ct->parent_theme) { ?>
    3943        <p><?php printf(__('The template files are located in <code>%2$s</code>.  The stylesheet files are located in <code>%3$s</code>.  <strong>%4$s</strong> uses templates from <strong>%5$s</strong>.  Changes made to the templates will affect both themes.'), $ct->title, $ct->template_dir, $ct->stylesheet_dir, $ct->title, $ct->parent_theme); ?></p>
    4044<?php } else { ?>
     
    4751
    4852<h2><?php _e('Available Themes'); ?></h2>
    4953<?php if ( 1 < count($themes) ) { ?>
    50 
     54<table id="availablethemes" cellspacing="0" cellpadding="0">
    5155<?php
    5256$style = '';
    5357
    5458$theme_names = array_keys($themes);
    5559natcasesort($theme_names);
    5660
    57 foreach ($theme_names as $theme_name) {
    58         if ( $theme_name == $ct->name )
    59                 continue;
     61$rows = ceil(count($theme_names) / 3);
     62for ( $row = 1; $row <= $rows; $row++ )
     63        for ( $col = 1; $col <= 3; $col++ )
     64                $table[$row][$col] = array_shift($theme_names);
     65
     66foreach ( $table as $row => $cols ) {
     67?>
     68<tr>
     69<?php
     70foreach ( $cols as $col => $theme_name ) {
     71        $class = array('available-theme');
     72        if ( $row == 1 ) $class[] = 'top';
     73        if ( $col == 1 ) $class[] = 'left';
     74        if ( $row == $rows ) $class[] = 'bottom';
     75        if ( $col == 3 ) $class[] = 'right';
     76?>
     77        <td class="<?php echo join(' ', $class); ?>">
     78<?php if ( !empty($theme_name) ) :
    6079        $template = $themes[$theme_name]['Template'];
    6180        $stylesheet = $themes[$theme_name]['Stylesheet'];
    6281        $title = $themes[$theme_name]['Title'];
     
    6584        $author = $themes[$theme_name]['Author'];
    6685        $screenshot = $themes[$theme_name]['Screenshot'];
    6786        $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
     87        $preview_link = clean_url( get_option('home') . '/');
     88        $preview_link = add_query_arg( array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'TB_iframe' => 'true', 'width' => 600, 'height' => 400 ), $preview_link );
     89        $preview_text = attribute_escape( sprintf( __('Preview of "%s"'), $title ) );
    6890        $tags = $themes[$theme_name]['Tags'];
     91        $thickbox_class = 'thickbox';
    6992        $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=".urlencode($template)."&amp;stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template);
     93        $activate_text = attribute_escape( sprintf( __('Activate "%s"'), $title ) );
    7094?>
    71 <div class="available-theme">
    72 <h3><a href="<?php echo $activate_link; ?>"><?php echo $title; ?></a></h3>
    73 
    74 <a href="<?php echo $activate_link; ?>" class="screenshot">
     95                <a href="<?php echo $activate_link; ?>" class="<?php echo $thickbox_class; ?> screenshot">
    7596<?php if ( $screenshot ) : ?>
    76 <img src="<?php echo get_option('siteurl') . '/' . $stylesheet_dir . '/' . $screenshot; ?>" alt="" />
     97                        <img src="<?php echo ( $tpage == 'stage' ) ? $screenshot : get_option('siteurl') . '/' . $stylesheet_dir . '/' . $screenshot; ?>" alt="" />
    7798<?php endif; ?>
    78 </a>
    79 
    80 <p><?php echo $description; ?></p>
     99                </a>
     100                <h3><a class="<?php echo $thickbox_class; ?>" href="<?php echo $activate_link; ?>"><?php echo $title; ?></a></h3>
     101                <p><?php echo $description; ?></p>
    81102<?php if ( $tags ) : ?>
    82 <p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p>
     103                <p><?php _e('Tags:'); ?> <?php echo join(', ', $tags); ?></p>
     104                <noscript><p class="themeactions"><a href="<?php echo $preview_link; ?>" title="<?php echo $preview_text; ?>"><?php _e('Preview'); ?></a> <a href="<?php echo $activate_link; ?>" title="<?php echo $activate_text; ?>"><?php _e('Activate'); ?></a></p></noscript>
    83105<?php endif; ?>
    84 </div>
    85 <?php } // end foreach theme_names ?>
    86 
     106                <div style="display:none;"><a class="previewlink" href="<?php echo $preview_link; ?>"><?php echo $preview_text; ?></a> <a class="activatelink" href="<?php echo $activate_link; ?>"><?php echo $activate_text; ?></a></div>
     107<?php endif; // end if not empty theme_name ?>
     108        </td>
     109<?php } // end foreach $cols ?>
     110</tr>
     111<?php } // end foreach $table ?>
     112</table>
    87113<?php } ?>
    88114
    89115<?php
  • wp-admin/wp-admin.css

     
    5252        margin: 10px 20px 10px 20px;
    5353}
    5454
    55 .available-theme {
    56         width: 30%;
    57         margin: 0 1em;
    58         float: left;
    59         text-align: center;
    60         height: 28em;
    61         overflow: hidden;
     55table#availablethemes {
     56        border-spacing: 0px;
     57        border: none;
     58        border-top: 1px solid #ccc;
     59        border-bottom: 1px solid #ccc;
     60        margin: 10px auto;
    6261}
     62td.available-theme {
     63        vertical-align: top;
     64        width: 240px;
     65        margin: 0;
     66        padding: 20px;
     67        text-align: left;
     68}
     69table#availablethemes td {
     70        border: 1px solid #eee;
     71        border-top: none;
     72}
     73table#availablethemes td.top {
     74        border-top: none;
     75}
     76table#availablethemes td.right {
     77        border-right: none;
     78        border-left: none;
     79}
     80table#availablethemes td.bottom {
     81        border-bottom: none;
     82}
     83table#availablethemes td.left {
     84        border-right: none;
     85        border-left: none;
     86}
    6387
    6488.available-theme a.screenshot {
    65         width: 250px;
    66         height: 200px;
     89        width: 240px;
     90        height: 180px;
    6791        display: block;
    68         margin: auto;
     92        border: 1px solid #efefef;
    6993        margin-bottom: 10px;
    7094        overflow: hidden;
    71         border-width: 1px;
    72         border-style: solid;
    7395}
    74 
    7596.available-theme img {
    76         width: 100%;
     97        width: 240px;
    7798}
     99.available-theme h3 {
     100        margin: 15px 0 5px;
     101}
    78102
     103#current-theme {
     104        margin-top: 1em;
     105}
     106
     107#current-theme a {
     108        border-bottom: none;
     109}
     110
     111#current-theme h3 {
     112        font-size: 17px;
     113        font-weight: normal;
     114        margin: 0;
     115}
     116
     117#current-theme .description {
     118        margin-top: 5px;
     119}
     120
     121#current-theme img {
     122        float: left;
     123        border: 1px solid #666;
     124        margin-right: 1em;
     125        margin-bottom: 1.5em;
     126        width: 150px;
     127}
     128
     129#TB_window #TB_title a.tb-theme-preview-link,
     130#TB_window #TB_title a.tb-theme-preview-link:visited {
     131        font-weight: bold;
     132        color: #999;
     133        text-decoration: none;
     134}
     135
     136#TB_window #TB_title a.tb-theme-preview-link:hover,
     137#TB_window #TB_title a.tb-theme-preview-link:focus {
     138        color: #ccc;
     139}
     140
    79141.checkbox {
    80142        border: none;
    81143        margin: 0;
     
    249311        border-collapse: separate;
    250312}
    251313
    252 #currenttheme img {
    253         float: left;
    254         margin-right: 1em;
    255         margin-bottom: 1.5em;
    256         width: 300px;
    257         border-width: 1px;
    258         border-style: solid;
    259 }
    260 
    261314#quicktags {
    262315        padding: 0;
    263316        border: 0 none;
  • wp-includes/general-template.php

     
    11351135                        $color = $_wp_admin_css_colors[$color];
    11361136                        $_file = $color->url;
    11371137                        $_file = ('css/colors-rtl' == $file) ? str_replace('.css','-rtl.css',$_file) : $_file;
     1138                } elseif ( 'css/thickbox' == $file ) {
     1139                        $_file = get_option( 'siteurl' ) . "/wp-includes/js/thickbox/thickbox.css";
    11381140                } else {
    11391141                        $_file = get_option( 'siteurl' ) . "/wp-admin/$file.css";
    11401142                }
     
    11531155        }
    11541156}
    11551157
     1158function add_thickbox() {
     1159        wp_enqueue_script( 'thickbox' );
     1160        add_action( 'admin_print_scripts', 'add_thickbox_css' );
     1161}
     1162
     1163function add_thickbox_css() {
     1164        wp_admin_css( 'css/thickbox' );
     1165}
     1166
    11561167/**
    11571168 * Outputs the XHTML generator that is generated on the wp_head hook.
    11581169 */
  • wp-includes/js/thickbox/thickbox.css

     
    4545
    4646#TB_window {
    4747        position: fixed;
     48        background: #ffffff;
    4849        z-index: 102;
    4950        color:#000000;
    5051        display:none;
     52        border: 4px solid #525252;
    5153        text-align:left;
    52         top:20px;
     54        top:50%;
    5355        left:50%;
    5456}
    5557
    5658* html #TB_window { /* ie6 hack */
    5759position: absolute;
    58 margin-top: expression(20) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
     60margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');
    5961}
    6062
    6163#TB_window img#TB_Image {
     
    8082}
    8183
    8284#TB_closeAjaxWindow{
    83         padding:7px 10px 5px 0;
    84         margin-bottom:1px;
     85        padding:6px 10px 0;
    8586        text-align:right;
    8687        float:right;
    8788}
    8889
    8990#TB_ajaxWindowTitle{
    9091        float:left;
    91         padding:7px 0 5px 10px;
    92         margin-bottom:1px;
     92        padding:6px 10px 0;
    9393}
    9494
    9595#TB_title{
    9696        background-color:#e8e8e8;
    9797        height:27px;
    98         border-width: 4px;
    99         border-color: #525252;
    100         border-style: solid solid none;
    10198}
    10299
    103100#TB_ajaxContent{
     
    155152        clear:both;
    156153        border:none;
    157154        margin-bottom:-1px;
    158         margin-top:1px;
    159155        _margin-bottom:1px;
    160156}
  • wp-includes/script-loader.php

     
    205205                                'updateCompleted' => __('Update completed.'),
    206206                                'error' => __('Error:')
    207207                        ));
     208                       
     209                        $this->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'dimensions' ), '20080515' );
    208210                }
    209211        }
    210212
  • wp-includes/theme.php

     
    479479        echo '<link rel="stylesheet" href="' . $stylesheet . '" type="text/css" media="screen" />';
    480480}
    481481
     482function preview_theme() {
     483        if ( ! (isset($_GET['template']) && isset($_GET['preview'])) )
     484                return;
     485
     486        if ( !current_user_can( 'switch_themes' ) )
     487                return;
     488
     489        add_filter('template', create_function('', "return '$_GET[template]';") );
     490
     491        if ( isset($_GET['stylesheet']) )
     492                add_filter('stylesheet', create_function('', "return '$_GET[stylesheet]';") );
     493
     494        ob_start( 'preview_theme_ob_filter' );
     495}
     496add_action('setup_theme', 'preview_theme');
     497
     498function preview_theme_ob_filter( $content ) {
     499        return preg_replace_callback( "|(<a.*?href=([\"']))(.*?)([\"'].*?>)|", 'preview_theme_ob_filter_callback', $content );
     500}
     501
     502function preview_theme_ob_filter_callback( $matches ) {
     503        if (
     504                ( false !== strpos($matches[3], '/wp-admin/') )
     505        ||
     506                ( false !== strpos($matches[3], '://') && 0 !== strpos($matches[3], get_option('home')) )
     507        ||
     508                ( false !== strpos($matches[3], '/feed/') )
     509        ||
     510                ( false !== strpos($matches[3], '/trackback/') )
     511        )
     512                return $matches[1] . "#$matches[2] onclick=$matches[2]return false;" . $matches[4];
     513
     514        $link = add_query_arg( array('preview' => 1, 'template' => $_GET['template'], 'stylesheet' => @$_GET['stylesheet'] ), $matches[3] );
     515        if ( 0 === strpos($link, 'preview=1') )
     516                $link = "?$link";
     517        return $matches[1] . attribute_escape( $link ) . $matches[4];
     518}
     519
    482520function switch_theme($template, $stylesheet) {
    483521        update_option('template', $template);
    484522        update_option('stylesheet', $stylesheet);
  • wp-settings.php

     
    425425 */
    426426$wp           =& new WP();
    427427
     428$wp->init();  // Sets up current user.
    428429
    429 /**
    430  * Web Path to the current active template directory
    431  * @since 1.5
    432  */
    433 define('TEMPLATEPATH', get_template_directory());
    434 
    435 /**
    436  * Web Path to the current active template stylesheet directory
    437  * @since 2.1
    438  */
    439 define('STYLESHEETPATH', get_stylesheet_directory());
    440 
    441430// Load the default text localization domain.
    442431load_default_textdomain();
    443432
     
    460449 */
    461450$wp_locale =& new WP_Locale();
    462451
     452do_action('setup_theme');
     453
     454/**
     455 * Web Path to the current active template directory
     456 * @since 1.5
     457 */
     458define('TEMPLATEPATH', get_template_directory());
     459
     460/**
     461 * Web Path to the current active template stylesheet directory
     462 * @since 2.1
     463 */
     464define('STYLESHEETPATH', get_stylesheet_directory());
     465
    463466// Load functions for active theme.
    464467if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/functions.php') )
    465468        include(STYLESHEETPATH . '/functions.php');
     
    478481}
    479482register_shutdown_function('shutdown_action_hook');
    480483
    481 $wp->init();  // Sets up current user.
    482 
    483484// Everything is loaded and initialized.
    484485do_action('init');
    485486