<commit_before>//FirstView Component Constructor
function SupportChat()
{	
	var win = Ti.UI.createWindow({
		backgroundColor:'#ffffff',
		navBarHidden:true,
		height: Ti.UI.FILL
	});

	var hipmob = require("hipmobtitanium");
	var trimLeft = /^\s+/, trimRight = /\s+$/;
	var trim = function(inp){
		return inp.toString().replace(trimLeft,"").replace(trimRight,"");
	};
	
	// manage: 2ea7d86854df4ca185af84e68ea72fe1 
	// ha: 488b7ecc3a764176b50717278c6a9ea0
	var chatView = hipmob.createHipmobChatView({
		height: Ti.UI.FILL,
		width: Ti.UI.FILL,
		appId: "2ea7d86854df4ca185af84e68ea72fe1",
		name: "Femi",
		email: "<EMAIL>",
		context: "starting up with Appcelerator"
	});
	win.add(chatView)
	var on_connected = function(e){
    	chatView.setContext("Now connected");
	};
	var on_operator_online = function(e){
    	chatView.setContext("Operator online");
	};
	var on_operator_offline = function(e){
    	chatView.setContext("Operator online");
	};
	var on_disconnected = function(e){
		var dialog = Ti.UI.createAlertDialog({
    		message: 'Disconnected!',
    		ok: 'OK',
    		title: 'Hipmob' });
    	dialog.show();
    	setTimeout(function(){ dialog.hide(); }, 2000);
    	chatView.removeListener('disconnected', on_disconnected);
	};
	var on_url = function(e){
		var dialog = Ti.UI.createAlertDialog({
    		message: 'URL Received ['+e.url+']!',
    		ok: 'OK',
    		title: 'Hipmob' });
    	dialog.show();
    	setTimeout(function(){ dialog.hide(); }, 5000);
	};
	win.addEventListener('open', function(){
		chatView.addListener('connected', on_connected);
		chatView.addListener('disconnected', on_disconnected);
		chatView.addListener('operatoronline', on_operator_online);
		chatView.addListener('operatoroffline', on_operator_offline);
		chatView.addListener('url', on_url);
		chatView.start();
	});
	win.addEventListener('close', function(){
		chatView.removeListener('connected', on_connected);
		chatView.stop();
	});
	
	return win;
}

module.exports = SupportChat;<commit_msg>Updated the support chat window to use the actual constant values for the events.<commit_after>//FirstView Component Constructor
function SupportChat()
{	
	var win = Ti.UI.createWindow({
		backgroundColor:'#ffffff',
		navBarHidden:true,
		height: Ti.UI.FILL
	});

	var hipmob = require("hipmobtitanium");
	var trimLeft = /^\s+/, trimRight = /\s+$/;
	var trim = function(inp){
		return inp.toString().replace(trimLeft,"").replace(trimRight,"");
	};
	
	// manage: 2ea7d86854df4ca185af84e68ea72fe1 
	// ha: 488b7ecc3a764176b50717278c6a9ea0
	var chatView = hipmob.createHipmobChatView({
		height: Ti.UI.FILL,
		width: Ti.UI.FILL,
		appId: "2ea7d86854df4ca185af84e68ea72fe1",
		name: "Femi",
		email: "<EMAIL>",
		context: "starting up with Appcelerator"
	});
	win.add(chatView)
	var on_connected = function(e){
    	chatView.setContext("Now connected");
	};
	var on_operator_online = function(e){
    	chatView.setContext("Operator online");
	};
	var on_operator_offline = function(e){
    	chatView.setContext("Operator online");
	};
	var on_disconnected = function(e){
		var dialog = Ti.UI.createAlertDialog({
    		message: 'Disconnected!',
    		ok: 'OK',
    		title: 'Hipmob' });
    	dialog.show();
    	setTimeout(function(){ dialog.hide(); }, 2000);
    	chatView.removeListener(hipmob.EVENT_DISCONNECTED, on_disconnected);
	};
	var on_url = function(e){
		var dialog = Ti.UI.createAlertDialog({
    		message: 'URL Received ['+e.url+']!',
    		ok: 'OK',
    		title: 'Hipmob' });
    	dialog.show();
    	setTimeout(function(){ dialog.hide(); }, 5000);
	};
	win.addEventListener('open', function(){
		chatView.addListener(hipmob.EVENT_CONNECTED, on_connected);
		chatView.addListener(hipmob.EVENT_DISCONNECTED, on_disconnected);
		chatView.addListener(hipmob.EVENT_OPERATOR_ONLINE, on_operator_online);
		chatView.addListener(hipmob.EVENT_OPERATOR_OFFLINE, on_operator_offline);
		chatView.addListener(hipmob.EVENT_URL_RECEIVED, on_url);
		chatView.start();
	});
	win.addEventListener('close', function(){
		chatView.removeListener(hipmob.EVENT_CONNECTED, on_connected);
		chatView.stop();
	});
	
	return win;
}

module.exports = SupportChat;
{'fraction_non_alphanumeric': 0.15306615161757606, 'fraction_numerical': 0.0318686624818928, 'mean_word_length': 4.722375690607735, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3848297', 'n_tokens_mistral': 1599, 'n_tokens_neox': 1469, 'n_words': 254}