<commit_before>wn.ui.AppFrame = Class.extend({
	init: function(parent, title) {
		this.buttons = {};
		this.$w = $('<div></div>').appendTo(parent);
		
		this.$titlebar = $('<div class="appframe-titlebar">\
			<span class="appframe-title"></span>\
			<span class="close">&times;</span>\
		</div>').appendTo(this.$w);

		this.$w.find('.close').click(function() {
			window.history.back();
		})
		
		if(title) this.title(title);

	},
	title: function(txt) {
		this.$titlebar.find('.appframe-title').html(txt);
	},
	add_button: function(label, click, icon) {
		this.add_toolbar();

		args = { label: label, icon:'' };
		if(icon) {
			args.icon = '<i class="'+icon+'"></i>';
		}
		this.buttons[label] = $(repl('<button class="btn btn-small">\
			%(icon)s %(label)s</button>', args))
			.click(click)
			.appendTo(this.toolbar);
		return this.buttons[label];
	},
	clear_buttons: function() {
		this.toolbar.empty();
	},
	add_toolbar: function() {
		if(!this.toolbar)
			this.$w.append('<div class="appframe-toolbar"></div>');
		this.toolbar = this.$w.find('.appframe-toolbar');
	},
	add_select: function(label, options) {
		this.add_toolbar();
		return $("<select style='width: 160px;'>").add_options(options).appendTo(this.add_label(label));
	},
	add_label: function(label) {
		return $("<span style='margin-right: 12px;'>"+label+" </span>").appendTo(this.toolbar);
	},
	add_date: function(label, date) {
		this.add_toolbar();
		return $("<input style='width: 80px;'>").datepicker({
			dateFormat: sys_defaults.date_format.replace("yyyy", "yy"),
			changeYear: true,
		}).val(dateutil.str_to_user(date) || "").appendTo(this.add_label(label));
	},
});

// parent, title, single_column<commit_msg>appframe bugfix<commit_after>wn.ui.AppFrame = Class.extend({
	init: function(parent, title) {
		this.buttons = {};
		this.$w = $('<div></div>').appendTo(parent);
		
		this.$titlebar = $('<div class="appframe-titlebar">\
			<span class="appframe-title"></span>\
			<span class="close">&times;</span>\
		</div>').appendTo(this.$w);

		this.$w.find('.close').click(function() {
			window.history.back();
		})
		
		if(title) this.title(title);

	},
	title: function(txt) {
		this.$titlebar.find('.appframe-title').html(txt);
	},
	add_button: function(label, click, icon) {
		this.add_toolbar();

		args = { label: label, icon:'' };
		if(icon) {
			args.icon = '<i class="'+icon+'"></i>';
		}
		this.buttons[label] = $(repl('<button class="btn btn-small">\
			%(icon)s %(label)s</button>', args))
			.click(click)
			.appendTo(this.toolbar);
		return this.buttons[label];
	},
	clear_buttons: function() {
		this.toolbar && this.toolbar.empty();
	},
	add_toolbar: function() {
		if(!this.toolbar)
			this.$w.append('<div class="appframe-toolbar"></div>');
		this.toolbar = this.$w.find('.appframe-toolbar');
	},
	add_select: function(label, options) {
		this.add_toolbar();
		return $("<select style='width: 160px;'>").add_options(options).appendTo(this.add_label(label));
	},
	add_label: function(label) {
		return $("<span style='margin-right: 12px;'>"+label+" </span>").appendTo(this.toolbar);
	},
	add_date: function(label, date) {
		this.add_toolbar();
		return $("<input style='width: 80px;'>").datepicker({
			dateFormat: sys_defaults.date_format.replace("yyyy", "yy"),
			changeYear: true,
		}).val(dateutil.str_to_user(date) || "").appendTo(this.add_label(label));
	},
});

// parent, title, single_column
{'fraction_non_alphanumeric': 0.22984108298999412, 'fraction_numerical': 0.004120070629782225, 'mean_word_length': 4.693467336683417, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, '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': '5590067', 'n_tokens_mistral': 1330, 'n_tokens_neox': 1207, 'n_words': 181}