diff --git a/Gruntfile.js b/Gruntfile.js index d7a9f2377b..5a313c2933 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -55,6 +55,7 @@ module.exports = function(grunt) { // Ignore unminified versions of external libs we don't ship: '!wp-includes/js/backbone.js', '!wp-includes/js/underscore.js', + '!wp-includes/js/jquery/jquery.masonry.js', '!wp-includes/version.php' // Exclude version.php ], dest: BUILD_DIR diff --git a/src/wp-includes/js/jquery/jquery.masonry.min.js b/src/wp-includes/js/jquery/jquery.masonry.min.js new file mode 100644 index 0000000000..63f9a4e565 --- /dev/null +++ b/src/wp-includes/js/jquery/jquery.masonry.min.js @@ -0,0 +1,11 @@ +/*! + * Masonry v2 shim + * to maintain backwards compatibility + * as of Masonry v3.1.2 + * + * Cascading grid layout library + * http://masonry.desandro.com + * MIT License + * by David DeSandro + */ +!function(a){var b=a.Masonry;b.prototype._remapV2Options=function(){this._remapOption("gutterWidth","gutter"),this._remapOption("isResizable","isResizeBound"),this._remapOption("isRTL","isOriginLeft",function(a){return!a});var a=this.options.isAnimated;if(void 0!==a&&(this.options.transitionDuration=a?b.prototype.options.transitionDuration:0),void 0===a||a){var c=this.options.animationOptions,d=c&&c.duration;d&&(this.options.transitionDuration="string"==typeof d?d:d+"ms")}},b.prototype._remapOption=function(a,b,c){var d=this.options[a];void 0!==d&&(this.options[b]=c?c(d):d)};var c=b.prototype._create;b.prototype._create=function(){this._remapV2Options(),c.apply(this,arguments)};var d=b.prototype.layout;b.prototype.layout=function(){this._remapV2Options(),d.apply(this,arguments)};var e=b.prototype.option;b.prototype.option=function(){e.apply(this,arguments),this._remapV2Options()};var f=b.prototype.measureColumns;b.prototype.measureColumns=function(){var a=this.options.columnWidth;a&&"function"==typeof a&&(this.getContainerWidth(),this.columnWidth=a(this.containerWidth)),f.apply(this,arguments)}}(window); \ No newline at end of file diff --git a/src/wp-includes/script-loader.php b/src/wp-includes/script-loader.php index c9c575752f..23b93f2eac 100644 --- a/src/wp-includes/script-loader.php +++ b/src/wp-includes/script-loader.php @@ -201,7 +201,7 @@ function wp_default_scripts( &$scripts ) { // Masonry v2 depended on jQuery. v3 does not. The older jquery-masonry handle is a shiv. // It sets jQuery as a dependency, as the theme may have been implicitly loading it this way. $scripts->add( 'masonry', "/wp-includes/js/masonry.min.js", array(), '3.1.2', 1 ); - $scripts->add( 'jquery-masonry', "/wp-includes/js/jquery/jquery.masonry$suffix.js", array( 'jquery', 'masonry' ), '3.1.2', 1 ); + $scripts->add( 'jquery-masonry', "/wp-includes/js/jquery/jquery.masonry$dev_suffix.js", array( 'jquery', 'masonry' ), '3.1.2', 1 ); $scripts->add( 'thickbox', "/wp-includes/js/thickbox/thickbox.js", array('jquery'), '3.1-20121105', 1 ); did_action( 'init' ) && $scripts->localize( 'thickbox', 'thickboxL10n', array(