<commit_before>$(document).ready(function(){
	PureWebSocket.connect();
	
	$("#pureCanvas").pureCanvas({
	});
	$("#pureCanvas").pureCanvas('setting', 'backgroundImage', {
		imageSrc: 'http://spnimage.edaily.co.kr/images/photo/files/NP/S/2015/05/PS15051800042.jpg',
		callback: function(imageInfo){
			var data = imageInfo;
			data.eventType = 'bg';
			
			PureWebSocket.send(data);
		}
	});
	
	$("#pureCanvas").on('complate.draw.pureCanvas', function(e){
		var data = e.drawData;
		var timeStamp = e.timeStamp;
		data.eventType = 'draw';
		
		PureWebSocket.send(data);
	});
	
//	$("#pureCanvas").on('show.bg.pureCanvas', function(e){
//		var data = e.imageData;
//		data.eventType = 'bg';
//		
//		PureWebSocket.send(data);
//	});
	
	$("#pureCanvas").on('canvas-resize.pureCanvas', function(e){
	});
	
	$("#pureCanvas").on('scroll-move.pureCanvas', function(e){
		var data = e.scrollData;
		data.eventType = 'scroll';
		
		PureWebSocket.send(data);
	});
	
	$("#pureCanvas").on('history.pureCanvas', function(e){
		var data = e.historyData;
		data.eventType = 'history';
		
		PureWebSocket.send(data);
	});

	//////////////////////////////////////////////////////////////////
	
	$("#rate").on("input", function(){
		var $this = $(this);
		
		var data = {
			eventType: 'zoom',
			type: 'rate',
			rateVal: $this.val()
		}
		
		PureWebSocket.send(data);
	});
	
	$("#page").on("click", function(){
		var $this = $(this);
		
		var data = {
			eventType: 'zoom',
			type: 'page',
		}
		
		PureWebSocket.send(data);
	});
	
	
	$("[data-pure-canvas-option]").on('click input change', function(e){
		var $this = $(this);
		
		if($this.attr('type')  == 'file'  && !$this.val()){
			return;
		}
		
		var optionName = $this.attr('data-pure-canvas-option');
		var optionType = $this.attr('data-pure-canvas-type');
		
		var value;
		if($this.attr('data-pure-canvas-value') == 'rate'){
			value = {'type': 'rate', 'rateVal': $this.val()};
		}
		else if(optionType == 'type' || $this.attr('data-pure-canvas-value')){
			value = $this.attr('data-pure-canvas-value');
		}
		else if(optionType == 'backgroundImage'){
			value = {
					imageSrc: $this.prev().val(),
				callback: function(imageInfo){
					var data = imageInfo;
					data.eventType = 'bg';
					
					PureWebSocket.send(data);
				}
			}
		}
		else{
			value = $this.val();
		}
		
		$("#pureCanvas").pureCanvas(optionName, optionType, value);
		
	});
	
	$(window).on('resize', function(){
		var body = $(document.body);
		$("#pureCanvas").css({width: $(window).width() - 350, height: $(window).height() - 50});
	});
	
});


var PureWebSocket = {
	url: 'ws://172.16.34.77:9090/testerweb/ws/default',
	ws: null,
<commit_msg>줌 기능 추가<commit_after>$(document).ready(function(){
	PureWebSocket.connect();
	
	$("#pureCanvas").pureCanvas({
	});
	/*$("#pureCanvas").pureCanvas('setting', 'backgroundImage', {
		imageSrc: 'http://spnimage.edaily.co.kr/images/photo/files/NP/S/2015/05/PS15051800042.jpg',
		callback: function(imageInfo){
			var data = imageInfo;
			data.eventType = 'bg';
			
			PureWebSocket.send(data);
		}
	});*/
	
	$("#pureCanvas").on('complate.draw.pureCanvas', function(e){
		var data = e.drawData;
		var timeStamp = e.timeStamp;
		data.eventType = 'draw';
		
		PureWebSocket.send(data);
	});
	
//	$("#pureCanvas").on('show.bg.pureCanvas', function(e){
//		var data = e.imageData;
//		data.eventType = 'bg';
//		
//		PureWebSocket.send(data);
//	});
	
	$("#pureCanvas").on('canvas-resize.pureCanvas', function(e){
	});
	
	$("#pureCanvas").on('scroll-move.pureCanvas', function(e){
		var data = e.scrollData;
		data.eventType = 'scroll';
		
		PureWebSocket.send(data);
	});
	
	$("#pureCanvas").on('history.pureCanvas', function(e){
		var data = e.historyData;
		data.eventType = 'history';
		
		PureWebSocket.send(data);
	});

	//////////////////////////////////////////////////////////////////
	
	$("#rate").on("input", function(){
		var $this = $(this);
		
		var data = {
			eventType: 'zoom',
			type: 'rate',
			rateVal: $this.val()
		}
		$('#rateval').html($this.val());
		PureWebSocket.send(data);
	});
	
	$("#page").on("click", function(){
		var $this = $(this);
		
		var data = {
			eventType: 'zoom',
			type: 'page',
		}
		
		PureWebSocket.send(data);
	});
	
	
	$("[data-pure-canvas-option]").on('click input change', function(e){
		var $this = $(this);
		
		if($this.attr('type')  == 'file'  && !$this.val()){
			return;
		}
		
		var optionName = $this.attr('data-pure-canvas-option');
		var optionType = $this.attr('data-pure-canvas-type');
		
		var value;
		if($this.attr('data-pure-canvas-value') == 'rate'){
			value = {'type': 'rate', 'rateVal': $this.val()};
		}
		else if($this.attr('data-pure-canvas-type') == 'zoom'){
			var zoom = Number($('#zoom').val());
			if($this.attr('id') == 'zoomprev'){
				zoom = zoom + 10;
			}else{
				zoom = zoom - 10;
			}
			value = zoom / 100;
			$('#zoom').val(zoom);
		}
		else if(optionType == 'type' || $this.attr('data-pure-canvas-value')){
			value = $this.attr('data-pure-canvas-value');
		}
		else if(optionType == 'backgroundImage'){
			value = {
					imageSrc: $this.prev().val(),
				callback: function(imageInfo){
					var data = imageInfo;
					data.eventType = 'bg';
					
					PureWebSocket.send(data);
				}
			}
		}
		else{
			value = $this.val();
		}
		
		$("#pureCanvas").pureCanvas(optionName, optionType, value);
		
	});
	
	var r = function(){
		var body = $(document.body);
		$("#pureCanvas").css({width: $(window).width() - 350, height: $(window).height() - 50});
		$("#pureCanvas").pureCanvas('resize');
	}

	$(window).on('resize', function(){
		r();
	});
	//r();
});


var PureWebSocket = {
	url: 'ws://172.16.34.77:9090/testerweb/ws/default',
	ws: null,

{'fraction_non_alphanumeric': 0.24600246002460024, 'fraction_numerical': 0.013530135301353014, 'mean_word_length': 3.1276287164612038, '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': '4357265', 'n_tokens_mistral': 2448, 'n_tokens_neox': 2043, 'n_words': 322}