<!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>[22228] trunk: jQuery Masonry for uploaded custom headers.</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/22228">22228</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2012-10-14 17:05:16 +0000 (Sun, 14 Oct 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>jQuery Masonry for uploaded custom headers. props zamoose. fixes <a href="http://core.trac.wordpress.org/ticket/20346">#20346</a>.</pre>

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

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkwpadminjscustomheaderjs">trunk/wp-admin/js/custom-header.js</a></li>
<li><a href="#trunkwpincludesjsjqueryjquerymasonryminjs">trunk/wp-includes/js/jquery/jquery.masonry.min.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminjscustomheaderjs"></a>
<div class="addfile"><h4>Added: trunk/wp-admin/js/custom-header.js (0 => 22228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/custom-header.js                                (rev 0)
+++ trunk/wp-admin/js/custom-header.js        2012-10-14 17:05:16 UTC (rev 22228)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+(function($) {
+
+        var headers = $('.available-headers');
+        headers.imagesLoaded( function() {
+                headers.masonry({
+                        itemSelector: '.default-header'
+                });
+        });
+
+})(jQuery);
</ins></span></pre></div>
<a id="trunkwpincludesjsjqueryjquerymasonryminjs"></a>
<div class="addfile"><h4>Added: trunk/wp-includes/js/jquery/jquery.masonry.min.js (0 => 22228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/js/jquery/jquery.masonry.min.js                                (rev 0)
+++ trunk/wp-includes/js/jquery/jquery.masonry.min.js        2012-10-14 17:05:16 UTC (rev 22228)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+/**
+ * jQuery Masonry v2.1.05
+ * A dynamic layout plugin for jQuery
+ * The flip-side of CSS Floats
+ * http://masonry.desandro.com
+ *
+ * Licensed under the MIT license.
+ * Copyright 2012 David DeSandro
+ */
+(function(a,b,c){&quot;use strict&quot;;var d=b.event,e;d.special.smartresize={setup:function(){b(this).bind(&quot;resize&quot;,d.special.smartresize.handler)},teardown:function(){b(this).unbind(&quot;resize&quot;,d.special.smartresize.handler)},handler:function(a,c){var d=this,f=arguments;a.type=&quot;smartresize&quot;,e&amp;&amp;clearTimeout(e),e=setTimeout(function(){b.event.handle.apply(d,f)},c===&quot;execAsap&quot;?0:100)}},b.fn.smartresize=function(a){return a?this.bind(&quot;smartresize&quot;,a):this.trigger(&quot;smartresize&quot;,[&quot;execAsap&quot;])},b.Mason=function(a,c){this.element=b(c),this._create(a),this._init()},b.Mason.settings={isResizable:!0,isAnimated:!1,animationOptions:{queue:!1,duration:500},gutterWidth:0,isRTL:!1,isFitWidth:!1,containerStyle:{position:&quot;relative&quot;}},b.Mason.prototype={_filterFindBricks:function(a){var b=this.options.itemSelector;return b?a.filter(b).add(a.find(b)):a},_getBricks:function(a){var b=this._filterFindBricks(a).
 css({position:&quot;absolute&quot;}).addClass(&quot;masonry-brick&quot;);return b},_create:function(c){this.options=b.extend(!0,{},b.Mason.settings,c),this.styleQueue=[];var d=this.element[0].style;this.originalStyle={height:d.height||&quot;&quot;};var e=this.options.containerStyle;for(var f in e)this.originalStyle[f]=d[f]||&quot;&quot;;this.element.css(e),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),this.options.isResizable&amp;&amp;b(a).bind(&quot;smartresize.masonry&quot;,function(){g.resize()}),this.reloadItems()},_init:function(a){this._getColumns(),this._reLayout(a)},option:function(a,c){b.isPlainObject(a)&amp;&am
 p;(this.options=b.extend(!0,this.options,a))},layout:function(a,b){for(var c=0,d=a.length;c&lt;d;c++)this._placeBrick(a[c]);var e={};e.height=Math.max.apply(Math,this.colYs);if(this.options.isFitWidth){var f=0;c=this.cols;while(--c){if(this.colYs[c]!==0)break;f++}e.width=(this.cols-f)*this.columnWidth-this.options.gutterWidth}this.styleQueue.push({$el:this.element,style:e});var g=this.isLaidOut?this.options.isAnimated?&quot;animate&quot;:&quot;css&quot;:&quot;css&quot;,h=this.options.animationOptions,i;for(c=0,d=this.styleQueue.length;c&lt;d;c++)i=this.styleQueue[c],i.$el[g](i.style,h);this.styleQueue=[],b&amp;&amp;b.call(a),this.isLaidOut=!0},_getColumns:function(){var a=this.options.isFitWidth?this.element.parent():this.element,b=a.width();this.columnWidth=this.isFluid?this.options.columnWidth(b):this.options.columnWidth||this.$bricks.outerWidth(!0)||b,this.columnWidth+=this.options.gutterWidth,this.cols=Math.floor((b+this.options.gutterWidth)/this.columnWidth),this.cols=M
 ath.max(this.cols,1)},_placeBrick:function(a){var c=b(a),d,e,f,g,h;d=Math.ceil(c.outerWidth(!0)/this.columnWidth),d=Math.min(d,this.cols);if(d===1)f=this.colYs;else{e=this.cols+1-d,f=[];for(h=0;h&lt;e;h++)g=this.colYs.slice(h,h+d),f[h]=Math.max.apply(Math,g)}var i=Math.min.apply(Math,f),j=0;for(var k=0,l=f.length;k&lt;l;k++)if(f[k]===i){j=k;break}var m={top:i+this.offset.y};m[this.horizontalDirection]=this.columnWidth*j+this.offset.x,this.styleQueue.push({$el:c,style:m});var n=i+c.outerHeight(!0),o=this.cols+1-l;for(k=0;k&lt;o;k++)this.colYs[j+k]=n},resize:function(){var a=this.cols;this._getColumns(),(this.isFluid||this.cols!==a)&amp;&amp;this._reLayout()},_reLayout:function(a){var b=this.cols;this.colYs=[];while(b--)this.colYs.push(0);this.layout(this.$bricks,a)},reloadItems:function(){this.$bricks=this._getBricks(this.element.children())},reload:function(a){this.reloadItems(),this._init(a)},appended:function(a,b,c){if(b){this._filterFindBricks(a).css({top:this.element.hei
 ght()});var d=this;setTimeout(function(){d._appended(a,c)},1)}else this._appended(a,c)},_appended:function(a,b){var c=this._getBricks(a);this.$bricks=this.$bricks.add(c),this.layout(c,b)},remove:function(a){this.$bricks=this.$bricks.not(a),a.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 c=this.element[0].style;for(var d in this.originalStyle)c[d]=this.originalStyle[d];this.element.unbind(&quot;.masonry&quot;).removeClass(&quot;masonry&quot;).removeData(&quot;masonry&quot;),b(a).unbind(&quot;.masonry&quot;)}},b.fn.imagesLoaded=function(a){function h(){a.call(c,d)}function i(a){var c=a.target;c.src!==f&amp;&amp;b.inArray(c,g)===-1&amp;&amp;(g.push(c),--e&lt;=0&amp;&amp;(setTimeout(h),d.unbind(&quot;.imagesLoaded&quot;,i)))}var c=this,d=c.find(&quot;img&quot;).add(c.filter(&quot;img&quot;)),e=d.length,f=&quot;data:image/gif;base64,R0
 lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==&quot;,g=[];return e||h(),d.bind(&quot;load.imagesLoaded error.imagesLoaded&quot;,i).each(function(){var a=this.src;this.src=f,this.src=a}),c};var f=function(b){a.console&amp;&amp;a.console.error(b)};b.fn.masonry=function(a){if(typeof a==&quot;string&quot;){var c=Array.prototype.slice.call(arguments,1);this.each(function(){var d=b.data(this,&quot;masonry&quot;);if(!d){f(&quot;cannot call methods on masonry prior to initialization; attempted to call method '&quot;+a+&quot;'&quot;);return}if(!b.isFunction(d[a])||a.charAt(0)===&quot;_&quot;){f(&quot;no such method '&quot;+a+&quot;' for masonry instance&quot;);return}d[a].apply(d,c)})}else this.each(function(){var c=b.data(this,&quot;masonry&quot;);c?(c.option(a||{}),c._init()):b.data(this,&quot;masonry&quot;,new b.Mason(a,this))});return this}})(window,jQuery);
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkwpincludesscriptloaderphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/script-loader.php (22227 => 22228)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/script-loader.php        2012-10-14 03:47:36 UTC (rev 22227)
+++ trunk/wp-includes/script-loader.php        2012-10-14 17:05:16 UTC (rev 22228)
</span><span class="lines">@@ -171,6 +171,7 @@
</span><span class="cx">         $scripts-&gt;add( 'jquery-hotkeys', &quot;/wp-includes/js/jquery/jquery.hotkeys$suffix.js&quot;, array('jquery'), '0.0.2m', 1 );
</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-touch-punch', &quot;/wp-includes/js/jquery/jquery.ui.touch-punch.js&quot;, array('jquery-ui-widget', 'jquery-ui-mouse'), '0.2.2', 1 );
</span><ins>+        $scripts-&gt;add( 'jquery-masonry', &quot;/wp-includes/js/jquery/jquery.masonry.min.js&quot;, array('jquery'), '2.1.05', 1 );
</ins><span class="cx"> 
</span><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">         did_action( 'init' ) &amp;&amp; $scripts-&gt;localize( 'thickbox', 'thickboxL10n', array(
</span><span class="lines">@@ -477,6 +478,7 @@
</span><span class="cx">                         'saveAlert' =&gt; __('The changes you made will be lost if you navigate away from this page.')
</span><span class="cx">                 ) );
</span><span class="cx"> 
</span><ins>+                $scripts-&gt;add( 'custom-header', &quot;/wp-admin/js/custom-header.js&quot;, array( 'jquery-masonry' ), false, 1 );
</ins><span class="cx">                 $scripts-&gt;add( 'custom-background', &quot;/wp-admin/js/custom-background$suffix.js&quot;, array( 'wp-color-picker' ), false, 1 );
</span><span class="cx">                 $scripts-&gt;add( 'media-gallery', &quot;/wp-admin/js/media-gallery$suffix.js&quot;, array('jquery'), false, 1 );
</span><span class="cx">         }
</span></span></pre>
</div>
</div>

</body>
</html>