<commit_before>boomDialog.prototype = {
 	cancelButton : {
		text : 'Cancel',
		icons : { primary : 'b-button-icon-cancel b-button-icon' },
		class : 'b-button',
		click : function() {
			var boomDialog = $(this).dialog('option', 'boomDialog');
			boomDialog.cancel();
		}
	},

	closeButton : {
		text : 'Okay',
		class : 'b-button',
		icons : { primary : 'b-button-icon-accept b-button-icon' },
		click : function() {
			var boomDialog = $(this).dialog('option', 'boomDialog');
			boomDialog.close();
		}
	}
};

function boomDialog(options) {
	var self = this;

	this.deferred = new $.Deferred().always(function() {
		$.boom.page && $.boom.page.toolbar && $.boom.page.toolbar.minimise();
	});

	this.options = $.extend({
		width: 'auto',
		autoOpen: true,
		modal: true,
		resizable: false,
		draggable: true,
		closeOnEscape: true,
		position: ['center', 'center'],
		dialogClass : 'b-dialog',
		buttons: [this.cancelButton, this.closeButton],
		boomDialog: this
	}, options);

	boomDialog.prototype.always = function(callback) {
		this.deferred.always(callback);

		return this;
	};

	boomDialog.prototype.cancel = function() {
		this.deferred.rejectWith(this.dialog);
		this.contents.dialog('destroy');
	};

	boomDialog.prototype.close = function() {
		this.deferred.resolveWith(this.dialog);
		this.contents.dialog('destroy');
	};

	boomDialog.prototype.done = function(callback) {
		this.deferred.done(callback);

		return this;
	};

	boomDialog.prototype.fail = function(callback) {
		this.deferred.fail(callback);

		return this;
	};

	boomDialog.prototype.init = function() {
		var boomDialog = this;

		$.boom.page && $.boom.page.toolbar && $.boom.page.toolbar.maximise();

		this
			.contents
			.dialog(this.options)
			.ui();

		this.contents.dialog('option', 'position', {my: "center center", at: "center center", of: top});

		this.contents.find('img').load(function() {
			boomDialog.contents.dialog('option', 'position', {my: "center center", at: "center center", of: top});
		});
	};

	boomDialog.prototype.open = function() {
		var id = this.options.id? this.options.id : $.boom.util.dom.uniqueId('boom-dialog-'),
			self = this;

		this.contents = $('#' + id).length? $('#' + id) : $('<div />').attr('id', id).hide().appendTo($(document).contents().find('body'));

		if (this.options.url && this.options.url.length) {
			if (this.contents.hasClass('ui-dialog-content')) {
				this.contents.dialog('open');
			} else {
				setTimeout(function() {
					self.contents.load(self.options.url, function(response, status){

						if (status == 'error') {<commit_msg>Added closeButton and cancelButton options to boomDialog<commit_after>function boomDialog(options) {
	this.deferred = new $.Deferred().always(function() {
		$.boom.page && $.boom.page.toolbar && $.boom.page.toolbar.minimise();
	});

	this.options = $.extend({
		width: 'auto',
		cancelButton : true,
		closeButton : true,
		autoOpen: true,
		modal: true,
		resizable: false,
		draggable: true,
		closeOnEscape: true,
		position: ['center', 'center'],
		buttons : [],
		dialogClass : 'b-dialog',
		boomDialog: this
	}, options);

	boomDialog.prototype.always = function(callback) {
		this.deferred.always(callback);

		return this;
	};

 	boomDialog.prototype.cancelButton = {
		text : 'Cancel',
		icons : { primary : 'b-button-icon-cancel b-button-icon' },
		class : 'b-button',
		click : function() {
			var boomDialog = $(this).dialog('option', 'boomDialog');
			boomDialog.cancel();
		}
	};

	boomDialog.prototype.cancel = function() {
		this.deferred.rejectWith(this.dialog);
		this.contents.dialog('destroy');
	};

	boomDialog.prototype.closeButton = {
		text : 'Okay',
		class : 'b-button',
		icons : { primary : 'b-button-icon-accept b-button-icon' },
		click : function() {
			var boomDialog = $(this).dialog('option', 'boomDialog');
			boomDialog.close();
		}
	};

	boomDialog.prototype.close = function() {
		this.deferred.resolveWith(this.dialog);
		this.contents.dialog('destroy');
	};

	boomDialog.prototype.done = function(callback) {
		this.deferred.done(callback);

		return this;
	};

	boomDialog.prototype.fail = function(callback) {
		this.deferred.fail(callback);

		return this;
	};

	boomDialog.prototype.init = function() {
		var boomDialog = this;

		$.boom.page && $.boom.page.toolbar && $.boom.page.toolbar.maximise();

		this
			.contents
			.dialog(this.options)
			.ui();

		this.contents.dialog('option', 'position', {my: "center center", at: "center center", of: top});

		this.contents.find('img').load(function() {
			boomDialog.contents.dialog('option', 'position', {my: "center center", at: "center center", of: top});
		});
	};

	boomDialog.prototype.open = function() {
		var id = this.options.id? this.options.id : $.boom.util.dom.uniqueId('boom-dialog-'),
			self = this;

		this.contents = $('#' + id).length? $('#' + id) : $('<div />').attr('id', id).hide().appendTo($(document).contents().find('body'));

		this.options.cancelButton && this.options.buttons.push(this.cancelButton);
		this.options.closeButton && this.options.buttons.push(this.closeButton);

		if (this.options.url && this.options.url.length) {
			if (this.contents.hasClass('ui-dialog-content')) {
				this.contents.dialog('open');
			} else {
				setTimeout(function() {
					self.contents.load(self.options.url, function(response, status){

						if (status == 'error') {
{'fraction_non_alphanumeric': 0.18821115463532923, 'fraction_numerical': 0.0, 'mean_word_length': 3.9419354838709677, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4123999', 'n_tokens_mistral': 1991, 'n_tokens_neox': 1791, 'n_words': 316}