<!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>[1001] sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes: WP.org Themes: Bring theme installer goodies to the front-end.</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 { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { 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" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://meta.trac.wordpress.org/changeset/1001">1001</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://meta.trac.wordpress.org/changeset/1001","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>obenland</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2014-11-21 10:04:40 +0000 (Fri, 21 Nov 2014)</dd>
</dl>

<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>WP.org Themes: Bring theme installer goodies to the front-end.

This brings most of the Backbone and Themes API-based functionality
from the admin's theme install screen to the front-end.

There are of course still loads of things to do, but it works
decently enough to share it with the world and give an idea of where
this is headed.

See https://make.wordpress.org/meta/2014/11/20/theme-repository-theme/
See <a href="http://meta.trac.wordpress.org/ticket/745">#745</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemescontentsinglephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemescontentphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesfunctionsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesheaderphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/header.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesindexphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemessinglephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/single.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesstylecss">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/style.css</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesjsthemejs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesthemejs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/theme.js</a></li>
<li>sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/</li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesviewtemplatesthemepreviewphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-preview.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesviewtemplatesthemesinglephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-single.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesviewtemplatesthemephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme.php</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemescontentsinglephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php       2014-11-20 04:56:36 UTC (rev 1000)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content-single.php 2014-11-21 10:04:40 UTC (rev 1001)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,24 +1,53 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-global $post;
-$theme = new Repo_Theme_Package($post);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+include_once ABSPATH . '/wp-admin/includes/theme.php';
+$theme = themes_api( 'theme_information', array( 'slug' => get_post()->post_name ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<div <?php post_class('single-theme'); ?> id="post-<?php the_ID(); ?>">
-       <div class="theme-overlay">
-               <div class="theme-about">
-                       <div class="theme-screenshots">
-                               <div class="screenshot"><?php the_post_thumbnail(); ?></div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+<div class="theme-backdrop"></div>
+<div class="theme-wrap">
+       <div class="theme-header">
+               <button class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show previous theme' ); ?></span></button>
+               <button class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show next theme' ); ?></span></button>
+               <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close overlay' ); ?></span></button>
+       </div>
+       <div class="theme-about">
+               <div class="theme-screenshots">
+                       <div class="screenshot"><?php the_post_thumbnail(); ?></div>
+               </div>
+
+               <div class="theme-info">
+                       <h3 class="theme-name"><?php the_title(); ?><span
+                                       class="theme-version"><?php printf( __( 'Version: %s' ), $theme->version ); ?></span>
+                       </h3>
+                       <h4 class="theme-author"><?php printf( __( 'By %s' ), $theme->author ); ?></h4>
+
+                       <p class="theme-description"><?php the_content(); ?></p>
+
+                       <div class="rating rating-<?php echo round( $theme->rating, -1 ); ?>">
+                               <span class="one"></span>
+                               <span class="two"></span>
+                               <span class="three"></span>
+                               <span class="four"></span>
+                               <span class="five"></span>
+
+                               <p class="votes"><?php printf( __( 'Based on %s ratings.' ), $theme->num_ratings ); ?></p>
</ins><span class="cx" style="display: block; padding: 0 10px">                         </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        <div class="theme-info">
-                               <h3 class="theme-name"><?php the_title(); ?>
-                                       <span class="theme-version">Version: <?php echo $theme->version; ?></span>
-                               </h3>
-                               <h4 class="theme-author">By <a href="<?php echo $theme->authorurl; ?>"> TODO the WordPress team</a></h4>
-                               <p class="theme-description">
-                                       <?php the_content(); ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+                       <div class="theme-stats">
+                               <div><strong><?php _e( 'Last updated:' ); ?></strong> <?php echo $theme->last_updated; ?></div>
+                               <div><strong><?php _e( 'Downloads:' ); ?></strong> <?php echo $theme->downloaded; ?></div>
+                               <div><a href="<?php echo esc_url( $theme->homepage ); ?>"><?php _e( 'Theme Homepage &raquo;' ); ?></a></div>
+                       </div>
+
+                               <p class="theme-tags">
+                                       <span><?php _e( 'Tags:' ); ?></span>
+                                       <?php echo implode( ', ', $theme->tags ); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">                                 </p>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                <p class="theme-tags"><span>TODO Tags:</span> black, brown, orange, tan, white, yellow, light, one-column, two-columns, right-sidebar, fluid-layout, responsive-layout, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, translation-ready, accessibility-ready</p>
-                               
-                       </div>
</del><span class="cx" style="display: block; padding: 0 10px">                 </div>
</span><span class="cx" style="display: block; padding: 0 10px">        </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-</div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+       <div class="theme-actions">
+               <a href="<?php echo esc_url( '//downloads.wordpress.org/theme/' . $theme->slug . '.' . $theme->version . '.zip' ); ?>" class="button button-primary"><?php _e( 'Download' ); ?></a>
+               <a href="<?php echo esc_url( $theme->preview_url ); ?>" class="button button-secondary"><?php _e( 'Preview' ); ?></a>
+       </div>
+</div>
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemescontentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content.php      2014-11-20 04:56:36 UTC (rev 1000)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/content.php        2014-11-21 10:04:40 UTC (rev 1001)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,12 +1,13 @@
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php
-global $post;
-$theme = new Repo_Theme_Package($post);
-?>
-<div <?php post_class('theme'); ?> id="post-<?php the_ID(); ?>">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php global $theme; ?>
+<article class="theme">
</ins><span class="cx" style="display: block; padding: 0 10px">         <div class="theme-screenshot">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <img src="<?php echo $theme->screenshot_url(); ?>" alt="">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <img src="<?php echo esc_url( $theme->screenshot_url ); ?>" alt="">
</ins><span class="cx" style="display: block; padding: 0 10px">         </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <a href="<?php the_permalink(); ?>"><span class="more-details">Theme Details</span></a>
-       <div class="theme-author">By the TODO Author</div>        
-       <h3 class="theme-name"><?php the_title(); ?></h3>   
-</div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <a href="/<?php echo $theme->slug; ?>" class="more-details"><?php _ex( 'More Info', 'theme' ); ?></a>
+       <div class="theme-author"><?php printf( __( 'By %s' ), $theme->author ); ?></div>
+       <h3 class="theme-name"><?php echo $theme->name; ?></h3>
+
+       <div class="theme-actions">
+               <a class="button button-primary preview install-theme-preview" href="<?php echo esc_url( '//downloads.wordpress.org/theme/' . $theme->slug . '.' . $theme->version . '.zip' ); ?>"><?php esc_html_e( 'Download' ); ?></a>
+       </div>
+</article>
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php    2014-11-20 04:56:36 UTC (rev 1000)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php      2014-11-21 10:04:40 UTC (rev 1001)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,4 +1,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * WP.org Themes' functions and definitions.
+ *
+ * @package wporg-themes
+ */
+
+/**
+ * Sets up theme defaults and registers support for various WordPress features.
+ *
+ * Note that this function is hooked into the after_setup_theme hook, which
+ * runs before the init hook. The init hook is too late for some features, such
+ * as indicating support for post thumbnails.
+ */
+
</ins><span class="cx" style="display: block; padding: 0 10px"> function wporg_themes_setup() {
</span><span class="cx" style="display: block; padding: 0 10px"> //     load_theme_textdomain( 'wporg-themes', get_template_directory() . '/languages' );
</span><span class="cx" style="display: block; padding: 0 10px">        add_theme_support( 'automatic-feed-links' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,15 +28,89 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'after_setup_theme', 'wporg_themes_setup' );
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function wporg_themes_style() {
-       //<link rel="stylesheet" href="http://localhost/repotest/wp-admin/css/themes.css" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Enqueue scripts and styles.
+ */
+function wporg_themes_scripts() {
+
+       wp_enqueue_style( 'global-style', '//s.w.org/style/wp4.css', array(), '14' );
+       wp_enqueue_style( 'themes-style', self_admin_url( 'css/themes.css' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">         wp_enqueue_style( 'wporg-themes-style', get_stylesheet_uri() );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+       wp_enqueue_script( 'theme', self_admin_url( 'js/theme.js' ), array( 'wp-backbone' ), false, 1 );
+       wp_enqueue_script( 'wporg-theme', get_template_directory_uri() . '/js/theme.js', array( 'theme' ), false, 1 );
+
+       wp_localize_script( 'theme', '_wpThemeSettings', array(
+               'themes'   => false,
+               'settings' => array(
+                       'isInstall'  => true,
+                       'canInstall' => false,
+                       'installURI' => null,
+                       'adminUrl'   => '',
+               ),
+               'l10n' => array(
+                       'addNew'            => __( 'Add New Theme' ),
+                       'search'            => __( 'Search Themes' ),
+                       'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis)
+                       'upload'            => __( 'Upload Theme' ),
+                       'back'              => __( 'Back' ),
+                       'error'             => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server&#8217;s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' )
+               ),
+               'installedThemes' => array(),
+       ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-add_action( 'wp_enqueue_scripts', 'wporg_themes_style' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_action( 'wp_enqueue_scripts', 'wporg_themes_scripts' );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-// force the post type to the repopackages
-// TODO smarter
-function wporg_themes_pregetposts( &$q ) {
-       $q->set('post_type', 'repopackage');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * Removes Core's built-in query-themes handler, so we can safely add ours later on.
+ */
+function wporg_themes_remove_ajax_action() {
+       remove_action( 'wp_ajax_query-themes', 'wp_ajax_query_themes', 1 );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-add_action( 'pre_get_posts', 'wporg_themes_pregetposts' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+add_action( 'wp_ajax_query-themes', 'wporg_themes_remove_ajax_action', -1 );
+
+/**
+ * A recreation of Core's implementation without capability check, since there is nothing to install.
+ */
+function wporg_themes_query_themes() {
+       global $themes_allowedtags, $theme_field_defaults;
+
+       $args = wp_parse_args( wp_unslash( $_REQUEST['request'] ), array(
+               'per_page' => 20,
+               'fields'   => $theme_field_defaults,
+       ) );
+
+       $old_filter = isset( $args['browse'] ) ? $args['browse'] : 'search';
+
+       /** This filter is documented in wp-admin/includes/class-wp-theme-install-list-table.php */
+       $args = apply_filters( 'install_themes_table_api_args_' . $old_filter, $args );
+
+       $api = themes_api( 'query_themes', $args );
+
+       if ( is_wp_error( $api ) ) {
+               wp_send_json_error();
+       }
+
+       foreach ( $api->themes as &$theme ) {
+               $theme->name        = wp_kses( $theme->name,        $themes_allowedtags );
+               $theme->author      = wp_kses( $theme->author,      $themes_allowedtags );
+               $theme->version     = wp_kses( $theme->version,     $themes_allowedtags );
+               $theme->description = wp_kses( $theme->description, $themes_allowedtags );
+               $theme->num_ratings = sprintf( _n( '(based on %s rating)', '(based on %s ratings)', $theme->num_ratings ), number_format_i18n( $theme->num_ratings ) );
+               $theme->preview_url = set_url_scheme( $theme->preview_url );
+       }
+
+       wp_send_json_success( $api );
+}
+add_action( 'wp_ajax_query-themes',        'wporg_themes_query_themes' );
+add_action( 'wp_ajax_nopriv_query-themes', 'wporg_themes_query_themes' );
+
+/**
+ * Include view templates in the footer.
+ */
+function wporg_themes_view_templates() {
+       get_template_part( 'view-templates/theme' );
+       get_template_part( 'view-templates/theme-preview' );
+       get_template_part( 'view-templates/theme-single' );
+}
+add_action( 'wp_footer', 'wporg_themes_view_templates' );
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesheaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/header.php       2014-11-20 04:56:36 UTC (rev 1000)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/header.php 2014-11-21 10:04:40 UTC (rev 1001)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -21,9 +21,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <title>WordPress &#8250; Free WordPress Themes</title>
</span><span class="cx" style="display: block; padding: 0 10px"> <link href="//s.w.org/wp-includes/css/dashicons.css?20140409" rel="stylesheet" type="text/css" />
</span><span class="cx" style="display: block; padding: 0 10px"> <link href='//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,300,600&subset=latin,cyrillic-ext,greek-ext,greek,vietnamese,latin-ext,cyrillic' rel='stylesheet' type='text/css'>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<link rel="stylesheet" href="//s.w.org/style/wp4.css?14" />
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> <link media="only screen and (max-device-width: 480px)" href="//s.w.org/style/iphone.css?1" type="text/css" rel="stylesheet" />
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<link rel="stylesheet" href="http://localhost/repotest/wp-admin/css/themes.css" />
</del><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> <link rel="shortcut icon" href="//s.w.org/favicon.ico" type="image/x-icon" />
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -259,14 +258,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <body id="wordpress-org" >
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="wporg-header">
</span><span class="cx" style="display: block; padding: 0 10px">        <div class="wrapper">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <a id="mobile-menu-button" class="" href="#" onclick="toggleMenu();"></a>
-       <h1><a href="//wordpress.org">WordPress.org</a></h1>                          <div id="head-search">
-               <form action="//wordpress.org/search/do-search.php" method="get">
-                       <input class="text" name="search" type="text" value="" maxlength="150" placeholder="Search WordPress.org" /> <input type="submit" class="button" value="" />
-               </form>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <a id="mobile-menu-button" class="" href="#" onclick="toggleMenu();"></a>
+               <h1><a href="//wordpress.org">WordPress.org</a></h1>
+               <div id="head-search">
+                       <form action="//wordpress.org/search/do-search.php" method="get">
+                               <input class="text" name="search" type="text" value="" maxlength="150" placeholder="Search WordPress.org" /> <input type="submit" class="button" value="" />
+                       </form>
</ins><span class="cx" style="display: block; padding: 0 10px">                 </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                                <div style="clear:both"></div>
-               
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <div style="clear:both"></div>
+
</ins><span class="cx" style="display: block; padding: 0 10px"> <ul id="wporg-header-menu">
</span><span class="cx" style="display: block; padding: 0 10px"> <li><a href='//wordpress.org/showcase/' title='See some of the sites built on WordPress.'>Showcase</a></li>
</span><span class="cx" style="display: block; padding: 0 10px"> <li><a href='' title='Find just the right look for your website.' class="current">Themes</a><div class="uparrow"></div></li>
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -284,18 +284,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="download-mobile">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-    <div class="wrapper">
-        <span class="download-ready">Ready to get started?</span><a class="button download-button" href="//wordpress.org/download/" title="Get it. Got it? Good.">Download WordPress</a>
-    </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="wrapper">
+               <span class="download-ready">Ready to get started?</span><a class="button download-button" href="//wordpress.org/download/" title="Get it. Got it? Good.">Download WordPress</a>
+       </div>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="headline">
</span><span class="cx" style="display: block; padding: 0 10px">        <div class="wrapper">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <a href="/themes/"><h2>Themes Directory</h2></a>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         <h2 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h2>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">                <p class="login">
</span><span class="cx" style="display: block; padding: 0 10px">        Welcome, <a href='//profiles.wordpress.org/otto42'>Samuel Wood (Otto)</a>    | <a href="https://wordpress.org/themes/bb-admin/">Admin</a>     | <a href="https://wordpress.org/themes/bb-login.php?action=logout">Log Out</a></p>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        </div>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 
</del></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesindexphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php        2014-11-20 04:56:36 UTC (rev 1000)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php  2014-11-21 10:04:40 UTC (rev 1001)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -11,55 +11,70 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * @package wporg-themes
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-get_header(); ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+include ABSPATH . 'wp-admin/includes/theme.php';
+$themes = themes_api( 'query_themes', array(
+       'per_page' => 15,
+       'browse'   => get_query_var( 'attachment' ) ? get_query_var( 'attachment' )  : 'search',
+) );
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<div id="pagebody">
-        <div class="wrapper">
-               <div class="col-12">
-                       <p class="intro">Looking for awesome WordPress themes?<br />Welcome to the Free WordPress Themes directory.</p>
-               <div class="theme-browser">
-               
-               TODO menu bar
-               <div class="wp-filter">
-                               <div class="filter-count">
-                                       <span class="count theme-count">2,675</span>
-                               </div>
-               
-                               <ul class="filter-links">
-                                       <li><a href="/" data-sort="featured" class="current">Featured</a></li>
-                                       <li><a href="/browse/popular/" data-sort="popular">Popular</a></li>
-                                       <li><a href="/browse/new/" data-sort="new">Latest</a></li>
-                               </ul>
-               
-                               <a class="drawer-toggle" href="#">Feature Filter</a>
-               
-                               <div class="search-form"><input placeholder="Search themes..." type="search" id="wp-filter-search-input" class="wp-filter-search"></div>
-               
-                               <div class="filter-drawer">
-                                       <div class="buttons">
-                                               <a class="apply-filters button button-secondary" href="#">Apply Filters<span></span></a>
-                                               <a class="clear-filters button button-secondary" href="#">Clear</a>
-                                       </div>
-                               <div class="filter-group"><h4>Colors</h4><ol class="feature-group"><li><input type="checkbox" id="filter-id-black" value="black"> <label for="filter-id-black">Black</label></li><li><input type="checkbox" id="filter-id-blue" value="blue"> <label for="filter-id-blue">Blue</label></li><li><input type="checkbox" id="filter-id-brown" value="brown"> <label for="filter-id-brown">Brown</label></li><li><input type="checkbox" id="filter-id-gray" value="gray"> <label for="filter-id-gray">Gray</label></li><li><input type="checkbox" id="filter-id-green" value="green"> <label for="filter-id-green">Green</label>&
 lt;/li><li><input type="checkbox" id="filter-id-orange" value="orange"> <label for="filter-id-orange">Orange</label></li><li><input type="checkbox" id="filter-id-pink" value="pink"> <label for="filter-id-pink">Pink</label></li><li><input type="checkbox" id="filter-id-purple" value="purple"> <label for="filter-id-purple">Purple</label></li><li><input type="checkbox" id="filter-id-red" value="red"> <label for="filter-id-red">Red</label></li><li><input type="checkbox" id="filter-id-silver" value="silver"> <label for="filter-id-silver">Silver</label></li><li><input type="checkbox" id="filter-id-tan" value="
 tan"> <label for="filter-id-tan">Tan</label></li><li><input type="checkbox" id="filter-id-white" value="white"> <label for="filter-id-white">White</label></li><li><input type="checkbox" id="filter-id-yellow" value="yellow"> <label for="filter-id-yellow">Yellow</label></li><li><input type="checkbox" id="filter-id-dark" value="dark"> <label for="filter-id-dark">Dark</label></li><li><input type="checkbox" id="filter-id-light" value="light"> <label for="filter-id-light">Light</label></li></ol></div><div class="filter-group"><h4>Layout</h4><ol class="feature-group"><li><input type="checkbox" id="fil
 ter-id-fixed-layout" value="fixed-layout"> <label for="filter-id-fixed-layout">Fixed Layout</label></li><li><input type="checkbox" id="filter-id-fluid-layout" value="fluid-layout"> <label for="filter-id-fluid-layout">Fluid Layout</label></li><li><input type="checkbox" id="filter-id-responsive-layout" value="responsive-layout"> <label for="filter-id-responsive-layout">Responsive Layout</label></li><li><input type="checkbox" id="filter-id-one-column" value="one-column"> <label for="filter-id-one-column">One Column</label></li><li><input type="checkbox" id="filter-id-two-columns" value="two-columns"> <label for="filter-id-two-columns">Two Columns</label></li><li&
 gt;<input type="checkbox" id="filter-id-three-columns" value="three-columns"> <label for="filter-id-three-columns">Three Columns</label></li><li><input type="checkbox" id="filter-id-four-columns" value="four-columns"> <label for="filter-id-four-columns">Four Columns</label></li><li><input type="checkbox" id="filter-id-left-sidebar" value="left-sidebar"> <label for="filter-id-left-sidebar">Left Sidebar</label></li><li><input type="checkbox" id="filter-id-right-sidebar" value="right-sidebar"> <label for="filter-id-right-sidebar">Right Sidebar</label></li></ol></div><div class="filter-group wide"><h4>Features</h4><ol class="feature-group"><li><input typ
 e="checkbox" id="filter-id-accessibility-ready" value="accessibility-ready"> <label for="filter-id-accessibility-ready">Accessibility Ready</label></li><li><input type="checkbox" id="filter-id-blavatar" value="blavatar"> <label for="filter-id-blavatar">Blavatar</label></li><li><input type="checkbox" id="filter-id-buddypress" value="buddypress"> <label for="filter-id-buddypress">BuddyPress</label></li><li><input type="checkbox" id="filter-id-custom-background" value="custom-background"> <label for="filter-id-custom-background">Custom Background</label></li><li><input type="checkbox" id="filter-id-custom-colors" value="custom-colors"> <label for="filter-id-custom-colors
 ">Custom Colors</label></li><li><input type="checkbox" id="filter-id-custom-header" value="custom-header"> <label for="filter-id-custom-header">Custom Header</label></li><li><input type="checkbox" id="filter-id-custom-menu" value="custom-menu"> <label for="filter-id-custom-menu">Custom Menu</label></li><li><input type="checkbox" id="filter-id-editor-style" value="editor-style"> <label for="filter-id-editor-style">Editor Style</label></li><li><input type="checkbox" id="filter-id-featured-image-header" value="featured-image-header"> <label for="filter-id-featured-image-header">Featured Image Header</label></li><li><input type="checkbox" id="filter-id-featured-images&
 quot; value="featured-images"> <label for="filter-id-featured-images">Featured Images</label></li><li><input type="checkbox" id="filter-id-flexible-header" value="flexible-header"> <label for="filter-id-flexible-header">Flexible Header</label></li><li><input type="checkbox" id="filter-id-front-page-post-form" value="front-page-post-form"> <label for="filter-id-front-page-post-form">Front Page Posting</label></li><li><input type="checkbox" id="filter-id-full-width-template" value="full-width-template"> <label for="filter-id-full-width-template">Full Width Template</label></li><li><input type="checkbox" id="filter-id-microformats" value="microformats"> <label for="filter-id-microformats&qu
 ot;>Microformats</label></li><li><input type="checkbox" id="filter-id-post-formats" value="post-formats"> <label for="filter-id-post-formats">Post Formats</label></li><li><input type="checkbox" id="filter-id-rtl-language-support" value="rtl-language-support"> <label for="filter-id-rtl-language-support">RTL Language Support</label></li><li><input type="checkbox" id="filter-id-sticky-post" value="sticky-post"> <label for="filter-id-sticky-post">Sticky Post</label></li><li><input type="checkbox" id="filter-id-theme-options" value="theme-options"> <label for="filter-id-theme-options">Theme Options</label></li><li><input type="checkbox" id="filter-id-threaded-comments" 
 value="threaded-comments"> <label for="filter-id-threaded-comments">Threaded Comments</label></li><li><input type="checkbox" id="filter-id-translation-ready" value="translation-ready"> <label for="filter-id-translation-ready">Translation Ready</label></li></ol></div><div class="filter-group"><h4>Subject</h4><ol class="feature-group"><li><input type="checkbox" id="filter-id-holiday" value="holiday"> <label for="filter-id-holiday">Holiday</label></li><li><input type="checkbox" id="filter-id-photoblogging" value="photoblogging"> <label for="filter-id-photoblogging">Photoblogging</label></li><li><input type="checkbox" id="filter-id-seasonal" value="sea
 sonal"> <label for="filter-id-seasonal">Seasonal</label></li></ol></div>                       <div class="filtered-by">
-                                               <span>Filtering by:</span>
-                                               <div class="tags"></div>
-                                               <a href="#">Edit</a>
-                                       </div>
-                               </div>
-       </div>
-               <div class="themes">
-               <?php if ( have_posts() ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+get_header();
+?>
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        <?php while ( have_posts() ) : the_post(); ?>
-                               <?php get_template_part( 'content', get_post_format() ); ?>
-                       <?php endwhile; ?>
-               <?php else : ?>
-                       <?php get_template_part( 'content', 'none' ); ?>
-               <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<div id="themes" class="wrap">
+       <div class="wp-filter">
+               <div class="filter-count">
+                       <span class="count theme-count"></span>
</ins><span class="cx" style="display: block; padding: 0 10px">                 </div>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+               <ul class="filter-links">
+                       <li><a href="#" data-sort="featured"><?php _ex( 'Featured', 'themes' ); ?></a></li>
+                       <li><a href="#" data-sort="popular"><?php _ex( 'Popular', 'themes' ); ?></a></li>
+                       <li><a href="#" data-sort="new"><?php _ex( 'Latest', 'themes' ); ?></a></li>
+               </ul>
+
+               <a class="drawer-toggle" href="#"><?php _e( 'Feature Filter' ); ?></a>
+
+               <div class="search-form"></div>
+
+               <div class="filter-drawer">
+                       <div class="buttons">
+                               <a class="apply-filters button button-secondary" href="#"><?php _e( 'Apply Filters' ); ?><span></span></a>
+                               <a class="clear-filters button button-secondary" href="#"><?php _e( 'Clear' ); ?></a>
+                       </div>
+                       <?php foreach ( get_theme_feature_list() as $feature_name => $features ) : ?>
+                       <div class="filter-group">
+                               <h4><?php echo esc_html( $feature_name ); ?></h4>
+                               <ol class="feature-group">
+                                       <?php foreach ( $features as $feature => $feature_name ) : ?>
+                                       <li>
+                                               <input type="checkbox" id="filter-id-<?php echo esc_attr( $feature ); ?>" value="<?php echo esc_attr( $feature ); ?>" />
+                                               <label for="filter-id-<?php echo esc_attr( $feature ); ?>"><?php echo esc_html( $feature_name ); ?></label>
+                                       </li>
+                                       <?php endforeach; ?>
+                               </ol>
+                       </div>
+                       <?php endforeach; ?>
+                       <div class="filtered-by">
+                               <span><?php _e( 'Filtering by:' ); ?></span>
+                               <div class="tags"></div>
+                               <a href="#"><?php _e( 'Edit' ); ?></a>
+                       </div>
</ins><span class="cx" style="display: block; padding: 0 10px">                 </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                </div>
</del><span class="cx" style="display: block; padding: 0 10px">         </div>
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        <div class="theme-browser content-filterable">
+               <?php
+                       if ( ! is_wp_error( $themes ) ) :
+                               foreach ( $themes->themes as $theme ) :
+                                       get_template_part( 'content', 'index' );
+                               endforeach;
+                       endif;
+               ?>
+       </div>
+       <div class="theme-overlay"></div>
+
+       <p class="no-themes"><?php _e( 'No themes found. Try a different search.' ); ?></p>
+       <span class="spinner"></span>
</ins><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<?php get_footer(); ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php
+get_footer();
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesjsthemejs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js                              (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js        2014-11-21 10:04:40 UTC (rev 1001)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,42 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+( function ( $, wp ) {
+
+       _.extend( wp.themes.view.Appearance.prototype, {
+               el: '#themes .theme-browser',
+               searchContainer: ''
+       });
+
+       _.extend( wp.themes.view.Installer.prototype, {
+               el: '#themes'
+       });
+
+       _.extend( wp.themes.view.Theme.prototype, {
+               events: {
+                       'click': 'expand',
+                       'keydown': 'expand',
+                       'touchend': 'expand',
+                       'keyup': 'addFocus',
+                       'touchmove': 'preventExpand'
+               }
+       });
+
+       wp.themes.view.Preview.prototype = wp.themes.view.Details.prototype;
+
+       _.extend( wp.themes.InstallerRouter.prototype, {
+               routes: {
+                       '/:slug/': 'preview',
+                       '/browse/:sort/': 'sort',
+                       '/?upload': 'upload',
+                       '/search.php?q=:query': 'search',
+                       '': 'sort'
+               },
+
+               baseUrl: function( url ) {
+                       return '/' + url;
+               },
+
+               themePath: 'themes/',
+               browsePath: 'browse/',
+               searchPath: 'search.php?q='
+       });
+
+}( jQuery, wp ) );
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemessinglephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/single.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/single.php       2014-11-20 04:56:36 UTC (rev 1000)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/single.php 2014-11-21 10:04:40 UTC (rev 1001)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,24 +14,26 @@
</span><span class="cx" style="display: block; padding: 0 10px"> get_header(); ?>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="pagebody">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        <div class="wrapper">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <div class="wrapper">
</ins><span class="cx" style="display: block; padding: 0 10px">                 <div class="col-12">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                <div class="theme-browser">
-               TODO menu bar
-               
-               <div class="themes">
-               <?php if ( have_posts() ) : ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                 <div class="theme-browser">
+                               TODO menu bar
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                        <?php while ( have_posts() ) : the_post(); ?>
-                               <?php get_template_part( 'content', 'single' ); ?>
-                       <?php endwhile; ?>
-               <?php else : ?>
-                       <?php get_template_part( 'content', 'none' ); ?>
-               <?php endif; ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+                         <div class="themes">
+                                       <?php
+                                               if ( have_posts() ) :
+                                                       while ( have_posts() ) :
+                                                               the_post();
+
+                                                               get_template_part( 'content', 'single' );
+                                                       endwhile;
+                                               else :
+                                                       get_template_part( 'content', 'none' );
+                                               endif;
+                                       ?>
+                               </div>
+                       </div>
</ins><span class="cx" style="display: block; padding: 0 10px">                 </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                </div>
-               </div>
</del><span class="cx" style="display: block; padding: 0 10px">         </div>
</span><span class="cx" style="display: block; padding: 0 10px"> </div>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><span class="cx" style="display: block; padding: 0 10px"> <?php get_footer(); ?>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesstylecss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/style.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/style.css        2014-11-20 04:56:36 UTC (rev 1000)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/style.css  2014-11-21 10:04:40 UTC (rev 1001)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1,5 +1,5 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-Theme Name: wporg-themes2
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+Theme Name: WP.org Themes
</ins><span class="cx" style="display: block; padding: 0 10px"> Theme URI: https://wordpress.org/themes
</span><span class="cx" style="display: block; padding: 0 10px"> Author: wordpressdotorg
</span><span class="cx" style="display: block; padding: 0 10px"> Author URI: https://wordpress.org
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,8 +9,74 @@
</span><span class="cx" style="display: block; padding: 0 10px"> License URI: http://www.gnu.org/licenses/gpl-2.0.html
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+#themes {
+       font-family: 'Open Sans', sans-serif;
+}
+body {
+       background: #f1f1f1;
+}
+
+body.modal-open {
+       overflow: hidden;
+}
+
+/* Assistive text */
+.screen-reader-text {
+       clip: rect(1px, 1px, 1px, 1px);
+       position: absolute !important;
+}
+
+.screen-reader-text:focus {
+       background-color: #f1f1f1;
+       border-radius: 3px;
+       box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
+       clip: auto !important;
+       color: #21759b;
+       display: block;
+       font-size: 14px;
+       font-weight: bold;
+       height: auto;
+       line-height: normal;
+       padding: 15px 23px 14px;
+       position: absolute;
+       left: 5px;
+       top: 5px;
+       text-decoration: none;
+       width: auto;
+       z-index: 100000; /* Above WP toolbar */
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /* assorted overrides */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.wrap {
+       box-sizing: border-box;
+       margin: 0 auto;
+       max-width: 960px;
+       padding: 0 10px;
+}
+.theme-overlay .theme-wrap {
+       right: 190px;
+}
+
+.spinner {
+       background: url(/wp-admin/images/spinner.gif) no-repeat;
+       -webkit-background-size: 20px 20px;
+       background-size: 20px 20px;
+       display: none;
+       float: right;
+       opacity: 0.7;
+       filter: alpha(opacity=70);
+       width: 20px;
+       height: 20px;
+       margin: 2px 5px 0;
+}
+
+.loading-content .spinner {
+       display: block;
+       float: none;
+       margin: 40px auto 0;
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> #wordpress-org #pagebody p.intro {
</span><span class="cx" style="display: block; padding: 0 10px">        font-family: "Open Sans", Helvetica, Arial, "Liberation Sans", sans-serif;
</span><span class="cx" style="display: block; padding: 0 10px">        font-size: 25px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -20,7 +86,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">        margin: 0 !important;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.theme-overlay .theme-header .right {
+       float: left !important;
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> /* TODO copy wp-admin/css/themes.css to here */
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> /* Copied from wp-admin/css/common.css */
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -339,3 +409,55 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.wp-filter-search {
+       border: 1px solid #ddd;
+       box-shadow: inset 0 1px 2px rgba( 0, 0, 0, 0.07 );
+       background-color: #fff;
+       color: #333;
+       outline: none;
+       -webkit-transition: 0.05s border-color ease-in-out;
+       transition: 0.05s border-color ease-in-out;
+       border-radius: 0;
+       margin: 0;
+       padding: 3px 5px;
+       width: 280px;
+       font-size: 16px;
+       font-weight: 300;
+       line-height: 1.5;
+}
+
+.theme-stats {
+       border: 1px solid #eee;
+       font-size: 14px;
+       padding: 20px;
+}
+
+.theme-browser .button,
+.theme-overlay .button {
+       display: inline-block;
+       text-decoration: none;
+       font-size: 13px;
+       line-height: 26px;
+       height: 28px;
+       margin: 0;
+       padding: 0 10px 1px;
+       cursor: pointer;
+       border: 1px solid;
+       -webkit-appearance: none;
+       -webkit-border-radius: 3px;
+       border-radius: 3px;
+       white-space: nowrap;
+       -webkit-box-sizing: border-box;
+       -moz-box-sizing: border-box;
+       box-sizing: border-box;
+}
+
+.theme-browser .button-primary,
+.theme-overlay .button-primary {
+       background: #2ea2cc;
+       border-color: #0074a2;
+       -webkit-box-shadow: inset 0 1px 0 rgba( 120, 200, 230, 0.5), 0 1px 0 rgba( 0, 0, 0, 0.15 );
+       box-shadow: inset 0 1px 0 rgba( 120, 200, 230, 0.5 ), 0 1px 0 rgba( 0, 0, 0, 0.15 );
+       color: #fff;
+       text-decoration: none;
+}
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesthemejs"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/theme.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/theme.js                         (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/theme.js   2014-11-21 10:04:40 UTC (rev 1001)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,42 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+( function ( $, wp ) {
+
+       _.extend( wp.themes.view.Appearance.prototype, {
+               el: '#themes .theme-browser',
+               searchContainer: ''
+       });
+
+       _.extend( wp.themes.view.Installer.prototype, {
+               el: '#themes'
+       });
+
+       _.extend( wp.themes.view.Theme.prototype, {
+               events: {
+                       'click': 'expand',
+                       'keydown': 'expand',
+                       'touchend': 'expand',
+                       'keyup': 'addFocus',
+                       'touchmove': 'preventExpand'
+               }
+       });
+
+       wp.themes.view.Preview.prototype = wp.themes.view.Details.prototype;
+
+       _.extend( wp.themes.InstallerRouter.prototype, {
+               routes: {
+                       '/:slug/': 'preview',
+                       '/browse/:sort/': 'sort',
+                       '/?upload': 'upload',
+                       '/search.php?q=:query': 'search',
+                       '': 'sort'
+               },
+
+               baseUrl: function( url ) {
+                       return '/' + url;
+               },
+
+               themePath: 'themes/',
+               browsePath: 'browse/',
+               searchPath: 'search.php?q='
+       });
+
+}( jQuery, wp ) );
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesviewtemplatesthemepreviewphp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-preview.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-preview.php                         (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-preview.php   2014-11-21 10:04:40 UTC (rev 1001)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,44 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<script id="tmpl-theme-preview" type="text/template">
+       <div class="wp-full-overlay-sidebar">
+               <div class="wp-full-overlay-header">
+                       <a href="#" class="close-full-overlay"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></a>
+                       <a href="#" class="previous-theme"><span class="screen-reader-text"><?php _ex( 'Previous', 'Button label for a theme' ); ?></span></a>
+                       <a href="#" class="next-theme"><span class="screen-reader-text"><?php _ex( 'Next', 'Button label for a theme' ); ?></span></a>
+               </div>
+               <div class="wp-full-overlay-sidebar-content">
+                       <div class="install-theme-info">
+                               <h3 class="theme-name">{{ data.name }}</h3>
+                               <span class="theme-by"><?php printf( __( 'By %s' ), '{{ data.author }}' ); ?></span>
+
+                               <img class="theme-screenshot" src="{{ data.screenshot_url }}" alt="" />
+
+                               <div class="theme-details">
+                                       <div class="rating rating-{{ Math.round( data.rating / 10 ) * 10 }}">
+                                               <span class="one"></span>
+                                               <span class="two"></span>
+                                               <span class="three"></span>
+                                               <span class="four"></span>
+                                               <span class="five"></span>
+
+                                               <# if ( data.num_ratings ) { #>
+                                               <small class="ratings">{{ data.num_ratings }}</small>
+                                               <# } else { #>
+                                               <small class="ratings"><?php _e( 'No ratings.' ); ?></small>
+                                               <# } #>
+                                       </div>
+                                       <div class="theme-version"><?php printf( __( 'Version: %s' ), '{{ data.version }}' ); ?></div>
+                                       <div class="theme-description">{{{ data.description }}}</div>
+                               </div>
+                       </div>
+               </div>
+               <div class="wp-full-overlay-footer">
+                       <a href="#" class="collapse-sidebar" title="<?php esc_attr_e( 'Collapse Sidebar' ); ?>">
+                               <span class="collapse-sidebar-label"><?php _e( 'Collapse' ); ?></span>
+                               <span class="collapse-sidebar-arrow"></span>
+                       </a>
+               </div>
+       </div>
+       <div class="wp-full-overlay-main">
+               <iframe src="{{ data.preview_url }}" />
+       </div>
+</script>
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-preview.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesviewtemplatesthemesinglephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-single.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-single.php                          (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-single.php    2014-11-21 10:04:40 UTC (rev 1001)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,58 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<script id="tmpl-theme-single" type="text/template">
+       <div class="theme-backdrop"></div>
+       <div class="theme-wrap">
+               <div class="theme-header">
+                       <button class="left dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show previous theme' ); ?></span></button>
+                       <button class="right dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Show next theme' ); ?></span></button>
+                       <button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close overlay' ); ?></span></button>
+               </div>
+               <div class="theme-about">
+                       <div class="theme-screenshots">
+                               <# if ( data.screenshot_url ) { #>
+                               <div class="screenshot"><img src="{{ data.screenshot_url }}" alt=""/></div>
+                               <# } else { #>
+                               <div class="screenshot blank"></div>
+                               <# } #>
+                       </div>
+
+                       <div class="theme-info">
+                               <h3 class="theme-name">
+                                       {{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s' ), '{{{ data.version }}}' ); ?></span>
+                               </h3>
+                               <h4 class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.author }}}' ); ?></h4>
+
+                               <p class="theme-description">{{{ data.description }}}</p>
+
+                               <div class="rating rating-{{ Math.round( data.rating / 10 ) * 10 }}">
+                                       <span class="one"></span>
+                                       <span class="two"></span>
+                                       <span class="three"></span>
+                                       <span class="four"></span>
+                                       <span class="five"></span>
+
+                                       <p class="votes"><?php printf( __( 'Based on %s ratings.' ), '{{{ data.num_ratings }}}' ); ?></p>
+                               </div>
+
+                               <div class="theme-stats">
+                                       <div><strong><?php _e( 'Last updated:' ); ?></strong> {{ data.last_updated }}</div>
+                                       <div><strong><?php _e( 'Downloads:' ); ?></strong> {{ data.downloaded }}</div>
+                                       <div><a href="{{ data.homepage }}"><?php _e( 'Theme Homepage &raquo;' ); ?></a></div>
+                               </div>
+
+                               <# if ( data.tags ) { #>
+                               <p class="theme-tags">
+                                       <span><?php _e( 'Tags:' ); ?></span>
+                                       <# _.each( data.tags, function( tag ) { #>
+                                               {{{ tag }}}
+                                       <# }); #>
+                               </p>
+                               <# } #>
+                       </div>
+               </div>
+
+               <div class="theme-actions">
+                       <a href="" class="button button-primary"><?php _e( 'Download' ); ?></a>
+                       <a href="{{{ data.preview_url }}}" class="button button-secondary"><?php _e( 'Preview' ); ?></a>
+               </div>
+       </div>
+</script>
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-single.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span><a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgthemesviewtemplatesthemephp"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme.php                         (rev 0)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme.php   2014-11-21 10:04:40 UTC (rev 1001)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -0,0 +1,16 @@
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<script id="tmpl-theme" type="text/template">
+       <# if ( data.screenshot_url ) { #>
+       <div class="theme-screenshot">
+               <img src="{{ data.screenshot_url }}" alt="" />
+       </div>
+       <# } else { #>
+       <div class="theme-screenshot blank"></div>
+       <# } #>
+       <span class="more-details"><?php _ex( 'More Info', 'theme' ); ?></span>
+       <div class="theme-author"><?php printf( __( 'By %s' ), '{{ data.author }}' ); ?></div>
+       <h3 class="theme-name">{{ data.name }}</h3>
+
+       <div class="theme-actions">
+               <a class="button button-primary preview install-theme-preview" href="#"><?php esc_html_e( 'Download' ); ?></a>
+       </div>
+</script>
</ins><span class="cx" style="display: block; padding: 0 10px">Property changes on: sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme.php
</span><span class="cx" style="display: block; padding: 0 10px">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Added: svn:eol-style</h4></div>
<ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+native
</ins><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of property
</span></div>

</body>
</html>