<commit_before>wwm.shell = (function () {
	var jqMap;
	var KAKAO_KEY = '<KEY>';
	function setJqMap($con) {
		jqMap = {
			$con: $con,
			$view: $con.find('#view'),
			$modal: $con.find('#modal'),
			$kakaoLogin: $con.find('#kakao-login-btn')
		};
	}
	function onError (errorMsg, url, lineNumber, column, errorObj) {
		if (typeof errorMsg === 'string' && errorMsg.indexOf('Script error.') > -1) { return; }
		console.log('Error: ', errorMsg, ' Script: ' + url + ' Line: ' + lineNumber + ' Column: ' + column + ' StackTrace: ' + errorObj);
	}
	function initModule($con) {
		console.log('login: ' + localStorage.login);
		console.log('first: ' + localStorage.first)
		var logged = localStorage.login && JSON.parse(localStorage.login);
		var first = localStorage.first && JSON.parse(localStorage.first);
		setJqMap($con);
		Kakao.init(KAKAO_KEY);
		//if (first) {
		//	wwm.modal.initModule($('#wwm-intro').html());
		//}
		console.log('logged: ', logged);
		if (logged) {
			wwm.lobby.initModule(jqMap.$view);
		} else {
			$con.find('#view').html($('#wwm-login').html());
			setJqMap($con);
			jqMap.$kakaoLogin.on({
				click: function() {
					Kakao.Auth.login({
					        success: function(authObj) {
					        	localStorage.login = JSON.stringify(authObj);
							wwm.lobby.initModule(jqMap.$view);
					        },
					        fail: function(err) {
					        	alert(JSON.stringify(err))
					        }
					});
				},
				mouseover: function() {
					this.src = '/kakao_account_login_btn_medium_narrow_ov.png';
				},
				mouseout: function() {
					this.src = '/kakao_account_login_btn_medium_narrow.png';
				}
			});
		}
		$(window).on('error', onError);
	}
	return {
		initModule: initModule
	};
}());<commit_msg>add kakao api<commit_after>wwm.shell = (function () {
	var jqMap;
	var KAKAO_KEY = '<KEY>';
	function setJqMap($con) {
		jqMap = {
			$con: $con,
			$view: $con.find('#view'),
			$modal: $con.find('#modal'),
			$kakaoLogin: $con.find('#kakao-login-btn')
		};
	}
	function onError (errorMsg, url, lineNumber, column, errorObj) {
		if (typeof errorMsg === 'string' && errorMsg.indexOf('Script error.') > -1) { return; }
		console.log('Error: ', errorMsg, ' Script: ' + url + ' Line: ' + lineNumber + ' Column: ' + column + ' StackTrace: ' + errorObj);
	}
	function initModule($con) {
		console.log('login: ' + localStorage.login);
		console.log('first: ' + localStorage.first)
		var logged = localStorage.login && JSON.parse(localStorage.login);
		var first = localStorage.first && JSON.parse(localStorage.first);
		setJqMap($con);
		Kakao.init(KAKAO_KEY);
		//if (first) {
		//	wwm.modal.initModule($('#wwm-intro').html());
		//}
		console.log('logged: ', logged);
		if (logged) {
			wwm.lobby.initModule(jqMap.$view);
		} else {
			$con.find('#view').html($('#wwm-login').html());
			setJqMap($con);
			jqMap.$kakaoLogin.on({
				click: function() {
					Kakao.Auth.login({
					 success: function(authObj) {
					  Kakao.API.request({
    					url: '/v1/user/me',
       		success: function(res) {
       			localStorage.login = JSON.stringify(res);
								wwm.lobby.initModule(jqMap.$view);
    				 },
     				fail: function(error) {
    						 alert(JSON.stringify(error))
    						}
							});			     
						},
						fail: function(err) {
					  alert(JSON.stringify(err))
					 }
					});
				},
				mouseover: function() {
					this.src = '/kakao_account_login_btn_medium_narrow_ov.png';
				},
				mouseout: function() {
					this.src = '/kakao_account_login_btn_medium_narrow.png';
				}
			});
		}
		$(window).on('error', onError);
	}
	return {
		initModule: initModule
	};
}());
{'fraction_non_alphanumeric': 0.19005524861878453, 'fraction_numerical': 0.0008287292817679558, 'mean_word_length': 2.974753018660812, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '623666', 'n_tokens_mistral': 1568, 'n_tokens_neox': 1312, 'n_words': 200}