<commit_before>/*Create a Context Wrapper Object*/
var App = new Vue({
	info: 'Simple VueJS Inheritance',
	todos : [],
	Models : new Vue({
		info : 'Vue Collection of Models',
		Todo : klass(function (done, content) {
			this.done = done;
			this.content = content;
		})
	}),
	Views : new Vue({
		info : 'Vue Collection of Views'
	}),
	methods : {
		test : function () {
			console.log(App);
		}
	}
}) || {};

/*Creating and Adding New Todos Into Our App.Models.Todo Object Instance*/
var todo1 = new App.$options.Models.$options.Todo(false, 'Learn Javascript!');  
var todo2 = new App.$options.Models.$options.Todo(false, 'Learn VueJS!');
var todo3 = new App.$options.Models.$options.Todo(false, 'Do your homework!');
var todo4 = new App.$options.Models.$options.Todo(false, 'Have a rest.. :)');  

Array.prototype.push.apply(App.$options.todos, [todo1,todo2, todo3, todo4]);

/*Initialize the App*/
(function (App, Module) {
	'use strict';
	App.views = new Module({
		index : new Module({
			header : new Vue({
				el : 'header',
				data : {
					title: 'Header'
				},
				methods : {
					handlerClickHeaderText : function () {
						alert('Clicked on header title!');
					}
				}
			}),
			content : new Module({
				el : '#content',
				data: {
					title: 'To-Do List',
					text : 'Added todo items below...',
					todos: {
						title : 'Todos',
						data : App.$options.todos
					},
					newToDo : {
						done : false,
						content : ''
					}
				},
				methods : {
					handlerClickAddToDoButton : function () {
						App.$options.todos.push(this.newToDo);
						this.newToDo = {};
					}
				}
			}),
			footer : new Vue({
				el : 'footer',
				data : {
					title: 'Footer'
				},
				methods : {
					handlerClickFooterText : function () {
						alert('Clicked on footer title!');
					}
				}
			}),
		})
	});
}(App, Vue));<commit_msg>Added control of entering empty todos.<commit_after>/*Create a Context Wrapper Object*/
var App = new Vue({
	info: 'Simple VueJS Inheritance',
	todos : [],
	Models : new Vue({
		info : 'Vue Collection of Models',
		Todo : klass(function (done, content) {
			this.done = done;
			this.content = content;
		})
	}),
	Views : new Vue({
		info : 'Vue Collection of Views'
	}),
	methods : {
		test : function () {
			console.log(App);
		}
	}
}) || {};

/*Initialize the App*/
(function (App, Module) {
	'use strict';
	App.views = new Module({
		index : new Module({
			header : new Module({
				el : 'header',
				data : {
					title: 'Header'
				},
				methods : {
					handlerClickHeaderText : function () {
						alert('Clicked on header title!');
					}
				}
			}),
			content : new Module({
				el : '#content',
				data: {
					title: 'To-Do List',
					text : 'Added todo items below...',
					todos: {
						title : 'Todos',
						data : App.$options.todos
					},
					newToDo : {
						done : false,
						content : ''
					}
				},
				methods : {
					handlerClickAddToDoButton : function () {
						if (!this.isEmptyString(this.newToDo.content) && !this.isNull(this.newToDo.content) && !this.isUndefined(this.newToDo.content)) {
							App.$options.todos.push(this.newToDo);
							this.newToDo = {};
						}
					},
					isNull : function (obj) {
						return (typeof obj === null ? true : false);
					},
					isUndefined : function (obj) {
						return (typeof obj === 'undefined' ? true : false);
					},
					isEmptyString : function (str) {
						return (str == '' ? true : false);
					}
				}
			}),
			footer : new Module({
				el : 'footer',
				data : {
					title: 'Footer'
				},
				methods : {
					handlerClickFooterText : function () {
						alert('Clicked on footer title!');
					}
				}
			}),
		})
	});
}(App, Vue));
{'fraction_non_alphanumeric': 0.1652267818574514, 'fraction_numerical': 0.0021598272138228943, 'mean_word_length': 2.3620689655172415, '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': '3027813', 'n_tokens_mistral': 1655, 'n_tokens_neox': 1258, 'n_words': 305}