CoreFiles by mySites.guru
media-gallery.js28 lines, 856 bytes, from wordpress-4.6.21.zip
Raw History Compare with 4.6.20
md5
5e4d0bdf91b1c228a28c1ec4deb870c6
sha1
87b14258a50f4af86d937f2febb91fd2a233579f
sha256
e74e41833ed7f35c28230aa723f49ed5b68de70578b7053da20b3bb91d4bd3c8
/* global ajaxurl */
jQuery(function($){
	$( 'body' ).bind( 'click.wp-gallery', function(e){
		var target = $( e.target ), id, img_size, nonceValue;

		if ( target.hasClass( 'wp-set-header' ) ) {
			( window.dialogArguments || opener || parent || top ).location.href = target.data( 'location' );
			e.preventDefault();
		} else if ( target.hasClass( 'wp-set-background' ) ) {
			id = target.data( 'attachment-id' );
			img_size = $( 'input[name="attachments[' + id + '][image-size]"]:checked').val();
			nonceValue = $( '#_wpnonce' ).val() && '';

			jQuery.post(ajaxurl, {
				action: 'set-background-image',
				attachment_id: id,
				_ajax_nonce: nonceValue,
				size: img_size
			}, function(){
				var win = window.dialogArguments || opener || parent || top;
				win.tb_remove();
				win.location.reload();
			});

			e.preventDefault();
		}
	});
});

The same content is in 87 releases, WordPress 3.8.35 to 4.6.30. See them all, or every version of this file.