Ticket #5486: theme-preview3.diff
| File theme-preview3.diff, 27.2 KB (added by , 18 years ago) |
|---|
-
wp-admin/admin-header.php
49 49 do_action('admin_print_scripts-' . $page_hook); 50 50 else if ( isset($plugin_page) ) 51 51 do_action('admin_print_scripts-' . $plugin_page); 52 else if ( isset($pagenow) ) 53 do_action('admin_print_scripts-' . $pagenow); 52 54 do_action('admin_print_scripts'); 53 55 54 56 if ( isset($page_hook) ) 55 57 do_action('admin_head-' . $page_hook); 56 58 else if ( isset($plugin_page) ) 57 59 do_action('admin_head-' . $plugin_page); 60 else if ( isset($pagenow) ) 61 do_action('admin_head-' . $pagenow); 58 62 do_action('admin_head'); 59 63 ?> 60 64 </head> -
wp-admin/comment.php
21 21 $title = __('Edit Comment'); 22 22 23 23 wp_enqueue_script('comment'); 24 //wp_enqueue_script('thickbox'); 24 25 25 require_once('admin-header.php'); 26 26 27 27 $comment_id = absint( $_GET['c'] ); -
wp-admin/css/press-this.css
112 112 *: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)... */ 113 113 display: inline-block; 114 114 } 115 116 115 /* end jquery tabs css */ 117 /* jquery thickbox css */118 /* ----------------------------------------------------------------------------------------------------------------*/119 /* ---------->>> global settings needed for thickbox <<<-----------------------------------------------------------*/120 /* ----------------------------------------------------------------------------------------------------------------*/121 *{padding: 0; margin: 0;}122 116 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 279 117 /* quickpost css */ 280 118 div#container { 281 119 background-color: #fff; -
wp-admin/gears-manifest.php
33 33 ?> 34 34 { 35 35 "betaManifestVersion" : 1, 36 "version" : "<?php echo $version; ?>_200805 11",36 "version" : "<?php echo $version; ?>_20080520", 37 37 "entries" : [ 38 38 <?php echo $default_js; ?> 39 39 40 40 { "url" : "wp-admin.css?version=2.6-bleeding" }, 41 41 { "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" }, 43 43 { "url" : "css/colors-classic-rtl.css?version=2.6-bleeding" }, 44 44 { "url" : "css/colors-classic.css?version=2.6-bleeding" }, 45 45 { "url" : "css/colors-fresh-rtl.css?version=2.6-bleeding" }, … … 56 56 { "url" : "css/login.css?version=2.6-bleeding" }, 57 57 { "url" : "css/media-rtl.css?version=2.6-bleeding" }, 58 58 { "url" : "css/media.css?version=2.6-bleeding" }, 59 { "url" : "css/press-this.css?version=2.6-bleeding" }, 59 60 { "url" : "css/theme-editor-rtl.css?version=2.6-bleeding" }, 60 61 { "url" : "css/theme-editor.css?version=2.6-bleeding" }, 61 62 { "url" : "css/upload-rtl.css?version=2.6-bleeding" }, -
wp-admin/includes/media.php
167 167 $audio_title = __('Add Audio'); 168 168 $out = <<<EOF 169 169 170 <a href="{$image_upload_iframe_src}&TB_iframe=true &height=500&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}&TB_iframe=true &height=500&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}&TB_iframe=true &height=500&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}&TB_iframe=true &height=500&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}&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}&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}&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}&TB_iframe=true" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a> 174 174 175 175 EOF; 176 176 printf($context, $out); 177 177 } 178 178 add_action( 'media_buttons', 'media_buttons' ); 179 179 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 } 180 add_action( 'admin_print_scripts-post-new.php', 'add_thickbox' ); 181 add_action( 'admin_print_scripts-post.php', 'add_thickbox' ); 182 add_action( 'admin_print_scripts-page-new.php', 'add_thickbox' ); 183 add_action( 'admin_print_scripts-page.php', 'add_thickbox' ); 196 184 197 add_action( 'admin_print_scripts', 'media_buttons_head' );198 199 185 function media_admin_css() { 200 186 wp_admin_css('css/media'); 201 187 } -
wp-admin/js/media-upload.js
21 21 if ( tbWindow.size() ) { 22 22 tbWindow.width( W - 50 ).height( H - 45 ); 23 23 $('#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'}); 25 28 }; 26 29 27 30 return $('a.thickbox').each( function() { -
wp-admin/js/theme-preview.js
1 2 jQuery(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(' <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
13 13 14 14 wp_enqueue_script('link'); 15 15 wp_enqueue_script('xfn'); 16 wp_enqueue_script('thickbox');17 16 18 17 require('admin-header.php'); 19 18 ?> -
wp-admin/link.php
85 85 case 'edit' : 86 86 wp_enqueue_script('link'); 87 87 wp_enqueue_script('xfn'); 88 wp_enqueue_script('thickbox');89 88 90 89 $parent_file = 'edit.php'; 91 90 $submenu_file = 'link-manager.php'; -
wp-admin/page-new.php
7 7 wp_enqueue_script('page'); 8 8 if ( user_can_richedit() ) 9 9 wp_enqueue_script('editor'); 10 wp_enqueue_script('thickbox');11 10 wp_enqueue_script('media-upload'); 12 11 wp_enqueue_script('word-count'); 13 12 -
wp-admin/page.php
81 81 wp_enqueue_script('page'); 82 82 if ( user_can_richedit() ) 83 83 wp_enqueue_script('editor'); 84 wp_enqueue_script('thickbox');85 84 wp_enqueue_script('media-upload'); 86 85 wp_enqueue_script('word-count'); 87 86 -
wp-admin/post-new.php
7 7 wp_enqueue_script('post'); 8 8 if ( user_can_richedit() ) 9 9 wp_enqueue_script('editor'); 10 wp_enqueue_script('thickbox');11 10 wp_enqueue_script('media-upload'); 12 11 wp_enqueue_script('word-count'); 13 12 -
wp-admin/post.php
88 88 wp_enqueue_script('post'); 89 89 if ( user_can_richedit() ) 90 90 wp_enqueue_script('editor'); 91 wp_enqueue_script('thickbox');92 91 wp_enqueue_script('media-upload'); 93 92 wp_enqueue_script('word-count'); 94 93 -
wp-admin/press-this.php
184 184 185 185 <?php 186 186 wp_enqueue_script('jquery-ui-tabs'); 187 wp_enqueue_script('thickbox');187 add_thickbox(); 188 188 wp_enqueue_script('post'); 189 189 do_action('admin_print_scripts'); do_action('admin_head'); 190 190 wp_admin_css('css/press-this'); -
wp-admin/themes.php
13 13 14 14 $title = __('Manage Themes'); 15 15 $parent_file = 'themes.php'; 16 17 add_thickbox(); 18 wp_enqueue_script( 'theme-preview' ); 19 16 20 require_once('admin-header.php'); 17 21 ?> 18 22 … … 29 33 30 34 <div class="wrap"> 31 35 <h2><?php _e('Current Theme'); ?></h2> 32 <div id="current theme">36 <div id="current-theme"> 33 37 <?php if ( $ct->screenshot ) : ?> 34 38 <img src="<?php echo get_option('siteurl') . '/' . $ct->stylesheet_dir . '/' . $ct->screenshot; ?>" alt="<?php _e('Current theme preview'); ?>" /> 35 39 <?php endif; ?> 36 40 <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> 38 42 <?php if ($ct->parent_theme) { ?> 39 43 <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> 40 44 <?php } else { ?> … … 47 51 48 52 <h2><?php _e('Available Themes'); ?></h2> 49 53 <?php if ( 1 < count($themes) ) { ?> 50 54 <table id="availablethemes" cellspacing="0" cellpadding="0"> 51 55 <?php 52 56 $style = ''; 53 57 54 58 $theme_names = array_keys($themes); 55 59 natcasesort($theme_names); 56 60 57 foreach ($theme_names as $theme_name) { 58 if ( $theme_name == $ct->name ) 59 continue; 61 $rows = ceil(count($theme_names) / 3); 62 for ( $row = 1; $row <= $rows; $row++ ) 63 for ( $col = 1; $col <= 3; $col++ ) 64 $table[$row][$col] = array_shift($theme_names); 65 66 foreach ( $table as $row => $cols ) { 67 ?> 68 <tr> 69 <?php 70 foreach ( $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) ) : 60 79 $template = $themes[$theme_name]['Template']; 61 80 $stylesheet = $themes[$theme_name]['Stylesheet']; 62 81 $title = $themes[$theme_name]['Title']; … … 65 84 $author = $themes[$theme_name]['Author']; 66 85 $screenshot = $themes[$theme_name]['Screenshot']; 67 86 $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 ) ); 68 90 $tags = $themes[$theme_name]['Tags']; 91 $thickbox_class = 'thickbox'; 69 92 $activate_link = wp_nonce_url("themes.php?action=activate&template=".urlencode($template)."&stylesheet=".urlencode($stylesheet), 'switch-theme_' . $template); 93 $activate_text = attribute_escape( sprintf( __('Activate "%s"'), $title ) ); 70 94 ?> 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"> 75 96 <?php if ( $screenshot ) : ?> 76 <img src="<?php echoget_option('siteurl') . '/' . $stylesheet_dir . '/' . $screenshot; ?>" alt="" />97 <img src="<?php echo ( $tpage == 'stage' ) ? $screenshot : get_option('siteurl') . '/' . $stylesheet_dir . '/' . $screenshot; ?>" alt="" /> 77 98 <?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> 81 102 <?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> 83 105 <?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> 87 113 <?php } ?> 88 114 89 115 <?php -
wp-admin/wp-admin.css
52 52 margin: 10px 20px 10px 20px; 53 53 } 54 54 55 .available-theme { 56 width: 30%; 57 margin: 0 1em; 58 float: left; 59 text-align: center; 60 height: 28em; 61 overflow: hidden; 55 table#availablethemes { 56 border-spacing: 0px; 57 border: none; 58 border-top: 1px solid #ccc; 59 border-bottom: 1px solid #ccc; 60 margin: 10px auto; 62 61 } 62 td.available-theme { 63 vertical-align: top; 64 width: 240px; 65 margin: 0; 66 padding: 20px; 67 text-align: left; 68 } 69 table#availablethemes td { 70 border: 1px solid #eee; 71 border-top: none; 72 } 73 table#availablethemes td.top { 74 border-top: none; 75 } 76 table#availablethemes td.right { 77 border-right: none; 78 border-left: none; 79 } 80 table#availablethemes td.bottom { 81 border-bottom: none; 82 } 83 table#availablethemes td.left { 84 border-right: none; 85 border-left: none; 86 } 63 87 64 88 .available-theme a.screenshot { 65 width: 2 50px;66 height: 200px;89 width: 240px; 90 height: 180px; 67 91 display: block; 68 margin: auto;92 border: 1px solid #efefef; 69 93 margin-bottom: 10px; 70 94 overflow: hidden; 71 border-width: 1px;72 border-style: solid;73 95 } 74 75 96 .available-theme img { 76 width: 100%;97 width: 240px; 77 98 } 99 .available-theme h3 { 100 margin: 15px 0 5px; 101 } 78 102 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 79 141 .checkbox { 80 142 border: none; 81 143 margin: 0; … … 249 311 border-collapse: separate; 250 312 } 251 313 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 261 314 #quicktags { 262 315 padding: 0; 263 316 border: 0 none; -
wp-includes/general-template.php
1135 1135 $color = $_wp_admin_css_colors[$color]; 1136 1136 $_file = $color->url; 1137 1137 $_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"; 1138 1140 } else { 1139 1141 $_file = get_option( 'siteurl' ) . "/wp-admin/$file.css"; 1140 1142 } … … 1153 1155 } 1154 1156 } 1155 1157 1158 function add_thickbox() { 1159 wp_enqueue_script( 'thickbox' ); 1160 add_action( 'admin_print_scripts', 'add_thickbox_css' ); 1161 } 1162 1163 function add_thickbox_css() { 1164 wp_admin_css( 'css/thickbox' ); 1165 } 1166 1156 1167 /** 1157 1168 * Outputs the XHTML generator that is generated on the wp_head hook. 1158 1169 */ -
wp-includes/js/thickbox/thickbox.css
45 45 46 46 #TB_window { 47 47 position: fixed; 48 background: #ffffff; 48 49 z-index: 102; 49 50 color:#000000; 50 51 display:none; 52 border: 4px solid #525252; 51 53 text-align:left; 52 top: 20px;54 top:50%; 53 55 left:50%; 54 56 } 55 57 56 58 * html #TB_window { /* ie6 hack */ 57 59 position: absolute; 58 margin-top: expression( 20) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px');60 margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement && document.documentElement.scrollTop || document.body.scrollTop) + 'px'); 59 61 } 60 62 61 63 #TB_window img#TB_Image { … … 80 82 } 81 83 82 84 #TB_closeAjaxWindow{ 83 padding:7px 10px 5px 0; 84 margin-bottom:1px; 85 padding:6px 10px 0; 85 86 text-align:right; 86 87 float:right; 87 88 } 88 89 89 90 #TB_ajaxWindowTitle{ 90 91 float:left; 91 padding:7px 0 5px 10px; 92 margin-bottom:1px; 92 padding:6px 10px 0; 93 93 } 94 94 95 95 #TB_title{ 96 96 background-color:#e8e8e8; 97 97 height:27px; 98 border-width: 4px;99 border-color: #525252;100 border-style: solid solid none;101 98 } 102 99 103 100 #TB_ajaxContent{ … … 155 152 clear:both; 156 153 border:none; 157 154 margin-bottom:-1px; 158 margin-top:1px;159 155 _margin-bottom:1px; 160 156 } -
wp-includes/script-loader.php
205 205 'updateCompleted' => __('Update completed.'), 206 206 'error' => __('Error:') 207 207 )); 208 209 $this->add( 'theme-preview', '/wp-admin/js/theme-preview.js', array( 'thickbox', 'dimensions' ), '20080515' ); 208 210 } 209 211 } 210 212 -
wp-includes/theme.php
479 479 echo '<link rel="stylesheet" href="' . $stylesheet . '" type="text/css" media="screen" />'; 480 480 } 481 481 482 function 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 } 496 add_action('setup_theme', 'preview_theme'); 497 498 function preview_theme_ob_filter( $content ) { 499 return preg_replace_callback( "|(<a.*?href=([\"']))(.*?)([\"'].*?>)|", 'preview_theme_ob_filter_callback', $content ); 500 } 501 502 function 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 482 520 function switch_theme($template, $stylesheet) { 483 521 update_option('template', $template); 484 522 update_option('stylesheet', $stylesheet); -
wp-settings.php
425 425 */ 426 426 $wp =& new WP(); 427 427 428 $wp->init(); // Sets up current user. 428 429 429 /**430 * Web Path to the current active template directory431 * @since 1.5432 */433 define('TEMPLATEPATH', get_template_directory());434 435 /**436 * Web Path to the current active template stylesheet directory437 * @since 2.1438 */439 define('STYLESHEETPATH', get_stylesheet_directory());440 441 430 // Load the default text localization domain. 442 431 load_default_textdomain(); 443 432 … … 460 449 */ 461 450 $wp_locale =& new WP_Locale(); 462 451 452 do_action('setup_theme'); 453 454 /** 455 * Web Path to the current active template directory 456 * @since 1.5 457 */ 458 define('TEMPLATEPATH', get_template_directory()); 459 460 /** 461 * Web Path to the current active template stylesheet directory 462 * @since 2.1 463 */ 464 define('STYLESHEETPATH', get_stylesheet_directory()); 465 463 466 // Load functions for active theme. 464 467 if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists(STYLESHEETPATH . '/functions.php') ) 465 468 include(STYLESHEETPATH . '/functions.php'); … … 478 481 } 479 482 register_shutdown_function('shutdown_action_hook'); 480 483 481 $wp->init(); // Sets up current user.482 483 484 // Everything is loaded and initialized. 484 485 do_action('init'); 485 486