<commit_before><!-- NOT FINISHED -->
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8" />
	<title>Basic Bugle Example</title>
	<script src="./../bugle.js"></script>
</head>
<body>
	<div id="todo-pane">
		<ul id="todo-list"></ul>
		<div>
			<label>add an item:</label>
			<input id="todo-newItem" type="text" value="Git Push"></input>
			<button id="todo-add">Add Item</button>
		</div>
	</div>
	<script>

		// this object stores todo items 
		// these todo items can be appended to the dom using 'updateUI'
		var todo = function(handle) {
				
			var list = document.getElementById(handle);

			return {
				
				items: [
					'git status',
					'git diff',
					'git commit'
				],

				// will be called by Bugle once the user adds a new todo item
				addItem: function(item, topic) { 
					this.items.push(item);
					this.draw();
				},

				// keep it simple for now
				draw: function() {

					list.innerHTML = '';

					for(var item in this.items) {
						list.innerHTML += '<li>' + this.items[item] + '</li>';
					}
				}
			};
		},

		// general set up of feature with starting state
		todoInstance = todo('todo-list'),
		
		// create a Bugle
		bugle = Bugle();

		// draw the starting ui state
		todoInstance.draw();

		// sub the todo feature on the 'add' topic using addItem as the event listener
		todoId = bugle.sub('add', todoInstance, 'addItem');

		// handle to our todo add item button
		var todoAdd = document.getElementById('todo-add');

		// attach an event listener to our button
		todoAdd.addEventListener('click', function() {
			
			// get the todo value set in the text box
			var item = document.getElementById('todo-newItem').value;

			// pub to all subscribers of the 'add' topic (todoInstance current)
			bugle.pub('add', item);

		}, false)

	</script>
</body>
</html><commit_msg>updated dom example with new Bugle extends feature<commit_after><!-- NOT FINISHED -->
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8" />
	<title>Basic Bugle Example</title>
	<script src="./../bugle.js"></script>
</head>
<body>
	<div id="todo-pane">
		<ul id="todo-list"></ul>
		<div>
			<label>add an item:</label>
			<input id="todo-newItem" type="text" value="Git Push"></input>
			<button id="todo-add">Add Item</button>
		</div>
	</div>
	<script>

		// this object stores todo items 
		// these todo items can be appended to the dom using 'updateUI'

		// create a new Bugle instance
		var	CustomBugle = Bugle({

			// handle to our todo list
			'list': document.getElementById('todo-list'),

			// construct our new Bugle under the hood
			'_init': function() {
				
				this.draw();

				// subscribe this object instance to the 'add' topic
				// call 'addItem' when data is published to the topic
				this.sub('add', this, 'addItem');
			},
				
			'items': [
				'git status',
				'git diff',
				'git commit'
			],

			// will be called by Bugle once the user adds a new todo item
			'addItem': function(item, topic) { 
				this.items.push(item);
				this.draw();
			},

			// keep it simple for now
			'draw': function() {

				this.list.innerHTML = '';

				for(var item in this.items) {
					this.list.innerHTML += '<li>' + this.items[item] + '</li>';
				}
			}

		});

		// run our custom bugle instance
		// note: passes object args to '_init' member
		var bugle = CustomBugle(),

		// handle to our todo add item button
		todoAdd = document.getElementById('todo-add');

		// attach an event listener to our button
		todoAdd.addEventListener('click', function() {
			
			// get the todo value set in the text box
			var item = document.getElementById('todo-newItem').value;

			// publish input text value to the 'add' topic
			bugle.pub('add', item);

		}, false)

	</script>
</body>
</html>
{'fraction_non_alphanumeric': 0.15522788203753352, 'fraction_numerical': 0.0005361930294906167, 'mean_word_length': 2.776315789473684, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 61, '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': '2309726', 'n_tokens_mistral': 1469, 'n_tokens_neox': 1191, 'n_words': 387}