<commit_before>
//Widget Generic Component Constructor

function widgetGeneric(dim, parameters, idWidget) {
	
	var _isApple = (Ti.Platform.osname == 'ipad');
	var _self;
	if(parameters.name.indexOf("map-viewer") !== -1){
		var _widgetMapClass = require("ui/widgets/widgetMap");
		_self = _widgetMapClass({height: dim.height, width: dim.width}, idWidget);
		_widgetMapClass = null;
	}
	else{
		var _routeHTML = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'widgets/'+parameters.uri+'/index.html');
		var _textHTML = _routeHTML.read().toString();
		if(_textHTML.search('mashupPlatform.js') < 0){
			var _fileMashupPlatform = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'widgets/'+parameters.uri+'/mashupPlatform.js');
			var _textMashupOriginal = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'ui/lib/mashupPlatform.js').read().toString();
			_fileMashupPlatform.write(_textMashupOriginal, false);
			_textMashupOriginal = null;
			_fileMashupPlatform = null;
			var _routeMashup = '\t\t<script type="text/javascript" src="mashupPlatform.js"></script>';
			_routeMashup = '<head>\n' + _routeMashup;
			_textHTML = _textHTML.replace('<head>',_routeMashup); 
			_routeHTML.write(_textHTML,false);
			_routeMashup = null;<commit_msg>widget generic update, use of configuration (main html)<commit_after>
//Widget Generic Component Constructor

function widgetGeneric(dim, parameters, idWidget) {
	
	var _isApple = (Ti.Platform.osname == 'ipad');
	var _self;
	if(parameters.name.indexOf("map-viewer") !== -1){
		var _widgetMapClass = require("ui/widgets/widgetMap");
		_self = _widgetMapClass({height: dim.height, width: dim.width}, idWidget);
		_widgetMapClass = null;
	}
	else{
		var _routeHTML = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'widgets/'+parameters.uri+'/TIWebView');
		_routeHTML = _routeHTML.read().toString();
		_routeHTML = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'widgets/'+parameters.uri+'/'+_routeHTML);
		var _textHTML = _routeHTML.read().toString();
		if(_textHTML.search('mashupPlatform.js') < 0){
			var _fileMashupPlatform = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'widgets/'+parameters.uri+'/mashupPlatform.js');
			var _textMashupOriginal = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, 'ui/lib/mashupPlatform.js').read().toString();
			_fileMashupPlatform.write(_textMashupOriginal, false);
			_textMashupOriginal = null;
			_fileMashupPlatform = null;
			var _routeMashup = '\t\t<script type="text/javascript" src="mashupPlatform.js"></script>';
			_routeMashup = '<head>\n' + _routeMashup;
			_textHTML = _textHTML.replace('<head>',_routeMashup); 
			_routeHTML.write(_textHTML,false);
			_routeMashup = null;
{'fraction_non_alphanumeric': 0.14716569767441862, 'fraction_numerical': 0.0014534883720930232, 'mean_word_length': 5.934508816120907, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '1986912', 'n_tokens_mistral': 988, 'n_tokens_neox': 909, 'n_words': 141}