<commit_before>function bubbel(el){
	if(document.getElementById(el).getAttribute("multiple") && document.getElementById(el).getAttribute("multiple") != "false"){
		document.getElementById(el).setAttribute("data-class", document.getElementById(el).getAttribute("class") );
		document.getElementById(el).setAttribute("data-type", document.getElementById(el).getAttribute("type") );
		$("<"+"!-- \n --"+">").insertAfter( document.getElementById(el) ); 
		$('<button class="icononly form-control after" type="button"><i class="fa fa-fw fa-plus-square"></i></button>').attr('onClick',"bubbel_addsub('" + el + "', '');").insertAfter( document.getElementById(el) ); // 
		$('<ul id="' + el + '_div" data-counter="0" style="display: inline;" class="bubbel-multiple multiple"></ul>').insertAfter( document.getElementById(el) );
		$("#" + el + "_div").append( $("<"+"!-- \n --"+">") );
		document.getElementById(el).setAttribute("type", "hidden");
		var vj = document.getElementById(el).getAttribute("value");
		if( /^\[(.*)\]$/.test(vj) ){
			vj = $.parseJSON(vj);
		} else{ if( /^\{(.*)\}$/.test(vj) ){
			vj = $.parseJSON(vj);
		} else {
			vj = [vj];
		}}
		//alert(vj);
		//vj = ['c:/x','d:/z','e'];
		if($.isArray(vj) && vj.length > 0){
			for(i=0; i < vj.length ; i++){
				bubbel_addsub( el, vj[i] );
			}
		} else {
			bubbel_addsub( el, document.getElementById(el).getAttribute("value") );
		}
	}
	else {
		switch(document.getElementById(el).getAttribute("type")){
			case 'link':
				//alert(el + " is LINK");
				$('<div id="' + el + '_div0" style="display: inline;"></div>').attr('class','btn-group').insertAfter( document.getElementById(el) );
				$("#" + el + "_div0").append( $("<!-- \n\t --"+">"), $('<div></div>').attr('id', el + '_div1').attr('class','btn-group').attr('style','display: inline;'));
				$("#" + el + "_div1").append( $("<!-- \n\t --"+">"), $('<button><i class="fa fa-fw fa-link disabled"></i></button>').attr('id', el + '_linkbutton').attr('class','form-control icononly dropdown-toggle').attr('data-toggle','dropdown') );
				$("#" + el + "_div1").append( $("<!-- \n\t --"+">"), $('<ul></ul>').attr('id', el + '_linkmenu').attr('class','dropdown-menu dropdown-link-menu').attr('style','display: none; visibility: hidden;'));
				$("#" + el + "_linkmenu").append( $("<!-- \n\t --"+">"), $('<li><a id="' + el + '_targeturl" class="with-one-button" style="width: -moz-calc(100% - 30px); width: -webkit-calc(100% - 30px); width: calc(100% - 30px); display: inline-block;"><span class="none"><i class="fa fa-fw fa-external-link disabled nocursor"></i></span> <span id="' + el + '_target"></span></a><a onClick="link_rebuild(\'' + el + '\', \'link\', \'\');" style="display: inline; float: right; text-align: right; "><i class="fa fa-trash" style="width: 16px;"></i></a></li>'));
				$("#" + el + "_div0").append( $("<!-- \n\t --"+">"), $('<div></div>').attr('id', el+ "_div2").attr('class','btn-group'));
				$("#" + el + "_div2").append( $("<!-- \n\t --"+">"), $('<input></input>').attr('class', document.getElementById(el).getAttribute('class') + ' form-control with-one-button both').attr('id', el + '_desc').attr('type','text').attr('placeholder','description').attr('required','true').attr('onChange',"link_rebuild('" + el + "', 'desc', this.value);"));
				$("#" + el + "_div2").append( $("<!-- \n\t --"+">"), $('<button><i class="fa fa-fw fa-search"></i></button>').attr('data-toggle','dropdown').attr('onClick',(document.getElementById(el).getAttribute("data-search") == null ? "" : "link_search('" + el + "');" )).attr('class','form-control icononly after dropdown-toggle' + (document.getElementById(el).getAttribute('data-search') == null ? " disabled" : "") ));
				$("#" + el + "_div2").append( $("<!-- \n\t --"+">"), $('<ul><li>empty</li></ul>').attr('id', el + '_searchresult').attr('class','dropdown-menu dropdown-search-menu') );
				//document.getElementById(el).setAttribute('onChange',"link_populate('" + el + "');");
				document.getElementById(el).setAttribute('type','hidden');
				link_populate( el );
				break;
			case 'qtranslate':
				//alert(el + " is i18n");
				break;
			case 'table-2':
				//alert(el + " is 2-row TABLE");
				break;
		}
	}
}
function bubbel_addsub(el, value){
	if(document.getElementById(el).form.getAttribute('id') == null){ document.getElementById(el).form.setAttribute('id', "form_" + el); }

	var i = ( document.getElementById(el + "_div").getAttribute("data-counter") * 1);
	//alert(el + ' = ' + value);
	var obj = $('<input></input>').attr('id', el + '-' + i);
	var name = /^([^\[\]]+)(\[\])?$/.exec(document.getElementById(el).getAttribute("name"));
	obj.attr('name', name[1] + '[' + i + ']' );
	obj.attr('class', (document.getElementById(el).getAttribute("data-class") ? document.getElementById(el).getAttribute("data-class") : document.getElementById(el).getAttribute("class") ));
	//obj.addClass('multiple');
	obj.attr('value', value);
	obj.attr('type', (document.getElementById(el).getAttribute("data-type") ? document.getElementById(el).getAttribute("data-type") : document.getElementById(el).getAttribute("type") ) );
	if(document.getElementById(el).getAttribute('list')){ obj.attr('list', document.getElementById(el).getAttribute("list")); }
	if(document.getElementById(el).getAttribute('required')){ obj.attr('required', document.getElementById(el).getAttribute("required")); }
	if(document.getElementById(el).getAttribute('disabled')){ obj.attr('disabled', document.getElementById(el).getAttribute("disabled")); }
	if(document.getElementById(el).getAttribute('readonly')){ obj.attr('readonly', document.getElementById(el).getAttribute("readonly")); }
	if(document.getElementById(el).getAttribute('pattern')){ obj.attr('pattern', document.getElementById(el).getAttribute("pattern")); }
	if(document.getElementById(el).getAttribute('data-category')){ obj.attr('data-category', document.getElementById(el).getAttribute("data-category")); }
	if(document.getElementById(el).getAttribute('data-search')){ obj.attr('data-search', document.getElementById(el).getAttribute("data-search")); }
	obj.attr('form', (document.getElementById(el).getAttribute("form") ? document.getElementById(el).getAttribute("form") : document.getElementById(el).form.getAttribute("id") ) );
	$("#" + el + "_div").append( $('<li class="multiple-child"></li>').append($("<"+"!-- \n --"+">"), obj) , $("<"+"!-- \n --"+">") ); //$('<span class="multiple"></span>').append(obj)
	document.getElementById(el + "_div").setAttribute("data-counter", i + 1);
	bubbel(el + '-' + i);
}

function link_populate(el){
	if( /^(([^\~]+)[\~])?([^\:]+)[\:](.*)/.test(document.getElementById(el).getAttribute('value')) ){
	var analyse = /^(([^\~]+)[\~])?([^\:]+)[\:](.*)/.exec(document.getElementById(el).getAttribute('value'));
	//document.getElementById(el).setAttribute('value','');
	link_rebuild(el, 'link', analyse[3]);
	if(/^[\(]/.test(analyse[4])){
		var i = 0;
		while(/^[\(]/.test(analyse[4]) && i < 5){
			var cond = /^[\(]([^\)]+)[\)](.*)/.exec(analyse[4]);
			//alert(cond[1]);
			analyse[4] = cond[2];
			i = i + 1; 
		}
	}
	var dummy = /^[\:]?[\/]?(.*)/.exec(analyse[4]);<commit_msg>v0.1.3 better handling of attributes: required disabled readonly<commit_after>function bubbel(el){
	if(document.getElementById(el).getAttribute("multiple") && document.getElementById(el).getAttribute("multiple") != "false"){
		document.getElementById(el).setAttribute("data-class", document.getElementById(el).getAttribute("class") );
		document.getElementById(el).setAttribute("data-type", document.getElementById(el).getAttribute("type") );
		$("<"+"!-- \n --"+">").insertAfter( document.getElementById(el) ); 
		$('<button class="icononly form-control after" type="button"><i class="fa fa-fw fa-plus-square"></i></button>').attr('onClick',"bubbel_addsub('" + el + "', '');").insertAfter( document.getElementById(el) ); // 
		$('<ul id="' + el + '_div" data-counter="0" style="display: inline;" class="bubbel-multiple multiple"></ul>').insertAfter( document.getElementById(el) );
		$("#" + el + "_div").append( $("<"+"!-- \n --"+">") );
		document.getElementById(el).setAttribute("type", "hidden");
		var vj = document.getElementById(el).getAttribute("value");
		if( /^\[(.*)\]$/.test(vj) ){
			vj = $.parseJSON(vj);
		} else{ if( /^\{(.*)\}$/.test(vj) ){
			vj = $.parseJSON(vj);
		} else {
			vj = [vj];
		}}
		//alert(vj);
		//vj = ['c:/x','d:/z','e'];
		if($.isArray(vj) && vj.length > 0){
			for(i=0; i < vj.length ; i++){
				bubbel_addsub( el, vj[i] );
			}
		} else {
			bubbel_addsub( el, document.getElementById(el).getAttribute("value") );
		}
	}
	else {
		switch(document.getElementById(el).getAttribute("type")){
			case 'link':
				//alert(el + " is LINK");
				$('<div id="' + el + '_div0" style="display: inline;"></div>').attr('class','btn-group').insertAfter( document.getElementById(el) );
				$("#" + el + "_div0").append( $("<!-- \n\t --"+">"), $('<div></div>').attr('id', el + '_div1').attr('class','btn-group').attr('style','display: inline;'));
				$("#" + el + "_div1").append( $("<!-- \n\t --"+">"), $('<button><i class="fa fa-fw fa-link disabled"></i></button>').attr('id', el + '_linkbutton').attr('class','form-control icononly dropdown-toggle').attr('data-toggle','dropdown') );
				$("#" + el + "_div1").append( $("<!-- \n\t --"+">"), $('<ul></ul>').attr('id', el + '_linkmenu').attr('class','dropdown-menu dropdown-link-menu').attr('style','display: none; visibility: hidden;'));
				$("#" + el + "_linkmenu").append( $("<!-- \n\t --"+">"), $('<li><a id="' + el + '_targeturl" class="with-one-button" style="width: -moz-calc(100% - 30px); width: -webkit-calc(100% - 30px); width: calc(100% - 30px); display: inline-block;"><span class="none"><i class="fa fa-fw fa-external-link disabled nocursor"></i></span> <span id="' + el + '_target"></span></a><a onClick="link_rebuild(\'' + el + '\', \'link\', \'\');" style="display: inline; float: right; text-align: right; "><i class="fa fa-trash" style="width: 16px;"></i></a></li>'));
				$("#" + el + "_div0").append( $("<!-- \n\t --"+">"), $('<div></div>').attr('id', el+ "_div2").attr('class','btn-group'));
				var inputtype = "text";
				$("#" + el + "_div2").append( $("<!-- \n\t --"+">"), $('<input' + (document.getElementById(el).getAttribute("required") != null ? ' required="true"': '') + (document.getElementById(el).getAttribute("readonly") != null ? ' readonly="true"' : '') + (document.getElementById(el).getAttribute("disabled") != null ? ' disabled="true"' : '') + '></input>').attr('class', document.getElementById(el).getAttribute('class') + ' form-control with-one-button both').attr('id', el + '_desc').attr('type',inputtype).attr('placeholder',document.getElementById(el).getAttribute("placeholder")).attr('onChange',"link_rebuild('" + el + "', 'desc', this.value);"));
				$("#" + el + "_div2").append( $("<!-- \n\t --"+">"), $('<button><i class="fa fa-fw fa-search"></i></button>').attr('data-toggle','dropdown').attr('onClick',(document.getElementById(el).getAttribute("data-search") == null ? "" : "link_search('" + el + "');" )).attr('class','form-control icononly after dropdown-toggle' + (document.getElementById(el).getAttribute('data-search') == null ? " disabled" : "") ));
				$("#" + el + "_div2").append( $("<!-- \n\t --"+">"), $('<ul><li>empty</li></ul>').attr('id', el + '_searchresult').attr('class','dropdown-menu dropdown-search-menu') );
				//document.getElementById(el).setAttribute('onChange',"link_populate('" + el + "');");
				document.getElementById(el).setAttribute('type','hidden');
				link_populate( el );
				break;
			case 'qtranslate':
				//alert(el + " is i18n");
				break;
			case 'table-2':
				//alert(el + " is 2-row TABLE");
				break;
		}
	}
}
function bubbel_addsub(el, value){
	if(document.getElementById(el).form.getAttribute('id') == null){ document.getElementById(el).form.setAttribute('id', "form_" + el); }

	var i = ( document.getElementById(el + "_div").getAttribute("data-counter") * 1);
	//alert(el + ' = ' + value);
	var obj = $('<input></input>').attr('id', el + '-' + i);
	var name = /^([^\[\]]+)(\[\])?$/.exec(document.getElementById(el).getAttribute("name"));
	obj.attr('name', name[1] + '[' + i + ']' );
	obj.attr('class', (document.getElementById(el).getAttribute("data-class") != null ? document.getElementById(el).getAttribute("data-class") : (document.getElementById(el).getAttribute("class") != null ? document.getElementById(el).getAttribute("class") : "") ));
	//obj.addClass('multiple');
	obj.attr('value', value);
	obj.attr('type', (document.getElementById(el).getAttribute("data-type") != null ? document.getElementById(el).getAttribute("data-type") : (document.getElementById(el).getAttribute("type") != null ? document.getElementById(el).getAttribute("type") : "text" ) ));
	if(document.getElementById(el).getAttribute('list') != null){ obj.attr('list', document.getElementById(el).getAttribute("list")); }
	if(document.getElementById(el).getAttribute('required') != null){ obj.attr('required', document.getElementById(el).getAttribute("required")); }
	if(document.getElementById(el).getAttribute('disabled') != null){ obj.attr('disabled', document.getElementById(el).getAttribute("disabled")); }
	if(document.getElementById(el).getAttribute('readonly') != null){ obj.attr('readonly', document.getElementById(el).getAttribute("readonly")); }
	if(document.getElementById(el).getAttribute('pattern') != null){ obj.attr('pattern', document.getElementById(el).getAttribute("pattern")); }
	if(document.getElementById(el).getAttribute('data-category') != null){ obj.attr('data-category', document.getElementById(el).getAttribute("data-category")); }
	if(document.getElementById(el).getAttribute('data-search') != null){ obj.attr('data-search', document.getElementById(el).getAttribute("data-search")); }
	obj.attr('form', (document.getElementById(el).getAttribute("form") != null ? document.getElementById(el).getAttribute("form") : document.getElementById(el).form.getAttribute("id") ) );
	$("#" + el + "_div").append( $('<li class="multiple-child"></li>').append($("<"+"!-- \n --"+">"), obj) , $("<"+"!-- \n --"+">") ); //$('<span class="multiple"></span>').append(obj)
	document.getElementById(el + "_div").setAttribute("data-counter", i + 1);
	bubbel(el + '-' + i);
}

function link_populate(el){
	if( /^(([^\~]+)[\~])?([^\:]+)[\:](.*)/.test(document.getElementById(el).getAttribute('value')) ){
	var analyse = /^(([^\~]+)[\~])?([^\:]+)[\:](.*)/.exec(document.getElementById(el).getAttribute('value'));
	//document.getElementById(el).setAttribute('value','');
	link_rebuild(el, 'link', analyse[3]);
	if(/^[\(]/.test(analyse[4])){
		var i = 0;
		while(/^[\(]/.test(analyse[4]) && i < 5){
			var cond = /^[\(]([^\)]+)[\)](.*)/.exec(analyse[4]);
			//alert(cond[1]);
			analyse[4] = cond[2];
			i = i + 1; 
		}
	}
	var dummy = /^[\:]?[\/]?(.*)/.exec(analyse[4]);
{'fraction_non_alphanumeric': 0.2853297442799462, 'fraction_numerical': 0.006662180349932705, 'mean_word_length': 5.342723004694836, 'pattern_counts': {'":': 0, '<': 127, '<?xml version=': 0, '>': 125, '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': '4372005', 'n_tokens_mistral': 5107, 'n_tokens_neox': 4910, 'n_words': 684}