Index: wp-admin/js/theme.js
===================================================================
--- wp-admin/js/theme.js	(wersja 27646)
+++ wp-admin/js/theme.js	(kopia robocza)
@@ -474,6 +474,30 @@
 		if ( image.width && image.width <= 300 ) {
 			el.addClass( 'small-screenshot' );
 		}
+	},
+
+	// Setups an image gallery using the theme screenshots supplied by a theme
+	screenshotGallery: function() {
+		var el, img,
+			screenshots = $( '.theme-screenshots' );
+
+		// Select the first item
+		screenshots.find( '.thumb' ).first().addClass( 'selected' );
+
+		// Clicking on a screenshot thumbnail drops it
+		// at the top of the stack in a larger size
+		screenshots.on( 'click', 'div.thumb', function() {
+			el = $( this );
+			img = $( this ).find( 'img' ).attr( 'src' );
+
+			// Change src attribute of first image
+			screenshots.find( '.screenshot' ).first().find( 'img' ).fadeOut(130, function() { 
+				$(this).attr('src',img);
+			}).fadeIn(300);
+			// Mark the new image as 'selected'
+			el.siblings( '.selected' ).removeClass( 'selected' );
+			el.addClass( 'selected' );
+		});
 	}
 });
 
@@ -696,6 +720,7 @@
 
 		this.overlay.render();
 		this.$overlay.html( this.overlay.el );
+		this.overlay.screenshotGallery();
 
 		// Bind to theme:next and theme:previous
 		// triggered by the arrow keys
@@ -1265,7 +1290,7 @@
 			self.view.trigger( 'theme:close' );
 		});
 
-		themes.router.on( 'route:upload', function() {
+		themes.router.on( 'route:upload', function( slug ) {
 			$( 'a.upload' ).trigger( 'click' );
 		});
 
Index: wp-admin/themes.php
===================================================================
--- wp-admin/themes.php	(wersja 27646)
+++ wp-admin/themes.php	(kopia robocza)
@@ -193,9 +193,9 @@
 	$aria_name   = esc_attr( $theme['id'] . '-name' );
 	?>
 <div class="theme<?php if ( $theme['active'] ) echo ' active'; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>">
-	<?php if ( ! empty( $theme['screenshot'][0] ) ) { ?>
+	<?php if ( ! empty( $theme['screenshot'][0][0] ) ) { ?>
 		<div class="theme-screenshot">
-			<img src="<?php echo $theme['screenshot'][0]; ?>" alt="" />
+			<img src="<?php echo $theme['screenshot'][0][0]; ?>" alt="" />
 		</div>
 	<?php } else { ?>
 		<div class="theme-screenshot blank"></div>
@@ -270,9 +270,9 @@
  */
 ?>
 <script id="tmpl-theme" type="text/template">
-	<# if ( data.screenshot[0] ) { #>
+	<# if ( data.screenshot[0][0] ) { #>
 		<div class="theme-screenshot">
-			<img src="{{ data.screenshot[0] }}" alt="" />
+			<img src="{{ data.screenshot[0][0] }}" alt="" />
 		</div>
 	<# } else { #>
 		<div class="theme-screenshot blank"></div>
@@ -315,8 +315,17 @@
 		</div>
 		<div class="theme-about">
 			<div class="theme-screenshots">
-			<# if ( data.screenshot[0] ) { #>
-				<div class="screenshot"><img src="{{ data.screenshot[0] }}" alt="" /></div>
+			<# if ( data.screenshot[0][0] ) { #>
+				<div class="screenshot"><img src="{{ data.screenshot[0][0] }}" alt="" /></div>
+				<#
+					if ( _.size( data.screenshot[0] ) > 1 ) {
+						_.each ( data.screenshot[0], function( image ) {
+				#> 
+						<div class="screenshot thumb"><img src="{{ image }}" alt="" /></div> 
+				<#
+						}); 
+					}
+				#>
 			<# } else { #>
 				<div class="screenshot blank"></div>
 			<# } #>
Index: wp-includes/class-wp-theme.php
===================================================================
--- wp-includes/class-wp-theme.php	(wersja 27646)
+++ wp-includes/class-wp-theme.php	(kopia robocza)
@@ -882,26 +882,53 @@
 	 * @return mixed Screenshot file. False if the theme does not have a screenshot.
 	 */
 	public function get_screenshot( $uri = 'uri' ) {
-		$screenshot = $this->cache_get( 'screenshot' );
-		if ( $screenshot ) {
+		$screenshotsArr = array();
+		$screenshots = $this->cache_get( 'screenshots' );
+		if ( $screenshots ) {
 			if ( 'relative' == $uri )
-				return $screenshot;
-			return $this->get_stylesheet_directory_uri() . '/' . $screenshot;
-		} elseif ( 0 === $screenshot ) {
+				return $screenshots;
+			else {
+				foreach ( $screenshots as $screenshot )
+					array_push( $screenshotsArr, $this->get_stylesheet_directory_uri() . '/' . $screenshot );
+				return $screenshotsArr;
+			}
+		} elseif ( 0 === $screenshots ) {
 			return false;
 		}
-
-		foreach ( array( 'png', 'gif', 'jpg', 'jpeg' ) as $ext ) {
-			if ( file_exists( $this->get_stylesheet_directory() . "/screenshot.$ext" ) ) {
-				$this->cache_add( 'screenshot', 'screenshot.' . $ext );
-				if ( 'relative' == $uri )
-					return 'screenshot.' . $ext;
-				return $this->get_stylesheet_directory_uri() . '/' . 'screenshot.' . $ext;
+		$relativePathScreenshotsArray=array();
+		$absolutePathScreenshotsArray=array();
+		$allowedExtensions = array( 'png', 'gif', 'jpg', 'jpeg' );
+		foreach ( $allowedExtensions as $ext ) {
+			if ( file_exists( $this->get_stylesheet_directory() . '/screenshot.' . $ext ) ) {
+				array_push( $relativePathScreenshotsArray, 'screenshot.' . $ext );
+				array_push( $absolutePathScreenshotsArray, $this->get_stylesheet_directory_uri() . '/' . 'screenshot.' . $ext );
+				break;
 			}
 		}
-
-		$this->cache_add( 'screenshot', 0 );
-		return false;
+		if ( file_exists($this->get_stylesheet_directory() . '/screenshots' ) ) {
+			$files = (array) self::scandir( $this->get_stylesheet_directory() . '/screenshots', $allowedExtensions );
+			$extraScreenshots = array();
+			$fileCounter = 0;
+			foreach ( $files as $name => $absPath) {
+				if ( substr( $name, 0, -5 ) == 'screenshot-' && !in_array( substr( $name, 0, -4 ), $extraScreenshots ) ) {
+					$fileCounter++;
+					array_push( $extraScreenshots, 'screenshot-' . $fileCounter );
+				}
+			}
+			foreach ( $extraScreenshots as $screenshot ) {
+				foreach ( $allowedExtensions as $ext ) {
+					if ( file_exists( $this->get_stylesheet_directory() . '/screenshots/' . $screenshot . '.' . $ext ) ) {
+						array_push( $relativePathScreenshotsArray, '/screenshots/' . $screenshot . '.' . $ext );
+						array_push( $absolutePathScreenshotsArray, $this->get_stylesheet_directory_uri() . '/screenshots/' . $screenshot . '.' . $ext );
+						break;
+					}
+				}
+			}
+		}
+		$this->cache_add( 'screenshots', $relativePathScreenshotsArray );
+		if ( 'relative' == $uri )
+			return $relativePathScreenshotsArray;
+		return $absolutePathScreenshotsArray;
 	}
 
 	/**
