<commit_before>var Template = require('../index.js').Template;
var e = require('element.js').e;

Template.prototype.addItem = function (item) {
	this.e.pbody.append(item);
};

Template.prototype.setTitle = function (text) {
	this.e.phead.inner = [];
	this.e.phead.append(text);
};

Template.prototype.setFooter = function (text) {
	this.e.pfoot.inner = [];
	this.e.pfoot.append(text);
};

Template.prototype.setType = function (type) {
	this.body.removeClass([ 'panel-default', 'panel-primary', 'panel-success', 'panel-info', 'panel-warning', 'panel-danger' ]);
	this.body.addClass('panel-'+type);
};

var panel = new Template();
panel.e.phead = e.div([], { classes: [ 'panel-heading' ] });
panel.e.pbody = e.div([], { classes: [ 'panel-body' ] });
panel.e.pfoot = e.div([], { classes: [ 'panel-footer' ] });
panel.body = e.div([
	panel.e.phead,
	panel.e.pbody,
	panel.e.pfoot
], { classes: [ 'panel', 'panel-default' ] });
exports.Template = panel;<commit_msg>Don't add panel footer until actually set<commit_after>var Template = require('../index.js').Template;
var e = require('element.js').e;

Template.prototype.addItem = function (item) {
	this.e.pbody.append(item);
};

Template.prototype.setTitle = function (text) {
	this.e.phead.inner = [];
	this.e.phead.append(text);
};

Template.prototype.setFooter = function (text) {
	if (typeof this.e.pfoot == 'undefined') {
		this.e.pfoot = e.div([], { classes: [ 'panel-footer' ] });
	}
	this.e.pfoot.inner = [];
	this.e.pfoot.append(text);
};

Template.prototype.setType = function (type) {
	this.body.removeClass([ 'panel-default', 'panel-primary', 'panel-success', 'panel-info', 'panel-warning', 'panel-danger' ]);
	this.body.addClass('panel-'+type);
};

var panel = new Template();
panel.e.phead = e.div([], { classes: [ 'panel-heading' ] });
panel.e.pbody = e.div([], { classes: [ 'panel-body' ] });
//panel.e.pfoot = e.div([], { classes: [ 'panel-footer' ] });
panel.body = e.div([
	panel.e.phead,
	panel.e.pbody,
	panel.e.pfoot
], { classes: [ 'panel', 'panel-default' ] });
exports.Template = panel;
{'fraction_non_alphanumeric': 0.22292374939290918, 'fraction_numerical': 0.0, 'mean_word_length': 4.322997416020672, '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': '2713286', 'n_tokens_mistral': 760, 'n_tokens_neox': 755, 'n_words': 127}