<commit_before>/*
// http://developer.appcelerator.com/question/93681/how-do-i-set-a-back-button-background-image-and-onclick-background-image#answer-168801
var btnBack = new Ti.UI.createButton({
    backgroundImage:'back.png',
    backgroundSelectedImage:'back.png',
    width:80,height:25
});
var win = new Ti.UI.createWindow({
    url:'index.js',
    leftNavButton:btnBack
});
btnBack.addEventListener('click', function(){
    win.close();
});
*/

$.submit.addEventListener("touchstart",  function(){$.submit.backgroundColor = "#9CC075";});
//$.submit.addEventListener("touchend",    function(){$.submit.backgroundColor = "#7C9A5B";});
$.submit.addEventListener("touchcancel", function(){$.submit.backgroundColor = "#7C9A5B";});

$.submit.addEventListener("touchend", function(e){
	Ti.API.info("Pressed button: Invite.");
	$.submit.backgroundColor = "#7C9A5B";	
	Ti.App.fireEvent('app:createGame', {friends: $.friends.value.split(',')});
});

// (?): https://developer.appcelerator.com/question/27291/button-inside-a-view---inside-a-tableviewrow
// (?): http://developer.appcelerator.com/question/124202/how-to-add-a-text-and-a-checkbox-on-a-tableviewrow
// My Data-array for Table-view
var checkboxArray = [];

Ti.App.fireEvent('app:requestFriendList');

Ti.App.addEventListener('app:friendListAcquired', function (message) {
	friends = message.friends;
	
	for (var key in friends) {
		checkboxArray.push({ hasCheck: false, title: friends[key].name, leftImage: 'http://graph.facebook.com/'+key+'/picture?type=small', uid: key });
	}
	
	// Make a UI searchbar that filters the contents of a UI tableview.
	var searchBar = Ti.UI.createSearchBar({
	    showCancel: false,				// button on far right
	    hintText: 'Invite friends...',  // placeholder text
	    //prompt: "to: ",				// centered text above field
	    top: 60,						// absolute position
	    //bottom: 50,
	    minHeight: 35,
	    barColor: 'white',
	    color: 'black',
	    //backgroundColor: "#fff",
	    //tintColor: "black",
	    //borderColor: "#444",
	    //borderRadius: 0,
	    //borderWidth: 1
	});
	var tableView = Ti.UI.createTableView({<commit_msg>Change in data structures coming from model<commit_after>/*
// http://developer.appcelerator.com/question/93681/how-do-i-set-a-back-button-background-image-and-onclick-background-image#answer-168801
var btnBack = new Ti.UI.createButton({
    backgroundImage:'back.png',
    backgroundSelectedImage:'back.png',
    width:80,height:25
});
var win = new Ti.UI.createWindow({
    url:'index.js',
    leftNavButton:btnBack
});
btnBack.addEventListener('click', function(){
    win.close();
});
*/

$.submit.addEventListener("touchstart",  function(){$.submit.backgroundColor = "#9CC075";});
//$.submit.addEventListener("touchend",    function(){$.submit.backgroundColor = "#7C9A5B";});
$.submit.addEventListener("touchcancel", function(){$.submit.backgroundColor = "#7C9A5B";});

$.submit.addEventListener("touchend", function(e){
	Ti.API.info("Pressed button: Invite.");
	$.submit.backgroundColor = "#7C9A5B";	
	Ti.App.fireEvent('app:createGame', {friends: $.friends.value.split(',')});
});

// (?): https://developer.appcelerator.com/question/27291/button-inside-a-view---inside-a-tableviewrow
// (?): http://developer.appcelerator.com/question/124202/how-to-add-a-text-and-a-checkbox-on-a-tableviewrow
// My Data-array for Table-view
var checkboxArray = [];

Ti.App.fireEvent('app:requestFriendList');

Ti.App.addEventListener('app:friendListAcquired', function (message) {
	friends = message.friends;
	
	for (var i = 0; i < friends.length; i++) {
		checkboxArray.push({ hasCheck: false, title: friends[i].name, leftImage: 'http://graph.facebook.com/'+friends[i].id+'/picture?type=small', uid: friends[i].id });
	}
	
	// Make a UI searchbar that filters the contents of a UI tableview.
	var searchBar = Ti.UI.createSearchBar({
	    showCancel: false,				// button on far right
	    hintText: 'Invite friends...',  // placeholder text
	    //prompt: "to: ",				// centered text above field
	    top: 60,						// absolute position
	    //bottom: 50,
	    minHeight: 35,
	    barColor: 'white',
	    color: 'black',
	    //backgroundColor: "#fff",
	    //tintColor: "black",
	    //borderColor: "#444",
	    //borderRadius: 0,
	    //borderWidth: 1
	});
	var tableView = Ti.UI.createTableView({
{'fraction_non_alphanumeric': 0.18382012053778396, 'fraction_numerical': 0.023412146499768197, 'mean_word_length': 3.994212962962963, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '86690', 'n_tokens_mistral': 1535, 'n_tokens_neox': 1396, 'n_words': 251}