<commit_before>// **************************************************************** //
// filet.js - Main client side socket listeners and document load functions 

// Resize the center divs to the view
$(function(){
	$(window).load(function(){
		$(".hostView").mCustomScrollbar();
    });
	
	$('.container, .centered').css({ height: $(window).innerHeight()/1.5 }); 
	$(window).resize(function(){
		$('.container, .centered').css({ height: $(window).innerHeight()/1.5 });
	});
});

var socket = io.connect('http://0.0.0.0:1337', {
    autoConnect: true,
	secure: true
});

// Server connection listener
socket.on('connect', function() {
    console.log('Client has connected to the server!');
});

// Received data listener
socket.once('message', function(data) {
    console.log('Received data from the server: '+JSON.stringify(data));
});

// SFTP connection status listener
socket.on('status', function(message) {
    console.log('SFTP connection status: '+ message);
});

// Listen for when to toggle the view  
socket.once('view', function(view) {
	// ^ once to eliminate duplicate instances of views
	if(view.ui == 'hosts') showAppView(view);	
	else if(view.ui == 'login') showLoginView(); 
});

// Listen for when to update the local/remote directory listing 
socket.on('update', function(info) {
	showDirectory(info.path, info.files, info.panel);
});

// Listen for an error and deploy an error message
socket.on('error', function(err) {
	console.log('o_o');
	errorMessage(err);
});

// **************************************************************** //

function connect() {	
	console.log("Connecting to sftp server...");
	var data = {};
	data.hostname = document.getElementById('hostname').value;	
	data.port = document.getElementById('port').value;	
	data.username = document.getElementById('username').value;	
	data.password = document.getElementById('password').value;	

	socket.emit('message', data);
}

function clean() {
	document.getElementById('hostname').value = '';	
	document.getElementById('port').value = '';
	document.getElementById('username').value = '';
	document.getElementById('password').value = '';
}

// **************************************************************** //<commit_msg>Added a socket listener to trigger the progress bar upon file transfer<commit_after>// **************************************************************** //
// filet.js - Main client side socket listeners and document load functions 

// Resize the center divs to the view
$(function(){
	$(window).load(function(){
		$(".hostView").mCustomScrollbar();
    });
	
	$('.container, .centered').css({ height: $(window).innerHeight()/1.5 }); 
	$(window).resize(function(){
		$('.container, .centered').css({ height: $(window).innerHeight()/1.5 });
	});
});

var socket = io.connect('http://0.0.0.0:1337', {
    autoConnect: true,
	secure: true
});

// Server connection listener
socket.on('connect', function() {
    console.log('Client has connected to the server!');
});

// Received data listener
socket.once('message', function(data) {
    console.log('Received data from the server: '+JSON.stringify(data));
});

// SFTP connection status listener
socket.on('status', function(message) {
    console.log('SFTP connection status: '+ message);
});

// Listen for when to toggle the view  
socket.once('view', function(view) {
	// ^ once to eliminate duplicate instances of views
	if(view.ui == 'hosts') showAppView(view);	
	else if(view.ui == 'login') showLoginView(); 
});

// Listen for when to update the local/remote directory listing 
socket.on('update', function(info) {
	showDirectory(info.path, info.files, info.panel);
});

// Listen for when a file transfer percentage is retrieved from the server
socket.on('progress', function(percent) {
	console.log("Percent: "+percent);
});

// Listen for an error and deploy an error message
socket.on('error', function(err) {
	console.log('o_o');
	errorMessage(err);
});

// **************************************************************** //

function connect() {	
	console.log("Connecting to sftp server...");
	var data = {};
	data.hostname = document.getElementById('hostname').value;	
	data.port = document.getElementById('port').value;	
	data.username = document.getElementById('username').value;	
	data.password = document.getElementById('password').value;	

	socket.emit('message', data);
}

function clean() {
	document.getElementById('hostname').value = '';	
	document.getElementById('port').value = '';
	document.getElementById('username').value = '';
	document.getElementById('password').value = '';
}

// **************************************************************** //
{'fraction_non_alphanumeric': 0.2491386735572782, 'fraction_numerical': 0.00516795865633075, 'mean_word_length': 4.947503201024328, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '5067046', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1259, 'n_words': 313}