<commit_before>UI.slideshow = function(images) {
	
	console.log("UI.slideshow images = " + JSON.stringify(images));
	
	var bottom_views = [];
	var currentImageIndex = 0;
	var win = Ti.UI.createWindow({backgroundColor: "#000000"});

	var cover_view = Ti.UI.createView({
		height: "80%",
		width: "100%",
		top: 0
	});
	
	var main_image_view = Ti.UI.createImageView({
		width: 400,
		height: 400
	});
	
	var previous_image_view = Ti.UI.createImageView({
		width: 120,
		height: 120,
		left: 100
	});
	
	var next_image_view = Ti.UI.createImageView({
		width: 120,
		height: 120,
		right: 100
	});
	
	var previous_label = Ti.UI.createLabel({
		font: {fontFamily:'Helvetica',fontSize:"13dp",fontWeight:'regular'},
		left: 130,
		top: 370,
		text: "Previous",
		color: "white",
		height: 'auto',
		width: 'auto',
		visible: false
	});
	
	var next_label = Ti.UI.createLabel({
		font: {fontFamily:'Helvetica',fontSize:"13dp",fontWeight:'regular'},
		text: "Next",
		right: 140,
		top: 370,
		color: "white",
		height: 'auto',
		width: 'auto',
		visible: false
	});
	
	var caption_view = Ti.UI.createView({
		backgroundColor: "#ffffff",
		borderRadius:8,
		borderColor: "black",
		borderWidth: 1,
		width: 420,
		height: 'auto',
		bottom: 175
	});
	
	var caption_text = Ti.UI.createLabel({
		font: {fontFamily:'Helvetica',fontSize:"13dp",fontWeight:'regular'},
		left: 10,
		right: 10,
		top: 10,
		bottom: 10,
		color: "#023f66",
		height: 'auto'
	});
	
	caption_view.add(caption_text);
	
	var bottom_scroller = Ti.UI.createScrollView({
		height: "20%",
		bottom: 0,
		layout: "horizontal",
		contentWidth:"auto",
		contentHeight:'auto',
		showHorizontalScrollIndicator:true,
		showVerticalScrollIndicator:false
	});
	
	var _updateBottom = function() {
		image_view = bottom_views[currentImageIndex];
		_changeBorder(image_view);
		_scrollTo(image_view);
	}
	
	var _updateImagePositions = function() {
		var image = images[currentImageIndex];
		var previous_image = images[currentImageIndex-1];
		var next_image = images[currentImageIndex+1];
		
		previous_label.visible = !!previous_image;
		next_label.visible = !!next_image;
		
		if(previous_image){previous_image_view.image = previous_image.url};
		if(next_image){next_image_view.image = next_image.url};
		
		main_image_view.image = image.url;
		
		_updateCaption(image.caption);
		_updateBottom();
	}
	
	var _updateCaption = function(caption) {
		caption_view.visible = !!caption;
		caption_text.text = caption+"\n";
	}
	
	var _selectImage = function(image) {
		currentImageIndex = images.indexOf(image);
		_updateImagePositions();
	}
	
	var _changeBorder = function(view) {
		var _addBorder = function(view) {
			view.borderWidth = 2;
		}

		var _removeBorder = function(view) {
			view.borderWidth = 0;
		}
		
		map(_removeBorder, bottom_views);
		_addBorder(view);<commit_msg>fix case study slideshow<commit_after>UI.slideshow = function(images) {
	
	console.log("UI.slideshow images = " + JSON.stringify(images));
	
	var bottom_views = [];
	var currentImageIndex = 0;
	var win = Ti.UI.createWindow({backgroundColor: "#000000"});

	var cover_view = Ti.UI.createView({
		height: "80%",
		width: "100%",
		top: 0
	});
	
	var main_image_view = Ti.UI.createImageView({
		width: 400,
		height: 400
	});
	
	var previous_image_view = Ti.UI.createImageView({
		width: 120,
		height: 120,
		left: 100
	});
	
	var next_image_view = Ti.UI.createImageView({
		width: 120,
		height: 120,
		right: 100
	});
	
	var previous_label = Ti.UI.createLabel({
		font: {fontFamily:'Helvetica',fontSize:"13dp",fontWeight:'regular'},
		left: 130,
		top: 370,
		text: "Previous",
		color: "white",
		height: 'auto',
		width: 'auto',
		visible: false
	});
	
	var next_label = Ti.UI.createLabel({
		font: {fontFamily:'Helvetica',fontSize:"13dp",fontWeight:'regular'},
		text: "Next",
		right: 140,
		top: 370,
		color: "white",
		height: 'auto',
		width: 'auto',
		visible: false
	});
	
	var caption_view = Ti.UI.createView({
		backgroundColor: "#ffffff",
		borderRadius:8,
		borderColor: "black",
		borderWidth: 1,
		width: 420,
		height: 'auto',
		minHeight: 60,
		bottom: 175
	});
	
	var caption_text = Ti.UI.createLabel({
		font: {fontFamily:'Helvetica',fontSize:"13dp",fontWeight:'regular'},
		left: 10,
		right: 10,
		top: 10,
		bottom: 10,
		color: "#023f66",
		height: 'auto'
	});
	
	caption_view.add(caption_text);
	
	var bottom_scroller = Ti.UI.createScrollView({
		height: "20%",
		bottom: 0,
		layout: "horizontal",
		contentWidth:"auto",
		contentHeight:'auto',
		showHorizontalScrollIndicator:true,
		showVerticalScrollIndicator:false
	});
	
	var _updateBottom = function() {
		image_view = bottom_views[currentImageIndex];
		_changeBorder(image_view);
		_scrollTo(image_view);
	}
	
	var _updateSurroundingImage = function(label, view, image) {
		if(image) view.image = image.url;		
		label.visible = view.visible = !!image;
	}
	
	var _updateImagePositions = function() {
		var image = images[currentImageIndex];
		var previous_image = images[currentImageIndex-1];
		var next_image = images[currentImageIndex+1];
		
		_updateSurroundingImage(next_label, next_image_view, next_image);
		_updateSurroundingImage(previous_label, previous_image_view,  previous_image);
		
		main_image_view.image = image.url;
		
		_updateCaption(image.caption);
		_updateBottom();
	}
	
	var _updateCaption = function(caption) {
		caption_view.visible = !!caption;
		caption_text.text = caption+"\n";
	}
	
	var _selectImage = function(image) {
		currentImageIndex = images.indexOf(image);
		_updateImagePositions();
	}
	
	var _changeBorder = function(view) {
		var _addBorder = function(view) {
			view.borderWidth = 2;
		}

		var _removeBorder = function(view) {
			view.borderWidth = 0;
		}
		
		map(_removeBorder, bottom_views);
		_addBorder(view);
{'fraction_non_alphanumeric': 0.14362532523850824, 'fraction_numerical': 0.029141370338248047, 'mean_word_length': 4.4039362699156515, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6782008', 'n_tokens_mistral': 2390, 'n_tokens_neox': 1984, 'n_words': 399}