<!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>[25065] trunk/src/wp-content/themes/twentyfourteen: Twenty Fourteen: change to just one footer widget area and use Masonry JS to display the widgets in columns.</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">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/25065">25065</a></dd>
<dt>Author</dt> <dd>lancewillett</dd>
<dt>Date</dt> <dd>2013-08-20 17:52:22 +0000 (Tue, 20 Aug 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Twenty Fourteen: change to just one footer widget area and use Masonry JS to display the widgets in columns. Props Frank Klein, closes <a href="http://core.trac.wordpress.org/ticket/24874">#24874</a>.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpcontentthemestwentyfourteenfooterphp">trunk/src/wp-content/themes/twentyfourteen/footer.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyfourteenfunctionsphp">trunk/src/wp-content/themes/twentyfourteen/functions.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyfourteenjsthemejs">trunk/src/wp-content/themes/twentyfourteen/js/theme.js</a></li>
<li><a href="#trunksrcwpcontentthemestwentyfourteensidebarfooterphp">trunk/src/wp-content/themes/twentyfourteen/sidebar-footer.php</a></li>
<li><a href="#trunksrcwpcontentthemestwentyfourteenstylecss">trunk/src/wp-content/themes/twentyfourteen/style.css</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpcontentthemestwentyfourteenfooterphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-content/themes/twentyfourteen/footer.php (25064 => 25065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-content/themes/twentyfourteen/footer.php    2013-08-20 17:45:18 UTC (rev 25064)
+++ trunk/src/wp-content/themes/twentyfourteen/footer.php       2013-08-20 17:52:22 UTC (rev 25065)
</span><span class="lines">@@ -11,12 +11,14 @@
</span><span class="cx"> 
</span><span class="cx">          </div><!-- #main -->
</span><span class="cx"> 
</span><del>-               <?php get_sidebar( 'footer' ); ?>
</del><span class="cx"> 
</span><span class="cx">          <footer id="colophon" class="site-footer" role="contentinfo">
</span><ins>+
+                       <?php get_sidebar( 'footer' ); ?>
+
</ins><span class="cx">                   <div class="site-info">
</span><span class="cx">                          <?php do_action( 'twentyfourteen_credits' ); ?>
</span><del>-                               <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentythirteen' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentythirteen' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentythirteen' ), 'WordPress' ); ?></a>
</del><ins>+                                <a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentyfourteen' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyfourteen' ); ?>"><?php printf( __( 'Proudly powered by %s', 'twentyfourteen' ), 'WordPress' ); ?></a>
</ins><span class="cx">                   </div><!-- .site-info -->
</span><span class="cx">          </footer><!-- #colophon -->
</span><span class="cx">  </div><!-- #page -->
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyfourteenfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-content/themes/twentyfourteen/functions.php (25064 => 25065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-content/themes/twentyfourteen/functions.php 2013-08-20 17:45:18 UTC (rev 25064)
+++ trunk/src/wp-content/themes/twentyfourteen/functions.php    2013-08-20 17:52:22 UTC (rev 25065)
</span><span class="lines">@@ -142,45 +142,13 @@
</span><span class="cx">          'after_title' => '</h1>',
</span><span class="cx">  ) );
</span><span class="cx">  register_sidebar( array(
</span><del>-               'name' => __( 'Footer Widget Area One', 'twentyfourteen' ),
</del><ins>+                'name' => __( 'Footer Widget Area', 'twentyfourteen' ),
</ins><span class="cx">           'id' => 'sidebar-3',
</span><span class="cx">          'before_widget' => '<aside id="%1$s" class="widget %2$s">',
</span><span class="cx">          'after_widget' => '</aside>',
</span><span class="cx">          'before_title' => '<h1 class="widget-title">',
</span><span class="cx">          'after_title' => '</h1>',
</span><span class="cx">  ) );
</span><del>-       register_sidebar( array(
-               'name' => __( 'Footer Widget Area Two', 'twentyfourteen' ),
-               'id' => 'sidebar-4',
-               'before_widget' => '<aside id="%1$s" class="widget %2$s">',
-               'after_widget' => '</aside>',
-               'before_title' => '<h1 class="widget-title">',
-               'after_title' => '</h1>',
-       ) );
-       register_sidebar( array(
-               'name' => __( 'Footer Widget Area Three', 'twentyfourteen' ),
-               'id' => 'sidebar-5',
-               'before_widget' => '<aside id="%1$s" class="widget %2$s">',
-               'after_widget' => '</aside>',
-               'before_title' => '<h1 class="widget-title">',
-               'after_title' => '</h1>',
-       ) );
-       register_sidebar( array(
-               'name' => __( 'Footer Widget Area Four', 'twentyfourteen' ),
-               'id' => 'sidebar-6',
-               'before_widget' => '<aside id="%1$s" class="widget %2$s">',
-               'after_widget' => '</aside>',
-               'before_title' => '<h1 class="widget-title">',
-               'after_title' => '</h1>',
-       ) );
-       register_sidebar( array(
-               'name' => __( 'Footer Widget Area Five', 'twentyfourteen' ),
-               'id' => 'sidebar-7',
-               'before_widget' => '<aside id="%1$s" class="widget %2$s">',
-               'after_widget' => '</aside>',
-               'before_title' => '<h1 class="widget-title">',
-               'after_title' => '</h1>',
-       ) );
</del><span class="cx"> }
</span><span class="cx"> add_action( 'widgets_init', 'twentyfourteen_widgets_init' );
</span><span class="cx"> 
</span><span class="lines">@@ -213,6 +181,9 @@
</span><span class="cx">  if ( is_singular() && wp_attachment_is_image() )
</span><span class="cx">          wp_enqueue_script( 'twentyfourteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20130402' );
</span><span class="cx"> 
</span><ins>+       if ( is_active_sidebar( 'sidebar-3' ) )
+               wp_enqueue_script( 'jquery-masonry' );
+
</ins><span class="cx">   wp_enqueue_script( 'twentyfourteen-theme', get_template_directory_uri() . '/js/theme.js', array( 'jquery' ), '20130820', true );
</span><span class="cx"> }
</span><span class="cx"> add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );
</span><span class="lines">@@ -331,52 +302,6 @@
</span><span class="cx"> endif;
</span><span class="cx"> 
</span><span class="cx"> /**
</span><del>- * Count the number of footer sidebars to enable dynamic classes for the footer
- *
- */
-function twentyfourteen_footer_sidebar_class() {
-       $count = 0;
-
-       if ( is_active_sidebar( 'sidebar-3' ) )
-               $count++;
-
-       if ( is_active_sidebar( 'sidebar-4' ) )
-               $count++;
-
-       if ( is_active_sidebar( 'sidebar-5' ) )
-               $count++;
-
-       if ( is_active_sidebar( 'sidebar-6' ) )
-               $count++;
-
-       if ( is_active_sidebar( 'sidebar-7' ) )
-               $count++;
-
-       $class = '';
-
-       switch ( $count ) {
-               case '1':
-                       $class = 'one';
-                       break;
-               case '2':
-                       $class = 'two';
-                       break;
-               case '3':
-                       $class = 'three';
-                       break;
-               case '4':
-                       $class = 'four';
-                       break;
-               case '5':
-                       $class = 'five';
-                       break;
-       }
-
-       if ( $class )
-               printf( 'class="%s"', $class );
-}
-
-/**
</del><span class="cx">  * Gets recent formatted posts that are not featured in FC plugin.
</span><span class="cx">  *
</span><span class="cx">  */
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyfourteenjsthemejs"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-content/themes/twentyfourteen/js/theme.js (25064 => 25065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-content/themes/twentyfourteen/js/theme.js   2013-08-20 17:45:18 UTC (rev 25064)
+++ trunk/src/wp-content/themes/twentyfourteen/js/theme.js      2013-08-20 17:52:22 UTC (rev 25065)
</span><span class="lines">@@ -125,6 +125,17 @@
</span><span class="cx">                  }
</span><span class="cx">          } );
</span><span class="cx"> 
</span><ins>+               // Arranges footer widgets vertically.
+               if ( $.isFunction( $.fn.masonry ) ) {
+
+                       $( '#footer-sidebar' ).masonry( {
+                               itemSelector: '.widget',
+                               columnWidth: 225,
+                               gutterWidth: 27,
+                               isRTL: $( 'body' ).is( '.rtl' )
+                       } );
+               }
+
</ins><span class="cx">   } );
</span><span class="cx"> 
</span><span class="cx"> } )( jQuery );
</span><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyfourteensidebarfooterphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-content/themes/twentyfourteen/sidebar-footer.php (25064 => 25065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-content/themes/twentyfourteen/sidebar-footer.php    2013-08-20 17:45:18 UTC (rev 25064)
+++ trunk/src/wp-content/themes/twentyfourteen/sidebar-footer.php       2013-08-20 17:52:22 UTC (rev 25065)
</span><span class="lines">@@ -1,47 +1,21 @@
</span><span class="cx"> <?php
</span><span class="cx"> /**
</span><del>- * The Sidebar containing the main widget areas.
</del><ins>+ * The Sidebar containing the main widget area.
</ins><span class="cx">  *
</span><span class="cx">  * @package WordPress
</span><span class="cx">  * @subpackage Twenty_Fourteen
</span><span class="cx">  */
</span><span class="cx"> ?>
</span><span class="cx"> <?php
</span><del>-       if (   ! is_active_sidebar( 'sidebar-3' )
-               && ! is_active_sidebar( 'sidebar-4' )
-               && ! is_active_sidebar( 'sidebar-5' )
-               && ! is_active_sidebar( 'sidebar-6' )
-               && ! is_active_sidebar( 'sidebar-7' )
-       )
-               return;
</del><ins>+if (   ! is_active_sidebar( 'sidebar-3' ) )
+       return;
</ins><span class="cx"> ?>
</span><del>-<div id="supplementary" <?php twentyfourteen_footer_sidebar_class(); ?>>
</del><ins>+<div id="supplementary">
+
</ins><span class="cx">   <?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
</span><del>-       <div id="footer-sidebar-one" class="widget-area" role="complementary">
</del><ins>+        <div id="footer-sidebar" class="widget-area" role="complementary">
</ins><span class="cx">           <?php dynamic_sidebar( 'sidebar-3' ); ?>
</span><del>-       </div><!-- #first .widget-area -->
</del><ins>+        </div><!-- #footer-sidebar -->
</ins><span class="cx">   <?php endif; ?>
</span><span class="cx"> 
</span><del>-       <?php if ( is_active_sidebar( 'sidebar-4' ) ) : ?>
-       <div id="footer-sidebar-two" class="widget-area" role="complementary">
-               <?php dynamic_sidebar( 'sidebar-4' ); ?>
-       </div><!-- #second .widget-area -->
-       <?php endif; ?>
-
-       <?php if ( is_active_sidebar( 'sidebar-5' ) ) : ?>
-       <div id="footer-sidebar-three" class="widget-area" role="complementary">
-               <?php dynamic_sidebar( 'sidebar-5' ); ?>
-       </div><!-- #third .widget-area -->
-       <?php endif; ?>
-
-       <?php if ( is_active_sidebar( 'sidebar-6' ) ) : ?>
-       <div id="footer-sidebar-four" class="widget-area" role="complementary">
-               <?php dynamic_sidebar( 'sidebar-6' ); ?>
-       </div><!-- #fourth .widget-area -->
-       <?php endif; ?>
-       <?php if ( is_active_sidebar( 'sidebar-7' ) ) : ?>
-       <div id="footer-sidebar-five" class="widget-area" role="complementary">
-               <?php dynamic_sidebar( 'sidebar-7' ); ?>
-       </div><!-- #fourth .widget-area -->
-       <?php endif; ?>
</del><span class="cx"> </div><!-- #supplementary -->
</span></span></pre></div>
<a id="trunksrcwpcontentthemestwentyfourteenstylecss"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-content/themes/twentyfourteen/style.css (25064 => 25065)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-content/themes/twentyfourteen/style.css     2013-08-20 17:45:18 UTC (rev 25064)
+++ trunk/src/wp-content/themes/twentyfourteen/style.css        2013-08-20 17:52:22 UTC (rev 25065)
</span><span class="lines">@@ -2339,10 +2339,15 @@
</span><span class="cx"> /* =Footer Sidebar
</span><span class="cx"> ----------------------------------------------- */
</span><span class="cx"> 
</span><del>-#supplementary .widget-area {
</del><ins>+.site-footer .widget-area {
</ins><span class="cx">   -moz-box-sizing: border-box;
</span><span class="cx">  box-sizing: border-box;
</span><span class="cx"> }
</span><ins>+.site-footer .widget {
+       float: left;
+       padding-left: 27px;
+       width: 198px;
+}
</ins><span class="cx"> 
</span><span class="cx"> /* =Media Queries
</span><span class="cx"> ----------------------------------------------- */
</span><span class="lines">@@ -2996,26 +3001,7 @@
</span><span class="cx">          padding-right: 0;
</span><span class="cx">          padding-left: 0;
</span><span class="cx">  }
</span><del>-       #supplementary .widget-area {
-               float: left;
-               padding: 0 27px;
-               padding: 0 2.7rem;
-       }
-       #supplementary.one .widget-area {
-               width: 100%;
-       }
-       #supplementary.two .widget-area {
-               width: 50%;
-       }
-       #supplementary.three .widget-area {
-               width: 33.33333333%;
-       }
-       #supplementary.four .widget-area {
-               width: 25%;
-       }
-       #supplementary.five .widget-area {
-               width: 20%;
-       }
</del><ins>+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @media screen and (min-width: 1150px) {
</span></span></pre>
</div>
</div>

</body>
</html>