<!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>[20060] trunk: Introduce jQuery Masonry.</title>
</head>
<body>

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

<h3>Log Message</h3>
<pre>Introduce jQuery Masonry. Use it to arrange header thumbnails on custom header screen. Props aaroncampbell. fixes <a href="http://core.trac.wordpress.org/ticket/17242">#17242</a></pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmincustomheaderphp">trunk/wp-admin/custom-header.php</a></li>
<li><a href="#trunkwpincludesscriptloaderphp">trunk/wp-includes/script-loader.php</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpincludesjsjqueryjquerymasonrydevjs">trunk/wp-includes/js/jquery/jquery.masonry.dev.js</a></li>
<li><a href="#trunkwpincludesjsjqueryjquerymasonryjs">trunk/wp-includes/js/jquery/jquery.masonry.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmincustomheaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/custom-header.php (20059 => 20060)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/custom-header.php        2012-03-01 00:18:26 UTC (rev 20059)
+++ trunk/wp-admin/custom-header.php        2012-03-01 18:57:28 UTC (rev 20060)
</span><span class="lines">@@ -140,6 +140,8 @@
</span><span class="cx">         function js_includes() {
</span><span class="cx">                 $step = $this-&gt;step();
</span><span class="cx"> 
</span><ins>+                if ( 1 == $step )
+                        wp_enqueue_script('jquery-masonry');
</ins><span class="cx">                 if ( ( 1 == $step || 3 == $step ) &amp;&amp; $this-&gt;header_text() )
</span><span class="cx">                         wp_enqueue_script('farbtastic');
</span><span class="cx">                 elseif ( 2 == $step )
</span><span class="lines">@@ -637,7 +639,13 @@
</span><span class="cx">         &lt;?php endif; ?&gt;
</span><span class="cx"> &lt;/tbody&gt;
</span><span class="cx"> &lt;/table&gt;
</span><del>-
</del><ins>+&lt;script type=&quot;text/javascript&quot;&gt;
+jQuery(function() {
+        jQuery('.available-headers').masonry({
+                itemSelector: '.default-header'
+        });
+});
+&lt;/script&gt;
</ins><span class="cx">         &lt;?php if ( $this-&gt;header_text() ) : ?&gt;
</span><span class="cx"> &lt;table class=&quot;form-table&quot;&gt;
</span><span class="cx"> &lt;tbody&gt;
</span></span></pre></div>
<a id="trunkwpincludesjsjqueryjquerymasonrydevjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/jquery/jquery.masonry.dev.js (0 => 20060)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/jquery/jquery.masonry.dev.js                                (rev 0)
+++ trunk/wp-includes/js/jquery/jquery.masonry.dev.js        2012-03-01 18:57:28 UTC (rev 20060)
</span><span class="lines">@@ -0,0 +1,494 @@
</span><ins>+/**
+ * jQuery Masonry v2.1.02
+ * A dynamic layout plugin for jQuery
+ * The flip-side of CSS Floats
+ * http://masonry.desandro.com
+ *
+ * Licensed under the MIT license.
+ * Copyright 2011 David DeSandro
+ */
+
+(function( window, $, undefined ){
+
+  /*
+   * smartresize: debounced resize event for jQuery
+   *
+   * latest version and complete README available on Github:
+   * https://github.com/louisremi/jquery.smartresize.js
+   *
+   * Copyright 2011 @louis_remi
+   * Licensed under the MIT license.
+   */
+
+  var $event = $.event,
+      resizeTimeout;
+
+  $event.special.smartresize = {
+    setup: function() {
+      $(this).bind( &quot;resize&quot;, $event.special.smartresize.handler );
+    },
+    teardown: function() {
+      $(this).unbind( &quot;resize&quot;, $event.special.smartresize.handler );
+    },
+    handler: function( event, execAsap ) {
+      // Save the context
+      var context = this,
+          args = arguments;
+
+      // set correct event type
+      event.type = &quot;smartresize&quot;;
+
+      if ( resizeTimeout ) { clearTimeout( resizeTimeout ); }
+      resizeTimeout = setTimeout(function() {
+        jQuery.event.handle.apply( context, args );
+      }, execAsap === &quot;execAsap&quot;? 0 : 100 );
+    }
+  };
+
+  $.fn.smartresize = function( fn ) {
+    return fn ? this.bind( &quot;smartresize&quot;, fn ) : this.trigger( &quot;smartresize&quot;, [&quot;execAsap&quot;] );
+  };
+
+
+
+// ========================= Masonry ===============================
+
+
+  // our &quot;Widget&quot; object constructor
+  $.Mason = function( options, element ){
+    this.element = $( element );
+
+    this._create( options );
+    this._init();
+  };
+
+  $.Mason.settings = {
+    isResizable: true,
+    isAnimated: false,
+    animationOptions: {
+      queue: false,
+      duration: 500
+    },
+    gutterWidth: 0,
+    isRTL: false,
+    isFitWidth: false,
+    containerStyle: {
+      position: 'relative'
+    }
+  };
+
+  $.Mason.prototype = {
+
+    _filterFindBricks: function( $elems ) {
+      var selector = this.options.itemSelector;
+      // if there is a selector
+      // filter/find appropriate item elements
+      return !selector ? $elems : $elems.filter( selector ).add( $elems.find( selector ) );
+    },
+
+    _getBricks: function( $elems ) {
+      var $bricks = this._filterFindBricks( $elems )
+        .css({ position: 'absolute' })
+        .addClass('masonry-brick');
+      return $bricks;
+    },
+
+    // sets up widget
+    _create : function( options ) {
+
+      this.options = $.extend( true, {}, $.Mason.settings, options );
+      this.styleQueue = [];
+
+      // get original styles in case we re-apply them in .destroy()
+      var elemStyle = this.element[0].style;
+      this.originalStyle = {
+        // get height
+        height: elemStyle.height || ''
+      };
+      // get other styles that will be overwritten
+      var containerStyle = this.options.containerStyle;
+      for ( var prop in containerStyle ) {
+        this.originalStyle[ prop ] = elemStyle[ prop ] || '';
+      }
+
+      this.element.css( containerStyle );
+
+      this.horizontalDirection = this.options.isRTL ? 'right' : 'left';
+
+      this.offset = {
+        x: parseInt( this.element.css( 'padding-' + this.horizontalDirection ), 10 ),
+        y: parseInt( this.element.css( 'padding-top' ), 10 )
+      };
+
+      this.isFluid = this.options.columnWidth &amp;&amp; typeof this.options.columnWidth === 'function';
+
+      // add masonry class first time around
+      var instance = this;
+      setTimeout( function() {
+        instance.element.addClass('masonry');
+      }, 0 );
+
+      // bind resize method
+      if ( this.options.isResizable ) {
+        $(window).bind( 'smartresize.masonry', function() {
+          instance.resize();
+        });
+      }
+
+
+      // need to get bricks
+      this.reloadItems();
+
+    },
+
+    // _init fires when instance is first created
+    // and when instance is triggered again -&gt; $el.masonry();
+    _init : function( callback ) {
+      this._getColumns();
+      this._reLayout( callback );
+    },
+
+    option: function( key, value ){
+      // set options AFTER initialization:
+      // signature: $('#foo').bar({ cool:false });
+      if ( $.isPlainObject( key ) ){
+        this.options = $.extend(true, this.options, key);
+      }
+    },
+
+    // ====================== General Layout ======================
+
+    // used on collection of atoms (should be filtered, and sorted before )
+    // accepts atoms-to-be-laid-out to start with
+    layout : function( $bricks, callback ) {
+
+      // place each brick
+      for (var i=0, len = $bricks.length; i &lt; len; i++) {
+        this._placeBrick( $bricks[i] );
+      }
+
+      // set the size of the container
+      var containerSize = {};
+      containerSize.height = Math.max.apply( Math, this.colYs );
+      if ( this.options.isFitWidth ) {
+        var unusedCols = 0,
+            i = this.cols;
+        // count unused columns
+        while ( --i ) {
+          if ( this.colYs[i] !== 0 ) {
+            break;
+          }
+          unusedCols++;
+        }
+        // fit container to columns that have been used;
+        containerSize.width = (this.cols - unusedCols) * this.columnWidth - this.options.gutterWidth;
+      }
+      this.styleQueue.push({ $el: this.element, style: containerSize });
+
+      // are we animating the layout arrangement?
+      // use plugin-ish syntax for css or animate
+      var styleFn = !this.isLaidOut ? 'css' : (
+            this.options.isAnimated ? 'animate' : 'css'
+          ),
+          animOpts = this.options.animationOptions;
+
+      // process styleQueue
+      var obj;
+      for (i=0, len = this.styleQueue.length; i &lt; len; i++) {
+        obj = this.styleQueue[i];
+        obj.$el[ styleFn ]( obj.style, animOpts );
+      }
+
+      // clear out queue for next time
+      this.styleQueue = [];
+
+      // provide $elems as context for the callback
+      if ( callback ) {
+        callback.call( $bricks );
+      }
+
+      this.isLaidOut = true;
+    },
+
+    // calculates number of columns
+    // i.e. this.columnWidth = 200
+    _getColumns : function() {
+      var container = this.options.isFitWidth ? this.element.parent() : this.element,
+          containerWidth = container.width();
+
+                         // use fluid columnWidth function if there
+      this.columnWidth = this.isFluid ? this.options.columnWidth( containerWidth ) :
+                    // if not, how about the explicitly set option?
+                    this.options.columnWidth ||
+                    // or use the size of the first item
+                    this.$bricks.outerWidth(true) ||
+                    // if there's no items, use size of container
+                    containerWidth;
+
+      this.columnWidth += this.options.gutterWidth;
+
+      this.cols = Math.floor( ( containerWidth + this.options.gutterWidth ) / this.columnWidth );
+      this.cols = Math.max( this.cols, 1 );
+
+    },
+
+    // layout logic
+    _placeBrick: function( brick ) {
+      var $brick = $(brick),
+          colSpan, groupCount, groupY, groupColY, j;
+
+      //how many columns does this brick span
+      colSpan = Math.ceil( $brick.outerWidth(true) /
+        ( this.columnWidth + this.options.gutterWidth ) );
+      colSpan = Math.min( colSpan, this.cols );
+
+      if ( colSpan === 1 ) {
+        // if brick spans only one column, just like singleMode
+        groupY = this.colYs
+      } else {
+        // brick spans more than one column
+        // how many different places could this brick fit horizontally
+        groupCount = this.cols + 1 - colSpan;
+        groupY = [];
+
+        // for each group potential horizontal position
+        for ( j=0; j &lt; groupCount; j++ ) {
+          // make an array of colY values for that one group
+          groupColY = this.colYs.slice( j, j+colSpan );
+          // and get the max value of the array
+          groupY[j] = Math.max.apply( Math, groupColY );
+        }
+
+      }
+
+      // get the minimum Y value from the columns
+      var minimumY = Math.min.apply( Math, groupY ),
+          shortCol = 0;
+
+      // Find index of short column, the first from the left
+      for (var i=0, len = groupY.length; i &lt; len; i++) {
+        if ( groupY[i] === minimumY ) {
+          shortCol = i;
+          break;
+        }
+      }
+
+      // position the brick
+      var position = {
+        top: minimumY + this.offset.y
+      };
+      // position.left or position.right
+      position[ this.horizontalDirection ] = this.columnWidth * shortCol + this.offset.x;
+      this.styleQueue.push({ $el: $brick, style: position });
+
+      // apply setHeight to necessary columns
+      var setHeight = minimumY + $brick.outerHeight(true),
+          setSpan = this.cols + 1 - len;
+      for ( i=0; i &lt; setSpan; i++ ) {
+        this.colYs[ shortCol + i ] = setHeight;
+      }
+
+    },
+
+
+    resize: function() {
+      var prevColCount = this.cols;
+      // get updated colCount
+      this._getColumns();
+      if ( this.isFluid || this.cols !== prevColCount ) {
+        // if column count has changed, trigger new layout
+        this._reLayout();
+      }
+    },
+
+
+    _reLayout : function( callback ) {
+      // reset columns
+      var i = this.cols;
+      this.colYs = [];
+      while (i--) {
+        this.colYs.push( 0 );
+      }
+      // apply layout logic to all bricks
+      this.layout( this.$bricks, callback );
+    },
+
+    // ====================== Convenience methods ======================
+
+    // goes through all children again and gets bricks in proper order
+    reloadItems : function() {
+      this.$bricks = this._getBricks( this.element.children() );
+    },
+
+
+    reload : function( callback ) {
+      this.reloadItems();
+      this._init( callback );
+    },
+
+
+    // convienence method for working with Infinite Scroll
+    appended : function( $content, isAnimatedFromBottom, callback ) {
+      if ( isAnimatedFromBottom ) {
+        // set new stuff to the bottom
+        this._filterFindBricks( $content ).css({ top: this.element.height() });
+        var instance = this;
+        setTimeout( function(){
+          instance._appended( $content, callback );
+        }, 1 );
+      } else {
+        this._appended( $content, callback );
+      }
+    },
+
+    _appended : function( $content, callback ) {
+      var $newBricks = this._getBricks( $content );
+      // add new bricks to brick pool
+      this.$bricks = this.$bricks.add( $newBricks );
+      this.layout( $newBricks, callback );
+    },
+
+    // removes elements from Masonry widget
+    remove : function( $content ) {
+      this.$bricks = this.$bricks.not( $content );
+      $content.remove();
+    },
+
+    // destroys widget, returns elements and container back (close) to original style
+    destroy : function() {
+
+      this.$bricks
+        .removeClass('masonry-brick')
+        .each(function(){
+          this.style.position = '';
+          this.style.top = '';
+          this.style.left = '';
+        });
+
+      // re-apply saved container styles
+      var elemStyle = this.element[0].style;
+      for ( var prop in this.originalStyle ) {
+        elemStyle[ prop ] = this.originalStyle[ prop ];
+      }
+
+      this.element
+        .unbind('.masonry')
+        .removeClass('masonry')
+        .removeData('masonry');
+
+      $(window).unbind('.masonry');
+
+    }
+
+  };
+
+
+  // ======================= imagesLoaded Plugin ===============================
+  /*!
+   * jQuery imagesLoaded plugin v1.1.0
+   * http://github.com/desandro/imagesloaded
+   *
+   * MIT License. by Paul Irish et al.
+   */
+
+
+  // $('#my-container').imagesLoaded(myFunction)
+  // or
+  // $('img').imagesLoaded(myFunction)
+
+  // execute a callback when all images have loaded.
+  // needed because .load() doesn't work on cached images
+
+  // callback function gets image collection as argument
+  //  `this` is the container
+
+  $.fn.imagesLoaded = function( callback ) {
+    var $this = this,
+        $images = $this.find('img').add( $this.filter('img') ),
+        len = $images.length,
+        blank = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==',
+        loaded = [];
+
+    function triggerCallback() {
+      callback.call( $this, $images );
+    }
+
+    function imgLoaded( event ) {
+      if ( event.target.src !== blank &amp;&amp; $.inArray( this, loaded ) === -1 ){
+        loaded.push(this);
+        if ( --len &lt;= 0 ){
+          setTimeout( triggerCallback );
+          $images.unbind( '.imagesLoaded', imgLoaded );
+        }
+      }
+    }
+
+    // if no images, trigger immediately
+    if ( !len ) {
+      triggerCallback();
+    }
+
+    $images.bind( 'load.imagesLoaded error.imagesLoaded',  imgLoaded ).each( function() {
+      // cached images don't fire load sometimes, so we reset src.
+      var src = this.src;
+      // webkit hack from http://groups.google.com/group/jquery-dev/browse_thread/thread/eee6ab7b2da50e1f
+      // data uri bypasses webkit log warning (thx doug jones)
+      this.src = blank;
+      this.src = src;
+    });
+
+    return $this;
+  };
+
+
+  // helper function for logging errors
+  // $.error breaks jQuery chaining
+  var logError = function( message ) {
+    if ( this.console ) {
+      console.error( message );
+    }
+  };
+
+  // =======================  Plugin bridge  ===============================
+  // leverages data method to either create or return $.Mason constructor
+  // A bit from jQuery UI
+  //   https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js
+  // A bit from jcarousel
+  //   https://github.com/jsor/jcarousel/blob/master/lib/jquery.jcarousel.js
+
+  $.fn.masonry = function( options ) {
+    if ( typeof options === 'string' ) {
+      // call method
+      var args = Array.prototype.slice.call( arguments, 1 );
+
+      this.each(function(){
+        var instance = $.data( this, 'masonry' );
+        if ( !instance ) {
+          logError( &quot;cannot call methods on masonry prior to initialization; &quot; +
+            &quot;attempted to call method '&quot; + options + &quot;'&quot; );
+          return;
+        }
+        if ( !$.isFunction( instance[options] ) || options.charAt(0) === &quot;_&quot; ) {
+          logError( &quot;no such method '&quot; + options + &quot;' for masonry instance&quot; );
+          return;
+        }
+        // apply method
+        instance[ options ].apply( instance, args );
+      });
+    } else {
+      this.each(function() {
+        var instance = $.data( this, 'masonry' );
+        if ( instance ) {
+          // apply options &amp; init
+          instance.option( options || {} );
+          instance._init();
+        } else {
+          // initialize new instance
+          $.data( this, 'masonry', new $.Mason( options, this ) );
+        }
+      });
+    }
+    return this;
+  };
+
+})( window, jQuery );
</ins><span class="cx">Property changes on: trunk/wp-includes/js/jquery/jquery.masonry.dev.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkwpincludesjsjqueryjquerymasonryjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/jquery/jquery.masonry.js (0 => 20060)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/jquery/jquery.masonry.js                                (rev 0)
+++ trunk/wp-includes/js/jquery/jquery.masonry.js        2012-03-01 18:57:28 UTC (rev 20060)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+(function(d,e,f){var a=e.event,c;a.special.smartresize={setup:function(){e(this).bind(&quot;resize&quot;,a.special.smartresize.handler)},teardown:function(){e(this).unbind(&quot;resize&quot;,a.special.smartresize.handler)},handler:function(j,g){var i=this,h=arguments;j.type=&quot;smartresize&quot;;if(c){clearTimeout(c)}c=setTimeout(function(){jQuery.event.handle.apply(i,h)},g===&quot;execAsap&quot;?0:100)}};e.fn.smartresize=function(g){return g?this.bind(&quot;smartresize&quot;,g):this.trigger(&quot;smartresize&quot;,[&quot;execAsap&quot;])};e.Mason=function(g,h){this.element=e(h);this._create(g);this._init()};e.Mason.settings={isResizable:true,isAnimated:false,animationOptions:{queue:false,duration:500},gutterWidth:0,isRTL:false,isFitWidth:false,containerStyle:{position:&quot;relative&quot;}};e.Mason.prototype={_filterFindBricks:function(h){var g=this.options.itemSelector;return !g?h:h.filter(g).add(h.find(g))},_getBricks:function(h){var g=this._filterFindBricks
 (h).css({position:&quot;absolute&quot;}).addClass(&quot;masonry-brick&quot;);return g},_create:function(i){this.options=e.extend(true,{},e.Mason.settings,i);this.styleQueue=[];var h=this.element[0].style;this.originalStyle={height:h.height||&quot;&quot;};var j=this.options.containerStyle;for(var k in j){this.originalStyle[k]=h[k]||&quot;&quot;}this.element.css(j);this.horizontalDirection=this.options.isRTL?&quot;right&quot;:&quot;left&quot;;this.offset={x:parseInt(this.element.css(&quot;padding-&quot;+this.horizontalDirection),10),y:parseInt(this.element.css(&quot;padding-top&quot;),10)};this.isFluid=this.options.columnWidth&amp;&amp;typeof this.options.columnWidth===&quot;function&quot;;var g=this;setTimeout(function(){g.element.addClass(&quot;masonry&quot;)},0);if(this.options.isResizable){e(d).bind(&quot;smartresize.masonry&quot;,function(){g.resize()})}this.reloadItems()},_init:function(g){this._getColumns();this._reLayout(g)},option:function(g,h){if(e.isPlainObject(g)){
 this.options=e.extend(true,this.options,g)}},layout:function(o,p){for(var m=0,n=o.length;m&lt;n;m++){this._placeBrick(o[m])}var g={};g.height=Math.max.apply(Math,this.colYs);if(this.options.isFitWidth){var k=0,m=this.cols;while(--m){if(this.colYs[m]!==0){break}k++}g.width=(this.cols-k)*this.columnWidth-this.options.gutterWidth}this.styleQueue.push({$el:this.element,style:g});var h=!this.isLaidOut?&quot;css&quot;:(this.options.isAnimated?&quot;animate&quot;:&quot;css&quot;),j=this.options.animationOptions;var l;for(m=0,n=this.styleQueue.length;m&lt;n;m++){l=this.styleQueue[m];l.$el[h](l.style,j)}this.styleQueue=[];if(p){p.call(o)}this.isLaidOut=true},_getColumns:function(){var g=this.options.isFitWidth?this.element.parent():this.element,h=g.width();this.columnWidth=this.isFluid?this.options.columnWidth(h):this.options.columnWidth||this.$bricks.outerWidth(true)||h;this.columnWidth+=this.options.gutterWidth;this.cols=Math.floor((h+this.options.gutterWidth)/this.columnWidth);thi
 s.cols=Math.max(this.cols,1)},_placeBrick:function(p){var n=e(p),r,v,k,t,l;r=Math.ceil(n.outerWidth(true)/(this.columnWidth+this.options.gutterWidth));r=Math.min(r,this.cols);if(r===1){k=this.colYs}else{v=this.cols+1-r;k=[];for(l=0;l&lt;v;l++){t=this.colYs.slice(l,l+r);k[l]=Math.max.apply(Math,t)}}var g=Math.min.apply(Math,k),u=0;for(var m=0,q=k.length;m&lt;q;m++){if(k[m]===g){u=m;break}}var o={top:g+this.offset.y};o[this.horizontalDirection]=this.columnWidth*u+this.offset.x;this.styleQueue.push({$el:n,style:o});var s=g+n.outerHeight(true),h=this.cols+1-q;for(m=0;m&lt;h;m++){this.colYs[u+m]=s}},resize:function(){var g=this.cols;this._getColumns();if(this.isFluid||this.cols!==g){this._reLayout()}},_reLayout:function(h){var g=this.cols;this.colYs=[];while(g--){this.colYs.push(0)}this.layout(this.$bricks,h)},reloadItems:function(){this.$bricks=this._getBricks(this.element.children())},reload:function(g){this.reloadItems();this._init(g)},appended:function(h,i,j){if(i){this._filt
 erFindBricks(h).css({top:this.element.height()});var g=this;setTimeout(function(){g._appended(h,j)},1)}else{this._appended(h,j)}},_appended:function(g,i){var h=this._getBricks(g);this.$bricks=this.$bricks.add(h);this.layout(h,i)},remove:function(g){this.$bricks=this.$bricks.not(g);g.remove()},destroy:function(){this.$bricks.removeClass(&quot;masonry-brick&quot;).each(function(){this.style.position=&quot;&quot;;this.style.top=&quot;&quot;;this.style.left=&quot;&quot;});var g=this.element[0].style;for(var h in this.originalStyle){g[h]=this.originalStyle[h]}this.element.unbind(&quot;.masonry&quot;).removeClass(&quot;masonry&quot;).removeData(&quot;masonry&quot;);e(d).unbind(&quot;.masonry&quot;)}};
+/*
+   * jQuery imagesLoaded plugin v1.1.0
+   * http://github.com/desandro/imagesloaded
+   *
+   * MIT License. by Paul Irish et al.
+   */
+e.fn.imagesLoaded=function(n){var l=this,j=l.find(&quot;img&quot;).add(l.filter(&quot;img&quot;)),g=j.length,m=&quot;data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==&quot;,i=[];function k(){n.call(l,j)}function h(o){if(o.target.src!==m&amp;&amp;e.inArray(this,i)===-1){i.push(this);if(--g&lt;=0){setTimeout(k);j.unbind(&quot;.imagesLoaded&quot;,h)}}}if(!g){k()}j.bind(&quot;load.imagesLoaded error.imagesLoaded&quot;,h).each(function(){var o=this.src;this.src=m;this.src=o});return l};var b=function(g){if(this.console){console.error(g)}};e.fn.masonry=function(h){if(typeof h===&quot;string&quot;){var g=Array.prototype.slice.call(arguments,1);this.each(function(){var i=e.data(this,&quot;masonry&quot;);if(!i){b(&quot;cannot call methods on masonry prior to initialization; attempted to call method '&quot;+h+&quot;'&quot;);return}if(!e.isFunction(i[h])||h.charAt(0)===&quot;_&quot;){b(&quot;no such method '&quot;+h+&quot;' for masonry instance&quot;);return}i[h].a
 pply(i,g)})}else{this.each(function(){var i=e.data(this,&quot;masonry&quot;);if(i){i.option(h||{});i._init()}else{e.data(this,&quot;masonry&quot;,new e.Mason(h,this))}})}return this}})(window,jQuery);
</ins><span class="cx">\ No newline at end of file
</span><span class="cx">Property changes on: trunk/wp-includes/js/jquery/jquery.masonry.js
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (20059 => 20060)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2012-03-01 00:18:26 UTC (rev 20059)
+++ trunk/wp-includes/script-loader.php        2012-03-01 18:57:28 UTC (rev 20060)
</span><span class="lines">@@ -166,6 +166,8 @@
</span><span class="cx">         $scripts-&gt;add( 'jquery-table-hotkeys', &quot;/wp-includes/js/jquery/jquery.table-hotkeys$suffix.js&quot;, array('jquery', 'jquery-hotkeys'), false, 1 );
</span><span class="cx">         $scripts-&gt;add( 'jquery-postmessage', &quot;/wp-includes/js/jquery/jquery.postmessage$suffix.js&quot;, array('jquery'), '0.5', 1 );
</span><span class="cx"> 
</span><ins>+        $scripts-&gt;add( 'jquery-masonry', &quot;/wp-includes/js/jquery/jquery.masonry$suffix.js&quot;, array('jquery'), '2.1.02', 1 );
+
</ins><span class="cx">         $scripts-&gt;add( 'thickbox', &quot;/wp-includes/js/thickbox/thickbox.js&quot;, array('jquery'), '3.1-20111117', 1 );
</span><span class="cx">         $scripts-&gt;localize( 'thickbox', 'thickboxL10n', array(
</span><span class="cx">                         'next' =&gt; __('Next &amp;gt;'),
</span></span></pre>
</div>
</div>

</body>
</html>