<commit_before>/* CUSTOM BINDING */
html.activeSelected = function (section) {
	var elm = html.element();
	var update = function () {
		var current = section();
		html.query('li', elm).each(function(ele) { html(ele).removeClass('active'); });
		html('li.' + current, elm).addClass('active');
	};
	update();
	section.subscribe(update);
	return this;
};

/* BINDING DATA TO UI */
(function() {
	var preventClick = function (e) {
		html(this).$(); // go to parent - aka LI tag
		if (html.hasClass('disabled') || html.hasClass('active')) {
			e.preventDefault ? e.preventDefault() : e.returnValue = false;
		};
	};
	
	var vm = html.module('viewModel');
	
	html('ul.nav').activeSelected(vm.section);
	html.query('ul.nav li a').each(function (el) {
		html(el).click(preventClick);
	});
	// bind data to show or hide section
	html('div.welcome').hidden(vm.isDataSectionDisplayed);
	html('div.content').visible(vm.isDataSectionDisplayed);
	
    html('ul.pagination').each(vm.totalPage, function(page, index) {<commit_msg>Fix a little bit for the example. Just modify visible binding (add isDisplayProp - true)<commit_after>/* CUSTOM BINDING */
html.activeSelected = function (section) {
	var elm = html.element();
	var update = function () {
		var current = section();
		html.query('li', elm).each(function(ele) { html(ele).removeClass('active'); });
		html('li.' + current, elm).addClass('active');
	};
	update();
	section.subscribe(update);
	return this;
};

/* BINDING DATA TO UI */
(function() {
	var preventClick = function (e) {
		html(this).$(); // go to parent - aka LI tag
		if (html.hasClass('disabled') || html.hasClass('active')) {
			e.preventDefault ? e.preventDefault() : e.returnValue = false;
		};
	};
	
	var vm = html.module('viewModel');
	
	html('ul.nav').activeSelected(vm.section);
	html.query('ul.nav li a').each(function (el) {
		html(el).click(preventClick);
	});
	// bind data to show or hide section
	html('div.welcome').hidden(vm.isDataSectionDisplayed, true);
	html('div.content').visible(vm.isDataSectionDisplayed, true);
	
    html('ul.pagination').each(vm.totalPage, function(page, index) {
{'fraction_non_alphanumeric': 0.18646474207288216, 'fraction_numerical': 0.0, 'mean_word_length': 4.490909090909091, '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': '3279545', 'n_tokens_mistral': 722, 'n_tokens_neox': 692, 'n_words': 153}