<commit_before>
function Session( session_type, callback ) {
	this.brush = null;


	this.TYPE


	var session_id = null;
	this.user_id = null;

	function initialize() {
		// get session info from 
		$.ajax({
		    // FIXME: request with previous user_id
		    url: "/api/session/join?type="+session_type,
		    ataType: "json",
		    type: 'GET',
		    context: this,
		    success: function( user_id ){
			this.user_id = user_id;
			
			// FIXME: set cookie with user_id for next time
			alert('got user id : ' + this.user_id );

			callback( this );
		    }
		});
	}

	initialize();
}

Session.prototype.SESSION_JOIN = "/api/session/join";
Session.prototype.SESSION_LEAVE = "/api/session/leave";
Session.prototype.TYPE_DRAW = "draw";
Session.prototype.TYPE_VIEW = "view";
<commit_msg>js session: declared some SESSION_* constants.<commit_after>
const SESSION_URL_JOIN = "/api/session/join";
const SESSION_URL_LEAVE = "/api/session/leave";
const SESSION_TYPE_DRAW = "draw";
const SESSION_TYPE_VIEW = "view";

function Session( session_type, callback ) {
	this.brush = null;

	var session_id = null;
	this.user_id = null;

	// get session info from 
	$.ajax({
	    // FIXME: request with previous user_id
	    url: SESSION_URL_JOIN + "?type=" + session_type,
	    ataType: "json",
	    type: 'GET',
	    context: this,
	    success: function( user_id ){
		this.user_id = user_id;

		// FIXME: set cookie with user_id for next time
		console.log('got user id : ' + this.user_id );

		callback( this );
	    }
	});
}


{'fraction_non_alphanumeric': 0.13333333333333333, 'fraction_numerical': 0.0, 'mean_word_length': 3.1878453038674035, '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': '618766', 'n_tokens_mistral': 561, 'n_tokens_neox': 506, 'n_words': 129}