public/ckeditor/4.4dev/plugins/undo/plugin.js
function( isUndo ) {
			var snapshots = this.snapshots,
				currentImage = this.currentImage,
				image, i;

			if ( currentImage ) {
				if ( isUndo ) {
					for ( i = this.index - 1; i >= 0; i-- ) {
						image = snapshots[ i ];
						if ( !currentImage.equalsContent( image ) ) {
							image.index = i;
							return image;
						}
					}
				} else {
					for ( i = this.index + 1; i < snapshots.length; i++ ) {
						image = snapshots[ i ];
						if ( !currentImage.equalsContent( image ) ) {
							image.index = i;
							return image;
						}
					}
				}
			}

			return null;
		}
function( isUndo ) {
			var snapshots = this.snapshots,
				currentImage = this.currentImage,
				image, i;

			if ( currentImage ) {
				if ( isUndo ) {
					for ( i = this.index - 1; i >= 0; i-- ) {
						image = snapshots[ i ];
						if ( !currentImage.equalsContent( image ) ) {
							image.index = i;
							return image;
						}
					}
				} else {
					for ( i = this.index + 1; i < snapshots.length; i++ ) {
						image = snapshots[ i ];
						if ( !currentImage.equalsContent( image ) ) {
							image.index = i;
							return image;
						}
					}
				}
			}

			return null;
		}
function ( isUndo ) { var snapshots = this . snapshots , currentImage = this . currentImage , image , i ; if ( currentImage ) { if ( isUndo ) { for ( i = this . index - 1 ; i >= 0 ; i -- ) { image = snapshots [ i ] ; if ( ! currentImage . equalsContent ( image ) ) { image . index = i ; return image ; } } } else { for ( i = this . index + 1 ; i < snapshots . length ; i ++ ) { image = snapshots [ i ] ; if ( ! currentImage . equalsContent ( image ) ) { image . index = i ; return image ; } } } } return null ; }
Gets the closest available image.

@param {Boolean} isUndo If `true`, it will return the previous image.
@returns {CKEDITOR.plugins.undo.Image} Next image or `null`.
Gets the closest available image .