<commit_before>/*!
 * VisualEditor UserInterface Dialog class.
 *
 * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
 * @license The MIT License (MIT); see LICENSE.txt
 */

/**
 * UserInterface dialog.
 *
 * @class
 * @abstract
 *
 * @constructor
 * @param {ve.ui.Surface} surface
 */
ve.ui.Dialog = function VeUiDialog( surface ) {
	// Parent constructor
	ve.EventEmitter.call( this );

	var dialog = this;
	// Properties
	this.surface = surface;
	this.visible = false;
	this.$ = $( '<div class="ve-ui-dialog"></div>' );

	// Initialization
	this.cancelButton = new ve.ui.ButtonWidget( { 'label': ve.msg( 'cancel' ) } );

	//this.cancelButton.on( 'click', ve.bind( this.surface.target.closeDialog, this ) );
	this.cancelButton.on( 'click', function() { dialog.surface.target.closeDialog(); } );

	this.applyButton = new ve.ui.ButtonWidget( {
		'label': ve.msg( 'visualeditor-dialog-label-apply' ),
		'flags': ['constructive'],
		'disabled': false
	} );

	// Base elements
	this.$title = $( '<div class="ve-ui-dialog-title"></div>' ).text(
		ve.msg( this.constructor.static.dialogTitleMessage )
	);
	this.$actions = $( '<div class="ve-ui-dialog-actions"><div>' ).append(
		this.cancelButton.$, this.applyButton.$
	);
	this.$.append( this.$title, this.$actions, $( '<div class="ve-ui-dialog-container"></div>' ) );
};

/* Inheritance */

ve.inheritClass( ve.ui.Dialog, ve.EventEmitter );

/* Methods */

ve.ui.Dialog.prototype.isVisible = function () {
	return this.visible;
};

ve.ui.Dialog.prototype.open = function () {
	this.emit( 'open' );
	this.$.show();
	this.visible = true;
};

ve.ui.Dialog.prototype.close = function () {
	this.emit( 'close' );
	this.$.hide();
	this.visible = false;
};
<commit_msg>Fix JSDuck warnings<commit_after>/*!
 * VisualEditor UserInterface Dialog class.
 *
 * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
 * @license The MIT License (MIT); see LICENSE.txt
 */

/**
 * UserInterface dialog.
 *
 * @class
 * @abstract
 *
 * @constructor
 * @param {ve.Surface} surface
 */
ve.ui.Dialog = function VeUiDialog( surface ) {
	// Parent constructor
	ve.EventEmitter.call( this );

	var dialog = this;
	// Properties
	this.surface = surface;
	this.visible = false;
	this.$ = $( '<div class="ve-ui-dialog"></div>' );

	// Initialization
	this.cancelButton = new ve.ui.ButtonWidget( { 'label': ve.msg( 'cancel' ) } );

	//this.cancelButton.on( 'click', ve.bind( this.surface.target.closeDialog, this ) );
	this.cancelButton.on( 'click', function() { dialog.surface.target.closeDialog(); } );

	this.applyButton = new ve.ui.ButtonWidget( {
		'label': ve.msg( 'visualeditor-dialog-label-apply' ),
		'flags': ['constructive'],
		'disabled': false
	} );

	// Base elements
	this.$title = $( '<div class="ve-ui-dialog-title"></div>' ).text(
		ve.msg( this.constructor.static.dialogTitleMessage )
	);
	this.$actions = $( '<div class="ve-ui-dialog-actions"><div>' ).append(
		this.cancelButton.$, this.applyButton.$
	);
	this.$.append( this.$title, this.$actions, $( '<div class="ve-ui-dialog-container"></div>' ) );
};

/* Inheritance */

ve.inheritClass( ve.ui.Dialog, ve.EventEmitter );

/* Methods */

ve.ui.Dialog.prototype.isVisible = function () {
	return this.visible;
};

ve.ui.Dialog.prototype.open = function () {
	this.emit( 'open' );
	this.$.show();
	this.visible = true;
};

ve.ui.Dialog.prototype.close = function () {
	this.emit( 'close' );
	this.$.hide();
	this.visible = false;
};

{'fraction_non_alphanumeric': 0.19583453861729824, 'fraction_numerical': 0.0046282904252241824, 'mean_word_length': 3.789473684210526, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '1980414', 'n_tokens_mistral': 1195, 'n_tokens_neox': 1160, 'n_words': 232}