<commit_before>//create the application namespace
define(
		[ "jquery", "core/com", "core/utils", "core/loader" ],
		function($, Communication, Utilities, Loader) {

			// private
			var modules = {};
			
		    // Listeners
		    var listenerList = {};
			
			var register = function(moduleId, parentId, binding) {
				//console.log("Registering:" + moduleID + " " + parentId);
				modules[moduleId] = {
					"id" : moduleId,
					"parentId" : parentId,
					"binding" : binding,
					"visited" : false,
					"instance" : null
				};
			};
			
			var registerAllContainers = function() {
				
				var selector = "[data-type='container']";
				
				//register all
				$(selector).each(function(indx, el) {
					register(
							el.getAttribute("id"), 
							$(el).parent().attr("id"),
							el.getAttribute("data-bind")
					);
				});
	
			};

			return {
				
				Communication : Communication,
				Utils : Utilities,
				Loader : Loader,
				

				loadGadgets : function(that, id) {
					var it = that;
					var selector;
					if (id) {
						selector = "#" + id + " [data-type='gadget']"
					} else {
						selector = "[data-type='gadget']";
					}
					$(selector).each(function(indx, el) {
						register(
								el.getAttribute("id"), 
								$(selector).attr("id"),
								el.getAttribute("data-bind")
						);
						it.startModule(el.getAttribute("id"));
					});
				},
				
				loadContainers : function(that, id, callback) {
					
					var selector;
					if (id) {
						selector = "#" + id;
					} else {
						id = page;
						selector ="#container";
					}
										
					var module;
					
					//get unvisited child module if exists
					$(selector).children("[data-type='container']").each(function(indx, el) {					
						if (modules[el.getAttribute("id")].visited == false) {
							module = modules[el.getAttribute("id")];
							return false;
						}
					});

					//if no unvisited child module exists, 
					//1: load end of current container
					//2: visit parent node
					if (module == undefined) {						
						module = modules[$(selector).attr("id")];

						var path = "container/" + module.binding.replace(/\./g, "/");

						Loader.loadController(module, path, function(controller) {								
							console.log("Container Started:" + module.id);
							controller.init(module.id);
							if (module.parentId != "container") {
								that.loadContainers(that, module.parentId, function() {
									that.loadGadgets(that);
								});
							} else {
								//end traversal
								callback(that);
							}																																						<commit_msg>data-bind values is not repeating anymore<commit_after>//create the application namespace
define(
		[ "jquery", "core/com", "core/utils", "core/loader" ],
		function($, Communication, Utilities, Loader) {

			// private
			var modules = {};
			
		    // Listeners
		    var listenerList = {};
			
			var register = function(moduleId, parentId, binding) {
				//console.log("Registering:" + moduleID + " " + parentId);
				modules[moduleId] = {
					"id" : moduleId,
					"parentId" : parentId,
					"binding" : binding,
					"visited" : false,
					"instance" : null
				};
			};
			
			var registerAllContainers = function() {
				
				var selector = "[data-type='container']";
				
				//register all
				$(selector).each(function(indx, el) {
					register(
							el.getAttribute("id"), 
							$(el).parent().attr("id"),
							el.getAttribute("data-bind")
					);
				});
	
			};

			return {
				
				Communication : Communication,
				Utils : Utilities,
				Loader : Loader,
				

				loadGadgets : function(that, id) {
					var it = that;
					var selector;
					if (id) {
						selector = "#" + id + " [data-type='gadget']"
					} else {
						selector = "[data-type='gadget']";
					}
					$(selector).each(function(indx, el) {
						register(
								el.getAttribute("id"), 
								$(selector).attr("id"),
								el.getAttribute("data-bind")
						);
						it.startModule(el.getAttribute("id"));
					});
				},
				
				loadContainers : function(that, id, callback) {
					
					var selector;
					if (id) {
						selector = "#" + id;
					} else {
						id = page;
						selector ="#container";
					}
										
					var module;
					
					//get unvisited child module if exists
					$(selector).children("[data-type='container']").each(function(indx, el) {					
						if (modules[el.getAttribute("id")].visited == false) {
							module = modules[el.getAttribute("id")];
							return false;
						}
					});

					//if no unvisited child module exists, 
					//1: load end of current container
					//2: visit parent node
					if (module == undefined) {						
						module = modules[$(selector).attr("id")];

						var path = "container/" + module.binding + "/" + module.binding;
						
						Loader.loadController(module, path, function(controller) {								
							console.log("Container Started:" + module.id);
							controller.init(module.id);
							if (module.parentId != "container") {
								that.loadContainers(that, module.parentId, function() {
									that.loadGadgets(that);
								});
							} else {
								//end traversal
								callback(that);
							}																																						
{'fraction_non_alphanumeric': 0.15617224880382774, 'fraction_numerical': 0.0007655502392344498, 'mean_word_length': 2.003448275862069, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7035700', 'n_tokens_mistral': 2374, 'n_tokens_neox': 1552, 'n_words': 320}