<commit_before>/**
 * @fileoverview
 * Provides methods for connecting the app's frontend to the endpoints API.
 * 
 * @author <EMAIL> (<NAME>)
 * Based off of the hello-endpoints-archectype.
 */

var App = {
	Models: {},
	Collections: {},
	Views: {}
};

/**
 * function for returning a template underscore object.
 */
window.template = function(id) {
	return _.template( $('#' + id).html() );
};

/**
 * Account MVC
 */
App.Models.Account = Backbone.Model.extend({
	defaults: {
		id: '',
		username: '',
		email: '',
		dashboards: []
	}
});

App.Views.AccountPage = Backbone.View.extend({
	tagName: 'div',
	className: 'panel panel-default',
	template: template('account-view'),
	render: function() {
		var jsonModel = this.model.toJSON();
		this.$el.html(this.template(jsonModel));
		return this;
	}
});

App.Views.CreateDashboardModal = Backbone.View.extend({
	tagName: 'div',
	className: 'modal fade',
	id: 'create-dashboard-modal',
	template: template('modal-template'),
	attributes: {
		'tabindex': -1,
		'role': 'dialog'
	},
	render: function() {
		// extend the model with contextual modal content for rendering.
		$.extend(this.model, {title: 'Create new dashboard', subtitle: 'Select a profile', body: 'testing', callToAction: 'Create Dashboard'});
		// disable the call to action button, since this version of the modal template should have it.
//		var $ctaButton = ('#' + this.id).find('.modal-cta');
//		$ctaButton.removeClass('hidden');
		this.$el.html(this.template(this.model.toJSON()));
		return this;
	}
});

/**
 * Dashboard MVC
 */
App.Models.Dashboard = Backbone.Model.extend({
	defaults: {
		name: 'New Dashboard',
		widgets: []
	}
});

App.Collections.Dashboard = Backbone.Collection.extend({
	model: App.Models.Dashboard
});

/**<commit_msg>Remove toJSON from CreateDasboardModal render<commit_after>/**
 * @fileoverview
 * Provides methods for connecting the app's frontend to the endpoints API.
 * 
 * @author <EMAIL> (<NAME>)
 * Based off of the hello-endpoints-archectype.
 */

var App = {
	Models: {},
	Collections: {},
	Views: {}
};

/**
 * function for returning a template underscore object.
 */
window.template = function(id) {
	return _.template( $('#' + id).html() );
};

/**
 * Account MVC
 */
App.Models.Account = Backbone.Model.extend({
	defaults: {
		id: '',
		username: '',
		email: '',
		dashboards: []
	}
});

App.Views.AccountPage = Backbone.View.extend({
	tagName: 'div',
	className: 'panel panel-default',
	template: template('account-view'),
	render: function() {
		var jsonModel = this.model.toJSON();
		this.$el.html(this.template(jsonModel));
		return this;
	}
});

App.Views.CreateDashboardModal = Backbone.View.extend({
	tagName: 'div',
	className: 'modal fade',
	id: 'create-dashboard-modal',
	template: template('modal-template'),
	attributes: {
		'tabindex': -1,
		'role': 'dialog'
	},
	render: function() {
		// extend the model with contextual modal content for rendering.
		$.extend(this.model, {title: 'Create new dashboard', subtitle: 'Select a profile', body: 'testing', callToAction: 'Create Dashboard'});
		// disable the call to action button, since this version of the modal template should have it.
//		var $ctaButton = ('#' + this.id).find('.modal-cta');
//		$ctaButton.removeClass('hidden');
		this.$el.html(this.template(this.model));
		return this;
	}
});

/**
 * Dashboard MVC
 */
App.Models.Dashboard = Backbone.Model.extend({
	defaults: {
		name: 'New Dashboard',
		widgets: []
	}
});

App.Collections.Dashboard = Backbone.Collection.extend({
	model: App.Models.Dashboard
});

/**
{'fraction_non_alphanumeric': 0.17656998028724302, 'fraction_numerical': 0.000563221627710504, 'mean_word_length': 4.045454545454546, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2980064', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1169, 'n_words': 286}