CoreFiles by mySites.guru
custom-header.js47 lines, 1,025 bytes, from wordpress-3.5-RC3.zip
Raw History Compare with 3.5-RC2
md5
1c54e83e4dd6dd41da00be445628f839
sha1
7bfd2868d5e9d33f3ac3d418b65fc113ec4e0c10
sha256
ce07155ebff8ab884237f31a9fe02f704f28bc87b66899776ee5ce67a7d2bea0
(function($) {
	var frame;

	$( function() {
		// Fetch available headers and apply jQuery.masonry
		// once the images have loaded.
		var $headers = $('.available-headers');

		$headers.imagesLoaded( function() {
			$headers.masonry({
				itemSelector: '.default-header',
				isRTL: !! ( 'undefined' != typeof isRtl && isRtl )
			});
		});

		// Build the choose from library frame.
		$('#choose-from-library-link').click( function( event ) {
			var $el = $(this);
			event.preventDefault();

			frame = wp.media({
				title:     $el.data('choose'),
				library:   {
					type: 'image'
				}
			});

			frame.on( 'toolbar:render:select', function( view ) {
				view.set({
					select: {
						style: 'primary',
						text:  $el.data('update'),

						click: function() {
							var attachment = frame.state().get('selection').first(),
								link = $el.data('updateLink');

							window.location = link + '&file=' + attachment.id;
						}
					}
				});
			});

			frame.setState('library').open();
		});
	});
}(jQuery));

No other release has this exact content. See every version of this file.