<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[20419] trunk: Replace all instances of thickbox theme preview with the theme customizer.</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg > ul, #logmsg > ol { margin-left: 0; margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/20419">20419</a></dd>
<dt>Author</dt> <dd>koopersmith</dd>
<dt>Date</dt> <dd>2012-04-10 02:25:03 +0000 (Tue, 10 Apr 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>Replace all instances of thickbox theme preview with the theme customizer. fixes <a href="http://core.trac.wordpress.org/ticket/20404">#20404</a>.

* Use theme customizer in theme install/update screens.
* Separate the customize loader from the customizer. Use wp_customize_loader() to include the loader script and markup.
* Deprecated: wp-admin/js/theme-preview.js is now no longer used by core.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludesclasswpupgraderphp">trunk/wp-admin/includes/class-wp-upgrader.php</a></li>
<li><a href="#trunkwpadminthemeinstallphp">trunk/wp-admin/theme-install.php</a></li>
<li><a href="#trunkwpadminthemesphp">trunk/wp-admin/themes.php</a></li>
<li><a href="#trunkwpadminupdatephp">trunk/wp-admin/update.php</a></li>
<li><a href="#trunkwpincludesclasswpcustomizephp">trunk/wp-includes/class-wp-customize.php</a></li>
<li><a href="#trunkwpincludesgeneraltemplatephp">trunk/wp-includes/general-template.php</a></li>
<li><a href="#trunkwpincludesjscustomizeloaderdevjs">trunk/wp-includes/js/customize-loader.dev.js</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
<li><a href="#trunkwpincludesthemephp">trunk/wp-includes/theme.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludesclasswpupgraderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-upgrader.php (20418 => 20419)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-upgrader.php        2012-04-10 01:58:27 UTC (rev 20418)
+++ trunk/wp-admin/includes/class-wp-upgrader.php        2012-04-10 02:25:03 UTC (rev 20419)
</span><span class="lines">@@ -711,7 +711,7 @@
</span><span class="cx">                 $this-&gt;strings['process_success_specific'] = $this-&gt;strings['parent_theme_install_success'];//, $api-&gt;name, $api-&gt;version);
</span><span class="cx"> 
</span><span class="cx">                 $this-&gt;skin-&gt;feedback('parent_theme_prepare_install', $api-&gt;name, $api-&gt;version);
</span><del>-                
</del><ins>+
</ins><span class="cx">                 add_filter('install_theme_complete_actions', '__return_false', 999); // Don't show any actions after installing the theme.
</span><span class="cx"> 
</span><span class="cx">                 // Install the parent theme
</span><span class="lines">@@ -735,7 +735,7 @@
</span><span class="cx"> 
</span><span class="cx">                 return $install_result;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         function hide_activate_preview_actions($actions) {
</span><span class="cx">                 unset($actions['activate'], $actions['preview']);
</span><span class="cx">                 return $actions;
</span><span class="lines">@@ -1494,20 +1494,34 @@
</span><span class="cx">                         return;
</span><span class="cx"> 
</span><span class="cx">                 $theme_info = $this-&gt;upgrader-&gt;theme_info();
</span><del>-                if ( empty($theme_info) )
</del><ins>+                if ( empty( $theme_info ) )
</ins><span class="cx">                         return;
</span><del>-                $name = $theme_info-&gt;display('Name');
</del><ins>+
+                $name       = $theme_info-&gt;display('Name');
</ins><span class="cx">                 $stylesheet = $this-&gt;upgrader-&gt;result['destination_name'];
</span><del>-                $template = $theme_info-&gt;get_template();
</del><ins>+                $template   = $theme_info-&gt;get_template();
</ins><span class="cx"> 
</span><del>-                $preview_link = htmlspecialchars( add_query_arg( array('preview' =&gt; 1, 'template' =&gt; $template, 'stylesheet' =&gt; $stylesheet, 'preview_iframe' =&gt; 1, 'TB_iframe' =&gt; 'true' ), trailingslashit(esc_url(get_option('home'))) ) );
-                $activate_link = wp_nonce_url(&quot;themes.php?action=activate&amp;amp;template=&quot; . urlencode($template) . &quot;&amp;amp;stylesheet=&quot; . urlencode($stylesheet), 'switch-theme_' . $template);
</del><ins>+                $preview_link = add_query_arg( array(
+                        'preview'    =&gt; 1,
+                        'template'   =&gt; $template,
+                        'stylesheet' =&gt; $stylesheet,
+                ), trailingslashit( get_home_url() ) );
</ins><span class="cx"> 
</span><del>-                $install_actions = array(
-                        'preview' =&gt; '&lt;a href=&quot;' . $preview_link . '&quot; class=&quot;thickbox thickbox-preview&quot; title=&quot;' . esc_attr(sprintf(__('Preview &amp;#8220;%s&amp;#8221;'), $name)) . '&quot;&gt;' . __('Preview') . '&lt;/a&gt;',
-                        'activate' =&gt; '&lt;a href=&quot;' . $activate_link . '&quot; class=&quot;activatelink&quot; title=&quot;' . esc_attr( sprintf( __('Activate &amp;#8220;%s&amp;#8221;'), $name ) ) . '&quot;&gt;' . __('Activate') . '&lt;/a&gt;'
-                                                        );
</del><ins>+                $customize_attributes = 'title=&quot;' . esc_attr( sprintf( __( 'Customize &amp;#8220;%s&amp;#8221;' ), $name ) ) . '&quot;
+                        . data-customize-template=&quot;' . esc_attr( $template ) . '&quot; data-customize-stylesheet=&quot;' . esc_attr( $stylesheet ) . '&quot;';
</ins><span class="cx"> 
</span><ins>+                $activate_link = add_query_arg( array(
+                        'action'     =&gt; 'activate',
+                        'template'   =&gt; $template,
+                        'stylesheet' =&gt; $stylesheet,
+                ), admin_url('themes.php') );
+                $activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $template );
+
+                $install_actions = array();
+                $install_actions['preview']  = '&lt;a href=&quot;' . esc_url( $preview_link ) . '&quot; class=&quot;hide-if-js&quot; title=&quot;' . esc_attr(sprintf(__('Preview &amp;#8220;%s&amp;#8221;'), $name ) ) . '&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
+                $install_actions['preview'] .= '&lt;a href=&quot;#&quot; class=&quot;hide-if-no-js load-customize&quot; ' . $customize_attributes . '&gt;' . __('Customize') . '&lt;/a&gt;';
+                $install_actions['activate'] = '&lt;a href=&quot;' . esc_url( $activate_link ) . '&quot; class=&quot;activatelink&quot; title=&quot;' . esc_attr( sprintf( __('Activate &amp;#8220;%s&amp;#8221;'), $name ) ) . '&quot;&gt;' . __('Activate') . '&lt;/a&gt;';
+
</ins><span class="cx">                 if ( is_network_admin() &amp;&amp; current_user_can( 'manage_network_themes' ) )
</span><span class="cx">                         $install_actions['network_enable'] = '&lt;a href=&quot;' . esc_url( wp_nonce_url( 'themes.php?action=enable&amp;amp;theme=' . $template, 'enable-theme_' . $template ) ) . '&quot; title=&quot;' . esc_attr__( 'Enable this theme for all sites in this network' ) . '&quot; target=&quot;_parent&quot;&gt;' . __( 'Network Enable' ) . '&lt;/a&gt;';
</span><span class="cx"> 
</span><span class="lines">@@ -1550,17 +1564,31 @@
</span><span class="cx"> 
</span><span class="cx">                 $update_actions = array();
</span><span class="cx">                 if ( ! empty( $this-&gt;upgrader-&gt;result['destination_name'] ) &amp;&amp; $theme_info = $this-&gt;upgrader-&gt;theme_info() ) {
</span><del>-                        $name = $theme_info-&gt;display('Name');
</del><ins>+                        $name       = $theme_info-&gt;display('Name');
</ins><span class="cx">                         $stylesheet = $this-&gt;upgrader-&gt;result['destination_name'];
</span><del>-                        $template = $theme_info-&gt;get_template();
</del><ins>+                        $template   = $theme_info-&gt;get_template();
</ins><span class="cx"> 
</span><del>-                        $preview_link = htmlspecialchars( add_query_arg( array('preview' =&gt; 1, 'template' =&gt; $template, 'stylesheet' =&gt; $stylesheet, 'TB_iframe' =&gt; 'true' ), trailingslashit(esc_url(get_option('home'))) ) );
-                        $activate_link = wp_nonce_url(&quot;themes.php?action=activate&amp;amp;template=&quot; . urlencode($template) . &quot;&amp;amp;stylesheet=&quot; . urlencode($stylesheet), 'switch-theme_' . $template);
</del><ins>+                        $preview_link = add_query_arg( array(
+                                'preview'    =&gt; 1,
+                                'template'   =&gt; $template,
+                                'stylesheet' =&gt; $stylesheet,
+                        ), trailingslashit( get_home_url() ) );
</ins><span class="cx"> 
</span><del>-                        $update_actions['preview'] = '&lt;a href=&quot;' . $preview_link . '&quot; class=&quot;thickbox thickbox-preview&quot; title=&quot;' . esc_attr(sprintf(__('Preview &amp;#8220;%s&amp;#8221;'), $name)) . '&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
-                        $update_actions['activate'] = '&lt;a href=&quot;' . $activate_link . '&quot; class=&quot;activatelink&quot; title=&quot;' . esc_attr( sprintf( __('Activate &amp;#8220;%s&amp;#8221;'), $name ) ) . '&quot;&gt;' . __('Activate') . '&lt;/a&gt;';
</del><ins>+                        $customize_attributes = 'title=&quot;' . esc_attr( sprintf( __( 'Customize &amp;#8220;%s&amp;#8221;' ), $name ) ) . '&quot;
+                                . data-customize-template=&quot;' . esc_attr( $template ) . '&quot; data-customize-stylesheet=&quot;' . esc_attr( $stylesheet ) . '&quot;';
</ins><span class="cx"> 
</span><del>-                        if ( ( ! $this-&gt;result || is_wp_error($this-&gt;result) ) || $stylesheet == get_stylesheet() )
</del><ins>+                        $activate_link = add_query_arg( array(
+                                'action'     =&gt; 'activate',
+                                'template'   =&gt; $template,
+                                'stylesheet' =&gt; $stylesheet,
+                        ), admin_url('themes.php') );
+                        $activate_link = wp_nonce_url( $activate_link, 'switch-theme_' . $template );
+
+                        $update_actions['preview']  = '&lt;a href=&quot;' . esc_url( $preview_link ) . '&quot; class=&quot;hide-if-js&quot; title=&quot;' . esc_attr(sprintf(__('Preview &amp;#8220;%s&amp;#8221;'), $name ) ) . '&quot;&gt;' . __('Preview') . '&lt;/a&gt;';
+                        $update_actions['preview'] .= '&lt;a href=&quot;#&quot; class=&quot;hide-if-no-js load-customize&quot; ' . $customize_attributes . '&gt;' . __('Customize') . '&lt;/a&gt;';
+                        $update_actions['activate'] = '&lt;a href=&quot;' . esc_url( $activate_link ) . '&quot; class=&quot;activatelink&quot; title=&quot;' . esc_attr( sprintf( __('Activate &amp;#8220;%s&amp;#8221;'), $name ) ) . '&quot;&gt;' . __('Activate') . '&lt;/a&gt;';
+
+                        if ( ( ! $this-&gt;result || is_wp_error( $this-&gt;result ) ) || $stylesheet == get_stylesheet() )
</ins><span class="cx">                                 unset($update_actions['preview'], $update_actions['activate']);
</span><span class="cx">                 }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminthemeinstallphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/theme-install.php (20418 => 20419)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/theme-install.php        2012-04-10 01:58:27 UTC (rev 20418)
+++ trunk/wp-admin/theme-install.php        2012-04-10 02:25:03 UTC (rev 20419)
</span><span class="lines">@@ -30,9 +30,6 @@
</span><span class="cx">         $submenu_file = 'themes.php';
</span><span class="cx"> 
</span><span class="cx"> wp_enqueue_script( 'theme-install' );
</span><del>-
-add_thickbox();
-wp_enqueue_script( 'theme-preview' );
</del><span class="cx"> wp_enqueue_script( 'theme' );
</span><span class="cx"> 
</span><span class="cx"> $body_id = $tab;
</span></span></pre></div>
<a id="trunkwpadminthemesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/themes.php (20418 => 20419)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/themes.php        2012-04-10 01:58:27 UTC (rev 20418)
+++ trunk/wp-admin/themes.php        2012-04-10 02:25:03 UTC (rev 20419)
</span><span class="lines">@@ -66,9 +66,8 @@
</span><span class="cx">         '&lt;p&gt;' . __('&lt;a href=&quot;http://wordpress.org/support/&quot; target=&quot;_blank&quot;&gt;Support Forums&lt;/a&gt;') . '&lt;/p&gt;'
</span><span class="cx"> );
</span><span class="cx"> 
</span><del>-add_thickbox();
-wp_enqueue_script( 'theme-preview' );
</del><span class="cx"> wp_enqueue_script( 'theme' );
</span><ins>+wp_customize_loader();
</ins><span class="cx"> 
</span><span class="cx"> endif;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkwpadminupdatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/update.php (20418 => 20419)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/update.php        2012-04-10 01:58:27 UTC (rev 20418)
+++ trunk/wp-admin/update.php        2012-04-10 02:25:03 UTC (rev 20419)
</span><span class="lines">@@ -152,8 +152,8 @@
</span><span class="cx"> 
</span><span class="cx">                 check_admin_referer('upgrade-theme_' . $theme);
</span><span class="cx"> 
</span><del>-                add_thickbox();
-                wp_enqueue_script('theme-preview');
</del><ins>+                wp_customize_loader();
+
</ins><span class="cx">                 $title = __('Update Theme');
</span><span class="cx">                 $parent_file = 'themes.php';
</span><span class="cx">                 $submenu_file = 'themes.php';
</span><span class="lines">@@ -204,8 +204,8 @@
</span><span class="cx">                 if ( is_wp_error($api) )
</span><span class="cx">                          wp_die($api);
</span><span class="cx"> 
</span><del>-                add_thickbox();
-                wp_enqueue_script('theme-preview');
</del><ins>+                 wp_customize_loader();
+
</ins><span class="cx">                 $title = __('Install Themes');
</span><span class="cx">                 $parent_file = 'themes.php';
</span><span class="cx">                 $submenu_file = 'themes.php';
</span><span class="lines">@@ -230,11 +230,12 @@
</span><span class="cx"> 
</span><span class="cx">                 $file_upload = new File_Upload_Upgrader('themezip', 'package');
</span><span class="cx"> 
</span><ins>+                wp_customize_loader();
+
</ins><span class="cx">                 $title = __('Upload Theme');
</span><span class="cx">                 $parent_file = 'themes.php';
</span><span class="cx">                 $submenu_file = 'theme-install.php';
</span><del>-                add_thickbox();
-                wp_enqueue_script('theme-preview');
</del><ins>+
</ins><span class="cx">                 require_once(ABSPATH . 'wp-admin/admin-header.php');
</span><span class="cx"> 
</span><span class="cx">                 $title = sprintf( __('Installing Theme from uploaded file: %s'), basename( $file_upload-&gt;filename ) );
</span></span></pre></div>
<a id="trunkwpincludesclasswpcustomizephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/class-wp-customize.php (20418 => 20419)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/class-wp-customize.php        2012-04-10 01:58:27 UTC (rev 20418)
+++ trunk/wp-includes/class-wp-customize.php        2012-04-10 02:25:03 UTC (rev 20419)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx">                 add_action( 'setup_theme',  array( $this, 'setup_theme' ) );
</span><span class="cx">                 add_action( 'admin_init',   array( $this, 'admin_init' ) );
</span><span class="cx">                 add_action( 'wp_loaded',    array( $this, 'wp_loaded' ) );
</span><del>-                add_action( 'admin_footer', array( $this, 'admin_footer' ) );
</del><span class="cx"> 
</span><span class="cx">                 add_action( 'customize_previewing',               array( $this, 'customize_previewing' ) );
</span><span class="cx">                 add_action( 'customize_register',                 array( $this, 'register_controls' ) );
</span><span class="lines">@@ -275,8 +274,6 @@
</span><span class="cx">                 if ( isset( $_REQUEST['save_customize_controls'] ) )
</span><span class="cx">                         $this-&gt;save();
</span><span class="cx"> 
</span><del>-                wp_enqueue_script( 'customize-loader' );
-
</del><span class="cx">                 if ( ( defined( 'DOING_AJAX' ) &amp;&amp; DOING_AJAX ) )
</span><span class="cx">                         return;
</span><span class="cx"> 
</span><span class="lines">@@ -295,24 +292,6 @@
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         /**
</span><del>-         * Print the customize template.
-         *
-         * @since 3.4.0
-         */
-        public function admin_footer() {
-                ?&gt;
-                &lt;div id=&quot;customize-container&quot; class=&quot;wp-full-overlay&quot;&gt;
-                        &lt;input type=&quot;hidden&quot; class=&quot;admin-url&quot; value=&quot;&lt;?php echo esc_url( admin_url( 'admin.php' ) ); ?&gt;&quot; /&gt;
-                        &lt;a href=&quot;#&quot; class=&quot;close-full-overlay&quot;&gt;&lt;?php printf( __( '&amp;larr; Return to %s' ), get_admin_page_title() ); ?&gt;&lt;/a&gt;
-                        &lt;a href=&quot;#&quot; class=&quot;collapse-sidebar button-secondary&quot; title=&quot;&lt;?php esc_attr_e('Collapse Sidebar'); ?&gt;&quot;&gt;
-                                &lt;span class=&quot;collapse-sidebar-label&quot;&gt;&lt;?php _e('Collapse'); ?&gt;&lt;/span&gt;
-                                &lt;span class=&quot;collapse-sidebar-arrow&quot;&gt;&lt;/span&gt;
-                        &lt;/a&gt;
-                &lt;/div&gt;
-                &lt;?php
-        }
-
-        /**
</del><span class="cx">          * Switch the theme and trigger the save action of each setting.
</span><span class="cx">          *
</span><span class="cx">          * @since 3.4.0
</span></span></pre></div>
<a id="trunkwpincludesgeneraltemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/general-template.php (20418 => 20419)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/general-template.php        2012-04-10 01:58:27 UTC (rev 20418)
+++ trunk/wp-includes/general-template.php        2012-04-10 02:25:03 UTC (rev 20419)
</span><span class="lines">@@ -2108,7 +2108,7 @@
</span><span class="cx">  * Enqueues the default ThickBox js and css.
</span><span class="cx">  *
</span><span class="cx">  * If any of the settings need to be changed, this can be done with another js
</span><del>- * file similar to media-upload.js and theme-preview.js. That file should
</del><ins>+ * file similar to media-upload.js. That file should
</ins><span class="cx">  * require array('thickbox') to ensure it is loaded after.
</span><span class="cx">  *
</span><span class="cx">  * @since 2.5.0
</span></span></pre></div>
<a id="trunkwpincludesjscustomizeloaderdevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/js/customize-loader.dev.js (20418 => 20419)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/customize-loader.dev.js        2012-04-10 01:58:27 UTC (rev 20418)
+++ trunk/wp-includes/js/customize-loader.dev.js        2012-04-10 02:25:03 UTC (rev 20419)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx">         $( function() {
</span><span class="cx">                 Loader.initialize();
</span><span class="cx"> 
</span><del>-                $('#current-theme, #availablethemes').on( 'click', '.load-customize', function( event ) {
</del><ins>+                $('#wpbody').on( 'click', '.load-customize', function( event ) {
</ins><span class="cx">                         var load = $(this);
</span><span class="cx"> 
</span><span class="cx">                         event.preventDefault();
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (20418 => 20419)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2012-04-10 01:58:27 UTC (rev 20418)
+++ trunk/wp-includes/script-loader.php        2012-04-10 02:25:03 UTC (rev 20419)
</span><span class="lines">@@ -364,8 +364,9 @@
</span><span class="cx"> 
</span><span class="cx">                 $scripts-&gt;add( 'admin-widgets', &quot;/wp-admin/js/widgets$suffix.js&quot;, array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable' ), false, 1 );
</span><span class="cx"> 
</span><del>-                $scripts-&gt;add( 'theme', &quot;/wp-admin/js/theme$suffix.js&quot;, array( 'thickbox' ), false, 1 );
</del><ins>+                $scripts-&gt;add( 'theme', &quot;/wp-admin/js/theme$suffix.js&quot;, array( 'jquery' ), false, 1 );
</ins><span class="cx"> 
</span><ins>+                // @todo: Core no longer uses theme-preview.js. Remove?
</ins><span class="cx">                 $scripts-&gt;add( 'theme-preview', &quot;/wp-admin/js/theme-preview$suffix.js&quot;, array( 'thickbox', 'jquery' ), false, 1 );
</span><span class="cx"> 
</span><span class="cx">                 $scripts-&gt;add( 'inline-edit-post', &quot;/wp-admin/js/inline-edit-post$suffix.js&quot;, array( 'jquery', 'suggest' ), false, 1 );
</span></span></pre></div>
<a id="trunkwpincludesthemephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/theme.php (20418 => 20419)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/theme.php        2012-04-10 01:58:27 UTC (rev 20418)
+++ trunk/wp-includes/theme.php        2012-04-10 02:25:03 UTC (rev 20419)
</span><span class="lines">@@ -1563,9 +1563,16 @@
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-function wp_customize_load() {
</del><ins>+/**
+ * Includes and instantiates the WP_Customize class.
+ *
+ * Fires when ?customize=on.
+ *
+ * @since 3.4.0
+ */
+function _wp_customize_include() {
</ins><span class="cx">         // Load on themes.php or ?customize=on
</span><del>-        if ( ! ( isset( $_REQUEST['customize'] ) &amp;&amp; 'on' == $_REQUEST['customize'] ) &amp;&amp; 'themes.php' != $GLOBALS['pagenow'] )
</del><ins>+        if ( ! ( isset( $_REQUEST['customize'] ) &amp;&amp; 'on' == $_REQUEST['customize'] ) )
</ins><span class="cx">                 return;
</span><span class="cx"> 
</span><span class="cx">         require( ABSPATH . WPINC . '/class-wp-customize.php' );
</span><span class="lines">@@ -1573,4 +1580,33 @@
</span><span class="cx">         // @todo Dependency injection instead
</span><span class="cx">         $GLOBALS['customize'] = new WP_Customize;
</span><span class="cx"> }
</span><del>-add_action( 'plugins_loaded', 'wp_customize_load' );
</del><ins>+add_action( 'plugins_loaded', '_wp_customize_include' );
+
+/**
+ * Includes the loading scripts for the theme customizer and
+ * adds the action to print the customize container template.
+ *
+ * @since 3.4.0
+ */
+function wp_customize_loader() {
+        wp_enqueue_script( 'customize-loader' );
+        add_action( 'admin_footer', '_wp_customize_loader_template' );
+}
+
+/**
+ * Print the customize container template.
+ *
+ * @since 3.4.0
+ */
+function _wp_customize_loader_template() {
+        ?&gt;
+        &lt;div id=&quot;customize-container&quot; class=&quot;wp-full-overlay&quot;&gt;
+                &lt;input type=&quot;hidden&quot; class=&quot;admin-url&quot; value=&quot;&lt;?php echo esc_url( admin_url( 'admin.php' ) ); ?&gt;&quot; /&gt;
+                &lt;a href=&quot;#&quot; class=&quot;close-full-overlay&quot;&gt;&lt;?php printf( __( '&amp;larr; Return to %s' ), get_admin_page_title() ); ?&gt;&lt;/a&gt;
+                &lt;a href=&quot;#&quot; class=&quot;collapse-sidebar button-secondary&quot; title=&quot;&lt;?php esc_attr_e('Collapse Sidebar'); ?&gt;&quot;&gt;
+                        &lt;span class=&quot;collapse-sidebar-label&quot;&gt;&lt;?php _e('Collapse'); ?&gt;&lt;/span&gt;
+                        &lt;span class=&quot;collapse-sidebar-arrow&quot;&gt;&lt;/span&gt;
+                &lt;/a&gt;
+        &lt;/div&gt;
+        &lt;?php
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre>
</div>
</div>

</body>
</html>