


/**
* COMPONENT_SCORE CLASS
*/
var component_score = new function() {

	
	this.init = function(id_wrapper) {

		if(page_globals.modo=='list') return false;

		$(function() {

			var wrapper 	= $('#'+id_wrapper);
			var canvas_id 	= $(wrapper).find('canvas').attr('id');
			var error_id 	= $(wrapper).find('DIV.div_error_score').attr('id');


			var	textarea_rel_tipo   = $(wrapper).data('textarea_rel_tipo');
			var	parent 				= $(wrapper).data('parent');
			var textarea_id 		= $("TEXTAREA[data-tipo='"+textarea_rel_tipo+"'][data-parent='"+parent+"']").attr('id');
				//console.log(error_id)

			if( $(wrapper).length !=1 ) return alert("wrapper not found") 
			if( $("TEXTAREA[data-tipo='"+textarea_rel_tipo+"'][data-parent='"+parent+"']").length !=1 ) return alert("component_text not found") 
			

			//$(wrapper).find('DIV.div_error_score').append(error_id)

		 // Vex.Flow.Artist.DEBUG = false;
		  //Vex.Flow.VexTab.DEBUG = false;

		 renderer = new Vex.Flow.Renderer($("#"+canvas_id)[0], Vex.Flow.Renderer.Backends.CANVAS);
		

		  artist 	= new Vex.Flow.Artist(10, 10, 600, {scale: 0.8});
		  vextab 	= new Vex.Flow.VexTab(artist);
		  vexplayer = new Vex.Flow.Player(artist,{
		  	'soundfont_url':DEDALO_ROOT_WEB+'/lib/vexflow/MIDI/soundfont/'
		  });

		  function render() {
			try {
			  vextab.reset();
			  artist.reset();
			  vextab.parse($("#"+textarea_id).val());
			  artist.render(renderer);
			  $("#"+error_id).text("");
			} catch (e) {
			  console.log(e);
			  $("#"+error_id).html(e.message.replace(/[\n]/g, '<br/>'));
			}
		  }

		  $("#"+textarea_id).keyup(_.throttle(render, 250));
		  render();
		 
		})//$(function() {
		//s};//end $(function() {

	}//end init

	


}; //end class
@@ -1,10 +1,22 @@
-%0A%0A
+//%22use strict%22
 %0A/**%0A* C
@@ -36,16 +36,20 @@
 E CLASS%0A
+*%0A*%0A
 */%0Avar c
@@ -83,17 +83,33 @@
 on() %7B%0A%0A
-%09
+%0A%09/**%0A%09* init%0A%09*/
 %0A%09this.i
@@ -123,26 +123,23 @@
 unction(
-id_wrapper
+options
 ) %7B%0A%0A%09%09i
@@ -182,16 +182,57 @@
 false;%0A%0A
+%09%09const wrapper_id = options.id_wrapper%0A%0A
 %09%09$(func
@@ -244,19 +244,21 @@
 ) %7B%0A%0A%09%09%09
-var
+const
  wrapper
@@ -267,26 +267,26 @@
 = $('#'+
-id_
 wrapper
+_id
 );%0A%09%09%09va
@@ -1750,16 +1750,30 @@
 on() %7B%0A%0A
+%09%09return true%0A
 %09%7D//end 

Unify INIT and update to ES6