 
 // https://goodies.pixabay.com/jquery/tag-editor/demo.html

 

$.get("/tags", function(data, status){
	$('#tags').tagEditor({ 
		autocomplete: {
      	  	delay: 0, // show suggestions immediately
        	position: { collision: 'flip' }, // automatic menu position up/down
        	source: data.result
        },		
		maxLength: 25, 
		placeholder: 'Enter tags ...' 		
	});
});

$.get("/report", function(data, status){
	$('#report').text(data.report);	
});

$('#collect').submit(function(e) {
	e.preventDefault();
	args = $(this).serialize();	
	$.get('/collect?'+ args, function(data) {
		console.log(data);
		$('#serv').append(data.msg + "<br>");
		$('#report').text(data.report);		
	});
});
