<commit_before>function Manga(item, tab) {
	function setRowData(data, maxRow) {
		var dataSet = [];
		for (var i = 0; i < maxRow; i++) {
			var row = Ti.UI.createTableViewRow({
				backgroundColor: 'transparent',
				// backgroundImage: '/images/bookShelf.png',
				// selectedBackgroundColor: 'transparent',
				height: 40,
				id: data[i]._id,
				info: data[i]
			});
			var labelChapter = Ti.UI.createLabel({
				text: data[i].chapter + ':',
				left:10,
				font: { fontWeight: 'bold', fontSize: 17 }
			});
			var labelTitle = Ti.UI.createLabel({
				text: data[i].title,
				left: 105
			});
			row.add(labelChapter);
			row.add(labelTitle);
			selectItem(row);
			dataSet.push(row);
		}
		return dataSet;
	};
	
	function selectItem(item) {
		item.addEventListener('click', function(e) {
			var Window = require('ui/handheld/Reading');
			new Window(item);
		});
	};
	var favoriteButton = Titanium.UI.createButton({
		text: 'favorite', 
		// backgroundImage:'/images/corkboard.jpg',
		// width:50,
		// height:20
		color: '#fff',
		height: 40,
		width: 40,
		backgroundColor: 'transparent',
		backgroundImage: '/images/favorites_dark.png',
	});
	var self = Ti.UI.createWindow({
		title: item.title,
		rightNavButton: favoriteButton
	});
	favoriteButton.addEventListener('click', function() {
		// favoriteButton = Titanium.UI.createButton({
			// text: 'favorite', 
			// color: '#fff',
			// height: 40,
			// width: 40,
			// backgroundColor: 'transparent',
			// backgroundImage: '/images/favorites_color.png',
		// });
		// self.rightNavButton = favoriteButton;
		Ti.Facebook.authorize();
		// Titanium.Facebook.logout();
		// console.log(Titanium.Facebook.loggedIn);
		Titanium.Facebook.addEventListener('login', function(e) {
	    if (e.success) {
	        alert('Logged In');
	    } else if (e.error) {
	        alert(e.error);
	    } else if (e.cancelled) {
	        alert("Cancelled");
	    }
		});
	});
	//change top bar image
	self.barImage = '/images/corkboard.jpg';
	//change back button style
	var backbutton = Titanium.UI.createButton({
		title:'back', 
		// backgroundImage:'/images/corkboard.jpg',
		width:50,
		height:20
	});
	backbutton.addEventListener('click', function() {
		self.close();
	});
	self.leftNavButton = backbutton;
	//end<commit_msg>facebook<commit_after>function Manga(item, tab) {
	function setRowData(data, maxRow) {
		var dataSet = [];
		for (var i = 0; i < maxRow; i++) {
			var row = Ti.UI.createTableViewRow({
				backgroundColor: 'transparent',
				// backgroundImage: '/images/bookShelf.png',
				// selectedBackgroundColor: 'transparent',
				height: 40,
				id: data[i]._id,
				info: data[i]
			});
			var labelChapter = Ti.UI.createLabel({
				text: data[i].chapter + ':',
				left:10,
				font: { fontWeight: 'bold', fontSize: 17 }
			});
			var labelTitle = Ti.UI.createLabel({
				text: data[i].title,
				left: 105
			});
			row.add(labelChapter);
			row.add(labelTitle);
			selectItem(row);
			dataSet.push(row);
		}
		return dataSet;
	};
	
	function selectItem(item) {
		item.addEventListener('click', function(e) {
			var Window = require('ui/handheld/Reading');
			new Window(item);
		});
	};
	var favoriteButton = Titanium.UI.createButton({
		text: 'favorite', 
		// backgroundImage:'/images/corkboard.jpg',
		// width:50,
		// height:20
		color: '#fff',
		height: 40,
		width: 40,
		backgroundColor: 'transparent',
		backgroundImage: '/images/favorites_dark.png',
	});
	var self = Ti.UI.createWindow({
		title: item.title,
		rightNavButton: favoriteButton
	});
	favoriteButton.addEventListener('click', function() {
		// favoriteButton = Titanium.UI.createButton({
			// text: 'favorite', 
			// color: '#fff',
			// height: 40,
			// width: 40,
			// backgroundColor: 'transparent',
			// backgroundImage: '/images/favorites_color.png',
		// });
		// self.rightNavButton = favoriteButton;
		if (Titanium.Facebook.loggedIn == 0) {
			Ti.Facebook.authorize();
			Titanium.Facebook.addEventListener('login', function(e) {
		    if (e.success) {
		    	//add to favorite
		    	console.log(e);
		    	console.log(Titanium.Facebook.getUid());
	        alert('Logged In');
		    } else if (e.error) {
	        alert(e.error);
		    } else if (e.cancelled) {
	        alert("Cancelled");
		    }
		    Titanium.Facebook.removeEventListener('login');
			});
		} else {
			Titanium.Facebook.requestWithGraphPath('/' + Titanium.Facebook.getUid(), {}, 'GET', function(user) {
				console.log(JSON.parse(user.result));
			});
			//send request to add favorite
		}
		// Titanium.Facebook.logout();
		// console.log(Titanium.Facebook.loggedIn);
	});
	//change top bar image
	self.barImage = '/images/corkboard.jpg';
	//change back button style
	var backbutton = Titanium.UI.createButton({
		title:'back', 
		// backgroundImage:'/images/corkboard.jpg',
		width:50,
		height:20
	});
	backbutton.addEventListener('click', function() {
		self.close();
	});
	self.leftNavButton = backbutton;
	//end
{'fraction_non_alphanumeric': 0.1704752275025278, 'fraction_numerical': 0.010717896865520727, 'mean_word_length': 3.1879762912785776, 'pattern_counts': {'":': 0, '<': 5, '<?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': 13, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7563667', 'n_tokens_mistral': 2000, 'n_tokens_neox': 1673, 'n_words': 311}