<!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>[1196] sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer: developer.wordpress.org: Add 'Used By' and 'Uses' sections to parsed content permalink pages.</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/1196">1196</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/1196","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>coffee2code</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-01-27 00:39:51 +0000 (Tue, 27 Jan 2015)</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'>developer.wordpress.org: Add 'Used By' and 'Uses' sections to parsed content permalink pages.

Basically the UI surfacing of the P2P relationships.

Fixes <a href="http://meta.trac.wordpress.org/ticket/323">#323</a>.
Props atimmer.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdevelopercontentreferencearchivephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-reference-archive.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdevelopercontentreferencephp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-reference.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperinctemplatetagsphp">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperjsfunctionreferencejs">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/function-reference.js</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperscssmainscss">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss</a></li>
<li><a href="#sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperstylesheetsmaincss">sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdevelopercontentreferencearchivephp"></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-developer/content-reference-archive.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-developer/content-reference-archive.php 2015-01-27 00:31:29 UTC (rev 1195)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-reference-archive.php   2015-01-27 00:39:51 UTC (rev 1196)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,4 +17,21 @@
</span><span class="cx" style="display: block; padding: 0 10px">                <p>Source: <?php echo get_source_file(); ?>:<?php echo get_line_number(); ?></p>
</span><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">-</article>
</del><span class="cx" style="display: block; padding: 0 10px">\ No newline at end of file
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        <?php
+               $used_by = get_used_by()->post_count;
+               $uses    = get_uses()->post_count;
+       ?>
+       <div class="meta">
+               <?php printf(
+                       _n( 'Used by <a href="%s">1 function</a>', 'Used by <a href="%s">%d function</a>', $used_by, 'wporg' ),
+                       esc_url( apply_filters( 'the_permalink', get_permalink() ) ) . '#usage',
+                       $used_by
+               ); ?>
+               |
+               <?php printf(
+                       _n( 'Uses <a href="%s">1 function</a>', 'Used by <a href="%s">%d function</a>', $uses, 'wporg' ),
+                       esc_url( apply_filters( 'the_permalink', get_permalink() ) ) . '#usage',
+                       $uses
+               ); ?>
+       </div>
+</article>
</ins></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdevelopercontentreferencephp"></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-developer/content-reference.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-developer/content-reference.php 2015-01-27 00:31:29 UTC (rev 1195)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/content-reference.php   2015-01-27 00:39:51 UTC (rev 1196)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -44,12 +44,6 @@
</span><span class="cx" style="display: block; padding: 0 10px">                </section>
</span><span class="cx" style="display: block; padding: 0 10px">        <?php endif; ?>
</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 /*
-       <?php if ( is_archive() ) : ?>
-       <section class="meta">Used by TODO | Uses TODO | TODO Examples</section>
-       <?php endif; ?>
-       */ ?>
-
</del><span class="cx" style="display: block; padding: 0 10px">         <?php if ( $params = get_params() ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px">        <hr/>
</span><span class="cx" style="display: block; padding: 0 10px">        <section class="parameters">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -129,6 +123,50 @@
</span><span class="cx" style="display: block; padding: 0 10px">                <?php endif;
</span><span class="cx" style="display: block; padding: 0 10px">        endif; ?>
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        <?php if ( show_usage_info() ) : ?>
+               <hr id="usage" />
+               <section class="usage">
+                       <article class="used-by">
+                               <h2><?php _e( 'Used by', 'wporg' ); ?></h2>
+                               <ul>
+                                       <?php
+                                               $used_by = get_used_by();
+                                               while ( $used_by->have_posts() ) : $used_by->the_post();
+                                                       ?>
+                                                       <li>
+                                                               <span><?php echo esc_attr( get_source_file() ); ?>:</span>
+                                                               <a href="<?php the_permalink(); ?>"><?php the_title(); ?><?php if ( 'wp-parser-hook' !== get_post_type() ) : ?>()<?php endif; ?></a>
+                                                       </li>
+                                               <?php endwhile; wp_reset_postdata(); ?>
+                                               <?php if ( $used_by->post_count > 5 ) : ?>
+                                                       <a href="#" class="show-more"><?php printf( _n( 'Show 1 more used by', 'Show %d more used by', $used_by->post_count, 'wporg' ), $used_by->post_count ); ?></a>
+                                                       <a href="#" class="hide-more"><?php _e( 'Hide more used by', 'wporg' ); ?></a>
+                                               <?php endif; ?>
+                               </ul>
+                       </article>
+                       <?php if ( post_type_has_uses_info() ) : ?>
+                               <article class="uses">
+                                       <h2><?php _e( 'Uses', 'wporg' ); ?></h2>
+                                       <ul>
+                                               <?php
+                                               $uses = get_uses();
+                                               while ( $uses->have_posts() ) : $uses->the_post()
+                                                       ?>
+                                                       <li>
+                                                               <span><?php echo esc_attr( get_source_file() ); ?>:</span>
+                                                               <a href="<?php the_permalink(); ?>"><?php the_title(); ?><?php if ( 'wp-parser-hook' !== get_post_type() ) : ?>()<?php endif; ?></a>
+                                                       </li>
+                                               <?php endwhile; wp_reset_postdata(); ?>
+                                               <?php if ( $uses->post_count > 5 ) : ?>
+                                                       <a href="#" class="show-more"><?php printf( _n( 'Show 1 more use', 'Show %d more uses', $uses->post_count, 'wporg' ), $uses->post_count ); ?></a>
+                                                       <a href="#" class="hide-more"><?php _e( 'Hide more uses', 'wporg' ); ?></a>
+                                               <?php endif; ?>
+                                       </ul>
+                               </article>
+                       <?php endif; ?>
+               </section>
+       <?php endif; ?>
+
</ins><span class="cx" style="display: block; padding: 0 10px">         <?php if ( post_type_has_source_code() ) : ?>
</span><span class="cx" style="display: block; padding: 0 10px">                <hr />
</span><span class="cx" style="display: block; padding: 0 10px">                <a id="source-code"></a>
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperinctemplatetagsphp"></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-developer/inc/template-tags.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-developer/inc/template-tags.php 2015-01-27 00:31:29 UTC (rev 1195)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php   2015-01-27 00:39:51 UTC (rev 1196)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -897,7 +897,97 @@
</span><span class="cx" style="display: block; padding: 0 10px">                return strcmp( $a->post_name, $b->post_name );
</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">+        function show_usage_info() {
+               $p2p_enabled = function_exists( 'p2p_register_connection_type' );
+
+               return $p2p_enabled && post_type_has_usage_info( get_post_type() );
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">         /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         * Does the post type support usage information?
+        *
+        * @param string $post_type Optional. The post type name. If blank, assumes current post type.
+        *
+        * @return boolean
+        */
+       function post_type_has_usage_info( $post_type = null ) {
+               $post_type             = $post_type ? $post_type : get_post_type();
+               $post_types_with_usage = array( 'wp-parser-function', 'wp-parser-method', 'wp-parser-hook' );
+
+               return in_array( $post_type, $post_types_with_usage );
+       }
+
+       /**
+        * Does the post type support uses information?
+        *
+        * @param string $post_type Optional. The post type name. If blank, assumes current post type.
+        *
+        * @return boolean
+        */
+       function post_type_has_uses_info( $post_type = null ) {
+               $post_type             = $post_type ? $post_type : get_post_type();
+               $post_types_with_uses  = array( 'wp-parser-function', 'wp-parser-method' );
+
+               return in_array( $post_type, $post_types_with_uses );
+       }
+
+       /**
+        * Retrieve a WP_Query object for the posts that the current post uses
+        *
+        * @return WP_Query A WP_Query object for the posts the current post uses
+        */
+       function get_uses() {
+
+               if ( 'wp-parser-function' === get_post_type() ) {
+                       $connection_types = array( 'functions_to_functions', 'functions_to_methods', 'functions_to_hooks' );
+               } else {
+                       $connection_types = array( 'methods_to_functions', 'methods_to_methods', 'methods_to_hooks' );
+               }
+
+               $connected = new \WP_Query( array(
+                       'post_type'           => array( 'wp-parser-function', 'wp-parser-method', 'wp-parser-hook' ),
+                       'connected_type'      => $connection_types,
+                       'connected_direction' => array( 'from', 'from', 'from' ),
+                       'connected_items'     => get_the_ID(),
+                       'nopaging'            => true,
+               ) );
+
+               return $connected;
+       }
+
+       function get_used_by( $post_id = null ) {
+
+               if ( empty( $post_id ) ) {
+                       $post_id = get_the_ID();
+               }
+
+               switch ( get_post_type() ) {
+
+                       case 'wp-parser-function':
+                               $connection_types = array( 'functions_to_functions', 'methods_to_functions' );
+                               break;
+
+                       case 'wp-parser-method':
+                               $connection_types = array( 'functions_to_methods', 'methods_to_methods', );
+                               break;
+
+                       case 'wp-parser-hook':
+                               $connection_types = array( 'functions_to_hooks', 'methods_to_hooks' );
+                               break;
+               }
+
+               $connected = new \WP_Query( array(
+                       'post_type'           => array( 'wp-parser-function', 'wp-parser-method' ),
+                       'connected_type'      => $connection_types,
+                       'connected_direction' => array( 'to', 'to' ),
+                       'connected_items'     => $post_id,
+                       'nopaging'            => true,
+               ) );
+
+               return $connected;
+       }
+
+       /**
</ins><span class="cx" style="display: block; padding: 0 10px">          * Does the post type have source code?
</span><span class="cx" style="display: block; padding: 0 10px">         *
</span><span class="cx" style="display: block; padding: 0 10px">         * @param  null|string $post_type Optional. The post type name. If null, assumes current post type. Default null.
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperjsfunctionreferencejs"></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-developer/js/function-reference.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-developer/js/function-reference.js      2015-01-27 00:31:29 UTC (rev 1195)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/function-reference.js        2015-01-27 00:39:51 UTC (rev 1196)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4,26 +4,25 @@
</span><span class="cx" style="display: block; padding: 0 10px">  * Handles all interactivity on the single function page
</span><span class="cx" style="display: block; padding: 0 10px">  */
</span><span class="cx" style="display: block; padding: 0 10px"> ( function( $ ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        'use strict';
+
</ins><span class="cx" style="display: block; padding: 0 10px">         var $sourceContent, $sourceCodeContainer, $sourceCodeTable, $showCompleteSource, $lessCompleteSource, sourceCollapsedHeight;
</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 toggleCompleteSource( e ) {
-               e.preventDefault();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ var $usesList, $usedByList, $showMoreUses, $hideMoreUses, $showMoreUsedBy, $hideMoreUsedBy;
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                if ( $showCompleteSource.is(':visible') ) {
-                       var heightGoal = $sourceCodeTable.height() + 45; // takes into consideration potential x-scrollbar
-               } else {
-                       var heightGoal = sourceCollapsedHeight;
-               }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function onLoad() {
+               sourceCodeHighlightInit();
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $sourceCodeContainer.animate( { height: heightGoal + 'px' } );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         toggleUsageListInit();
+       }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-                $showCompleteSource.toggle();
-               $lessCompleteSource.toggle();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function sourceCodeHighlightInit() {
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        }
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+         // We require the SyntaxHighlighter javascript library
+               if ( undefined === window.SyntaxHighlighter ) {
+                       return;
+               }
</ins><span class="cx" style="display: block; padding: 0 10px"> 
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-        function onLoad() {
-
</del><span class="cx" style="display: block; padding: 0 10px">                 // We only expect one source-content per document
</span><span class="cx" style="display: block; padding: 0 10px">                $sourceContent = $( '.source-content' );
</span><span class="cx" style="display: block; padding: 0 10px">                $sourceCodeContainer = $( '.source-code-container' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -49,8 +48,62 @@
</span><span class="cx" style="display: block; padding: 0 10px">                        $showCompleteSource.on( 'click', toggleCompleteSource );
</span><span class="cx" style="display: block; padding: 0 10px">                        $lessCompleteSource.on( 'click', toggleCompleteSource );
</span><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"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+        function toggleCompleteSource( e ) {
+               e.preventDefault();
+
+               if ( $showCompleteSource.is(':visible') ) {
+                       var heightGoal = $sourceCodeTable.height() + 45; // takes into consideration potential x-scrollbar
+               } else {
+                       var heightGoal = sourceCollapsedHeight;
+               }
+
+               $sourceCodeContainer.animate( { height: heightGoal + 'px' } );
+
+               $showCompleteSource.toggle();
+               $lessCompleteSource.toggle();
+
</ins><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">+        function toggleUsageListInit() {
+
+               // We only expect one used_by and uses per document
+               $usedByList = $( '.used-by' ).find( 'li' );
+               $usesList   = $( '.uses' ).find( 'li' );
+
+               if ( $usedByList.length > 5 ) {
+                       $usedByList = $usedByList.slice( 5 ).hide();
+
+                       $showMoreUsedBy = $( '.used-by .show-more' ).show().on( 'click', toggleMoreUsedBy );
+                       $hideMoreUsedBy = $( '.used-by .hide-more' ).on( 'click', toggleMoreUsedBy );
+               }
+
+               if ( $usesList.length > 5 ) {
+                       $usesList = $usesList.slice( 5 ).hide();
+
+                       $showMoreUses = $( '.uses .show-more' ).show().on( 'click', toggleMoreUses );
+                       $hideMoreUses = $( '.uses .hide-more' ).on( 'click', toggleMoreUses );
+               }
+       }
+
+       function toggleMoreUses( e ) {
+               e.preventDefault();
+
+               $usesList.toggle();
+
+               $showMoreUses.toggle();
+               $hideMoreUses.toggle();
+       }
+
+       function toggleMoreUsedBy( e ) {
+               e.preventDefault();
+
+               $usedByList.toggle();
+
+               $showMoreUsedBy.toggle();
+               $hideMoreUsedBy.toggle();
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">         $( onLoad );
</span><span class="cx" style="display: block; padding: 0 10px"> } )( jQuery );
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperscssmainscss"></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-developer/scss/main.scss</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-developer/scss/main.scss        2015-01-27 00:31:29 UTC (rev 1195)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss  2015-01-27 00:39:51 UTC (rev 1196)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -466,6 +466,10 @@
</span><span class="cx" style="display: block; padding: 0 10px">         * section styles
</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">+        section {
+               overflow: auto;
+       }
+
</ins><span class="cx" style="display: block; padding: 0 10px">         .home-landing .section {
</span><span class="cx" style="display: block; padding: 0 10px">                padding: 30px 0%;
</span><span class="cx" style="display: block; padding: 0 10px">                padding: 3rem 0%;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -922,6 +926,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="cx" style="display: block; padding: 0 10px">        .wp-parser-class, .wp-parser-function, .wp-parser-hook, .wp-parser-method {
</span><span class="cx" style="display: block; padding: 0 10px">                border-bottom: 1px solid #dfdfdf;
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px">                 h1 {
</span><span class="cx" style="display: block; padding: 0 10px">                        margin: 24px 0;
</span><span class="cx" style="display: block; padding: 0 10px">                        padding-left: 100px;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1012,6 +1017,34 @@
</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">+        /* = Usage
+       ----------------------------------------------- */
+       .usage {
+               article {
+                       float: left;
+                       width: 50%;
+               }
+
+               .used-by {
+                       padding-right: 30px;
+               }
+
+               .uses {
+                       padding-left: 30px;
+               }
+
+               ul {
+                       line-height: 1.7; /* Slightly increase the line height for more readability */
+                       list-style-type: none;
+                       margin: 0;
+               }
+
+               .show-more, .hide-more {
+                       display: none;
+               }
+       }
+
+
</ins><span class="cx" style="display: block; padding: 0 10px">         .source-content {
</span><span class="cx" style="display: block; padding: 0 10px">                overflow: auto;
</span><span class="cx" style="display: block; padding: 0 10px">        }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1302,9 +1335,35 @@
</span><span class="cx" style="display: block; padding: 0 10px">                .site-branding .site-title {
</span><span class="cx" style="display: block; padding: 0 10px">                        padding-left: 0;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+               &.archive, &.search {
+                       .meta {
+                               font-size: 100%;
+                               margin-bottom: 1.5em;
+
+                               a {
+                                       color: #21759b;
+                               }
+                       }
+               }
</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"> }
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+@media ( min-width: 43em ) {
+       .devhub-wrap {
+               &.archive, &.search {
+                       .meta {
+                               float: right;
+                       }
+
+                       .sourcefile {
+                               float: left;
+                       }
+               }
+       }
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> @media ( max-width: 43em ) {
</span><span class="cx" style="display: block; padding: 0 10px"> 
</span><span class="cx" style="display: block; padding: 0 10px">        #content-area.has-sidebar {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1389,5 +1448,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">                .two-columns .box {
</span><span class="cx" style="display: block; padding: 0 10px">                        width: 99%;
</span><span class="cx" style="display: block; padding: 0 10px">                }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+               .usage {
+                       article {
+                               width: 100%;
+                       }
+               }
</ins><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">\ No newline at end of file
</span></span></pre></div>
<a id="sitestrunkwordpressorgpublic_htmlwpcontentthemespubwporgdeveloperstylesheetsmaincss"></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-developer/stylesheets/main.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-developer/stylesheets/main.css  2015-01-27 00:31:29 UTC (rev 1195)
+++ sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css    2015-01-27 00:39:51 UTC (rev 1196)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -298,6 +298,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">   /*
</span><span class="cx" style="display: block; padding: 0 10px">    * section styles
</span><span class="cx" style="display: block; padding: 0 10px">    */
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  /* = Usage
+  ----------------------------------------------- */
</ins><span class="cx" style="display: block; padding: 0 10px">   /* Comments */
</span><span class="cx" style="display: block; padding: 0 10px">   /*
</span><span class="cx" style="display: block; padding: 0 10px">    * Content
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -726,6 +728,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">   text-decoration: none;
</span><span class="cx" style="display: block; padding: 0 10px">   color: #606060;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.devhub-wrap section {
+  overflow: auto;
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> .devhub-wrap .home-landing .section {
</span><span class="cx" style="display: block; padding: 0 10px">   padding: 30px 0%;
</span><span class="cx" style="display: block; padding: 0 10px">   padding: 3rem 0%;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1202,6 +1207,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> .devhub-wrap .single .wp-parser-class, .devhub-wrap .single .wp-parser-function, .devhub-wrap .single .wp-parser-hook, .devhub-wrap .single .wp-parser-method {
</span><span class="cx" style="display: block; padding: 0 10px">   border-bottom-style: none;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+.devhub-wrap .usage article {
+  float: left;
+  width: 50%;
+}
+.devhub-wrap .usage .used-by {
+  padding-right: 30px;
+}
+.devhub-wrap .usage .uses {
+  padding-left: 30px;
+}
+.devhub-wrap .usage ul {
+  line-height: 1.7;
+  /* Slightly increase the line height for more readability */
+  list-style-type: none;
+  margin: 0;
+}
+.devhub-wrap .usage .show-more, .devhub-wrap .usage .hide-more {
+  display: none;
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> .devhub-wrap .source-content {
</span><span class="cx" style="display: block; padding: 0 10px">   overflow: auto;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1424,7 +1448,22 @@
</span><span class="cx" style="display: block; padding: 0 10px">   .devhub-wrap .site-branding .site-title {
</span><span class="cx" style="display: block; padding: 0 10px">     padding-left: 0;
</span><span class="cx" style="display: block; padding: 0 10px">   }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  .devhub-wrap.archive .meta, .devhub-wrap.search .meta {
+    font-size: 100%;
+    margin-bottom: 1.5em;
+  }
+  .devhub-wrap.archive .meta a, .devhub-wrap.search .meta a {
+    color: #21759b;
+  }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+@media (min-width: 43em) {
+  .devhub-wrap.archive .meta, .devhub-wrap.search .meta {
+    float: right;
+  }
+  .devhub-wrap.archive .sourcefile, .devhub-wrap.search .sourcefile {
+    float: left;
+  }
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> @media (max-width: 43em) {
</span><span class="cx" style="display: block; padding: 0 10px">   #content-area.has-sidebar main {
</span><span class="cx" style="display: block; padding: 0 10px">     float: right;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1497,4 +1536,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">   .devhub-wrap .two-columns .box {
</span><span class="cx" style="display: block; padding: 0 10px">     width: 99%;
</span><span class="cx" style="display: block; padding: 0 10px">   }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+  .devhub-wrap .usage article {
+    width: 100%;
+  }
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre>
</div>
</div>

</body>
</html>