CoreFiles by mySites.guru
media-gallery.js27 lines, 835 bytes, from wordpress-3.7.39.zip
Raw History Compare with 3.7.38
md5
4be2c115bd13d75efb6ecd8301eeca2b
sha1
0d8a803ce6dc908af4321b9240b74af893543512
sha256
26c252106814603de4c187d32975c57f0e467a10dfd91fe2636ff82cca3670c8
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 7 releases, WordPress 3.7.35 to 3.7.41. See them all, or every version of this file.