/*! * VisualEditor UserInterface Inspector class. * * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt * @license The MIT License (MIT); see LICENSE.txt */ /** * Non-modal interface in a child frame. * * @class * @abstract * @extends OO.ui.Window * * @constructor * @param {OO.ui.WindowSet} windowSet Window set this dialog is part of * @param {Object} [config] Configuration options */ ve.ui.Inspector = function VeUiInspector( windowSet, config ) { // Parent constructor OO.ui.Window.call( this, windowSet, config ); // Properties this.surface = windowSet.getSurface(); // Initialization this.$element.addClass( 've-ui-inspector' ); }; /* Inheritance */ OO.inheritClass( ve.ui.Inspector, OO.ui.Window ); /* Static Properties */ ve.ui.Inspector.static.titleMessage = 've-ui-inspector-title'; /** * Symbolic name of dialog. * * @abstract * @static * @property {string} * @inheritable */ ve.ui.Inspector.static.name = ''; /** * The inspector comes with a remove button * @static * @inheritable * @property {boolean} */ ve.ui.Inspector.static.removable = true; /* Methods */ /** * Handle close button click events. * * @method */ ve.ui.Inspector.prototype.onCloseButtonClick = function () { this.close( { 'action': 'back' } ); }; /** * Handle remove button click events. * * @method */ ve.ui.Inspector.prototype.onRemoveButtonClick = function () { this.close( { 'action': 'remove' } ); }; /** * Handle form submission events. * * @method * @param {jQuery.Event} e Form submit event */ ve.ui.Inspector.prototype.onFormSubmit = function () { this.close( { 'action': 'apply' } ); return false; }; /** * Handle form keydown events. * * @method * @param {jQuery.Event} e Key down event */ ve.ui.Inspector.prototype.onFormKeyDown = function ( e ) { // Escape if ( e.which === OO.ui.Keys.ESCAPE ) { this.close( { 'action': 'back' } ); return false; } }; /** * @inheritdoc */ ve.ui.Inspector.prototype.initialize = function () { // Parent method OO.ui.Window.prototype.initialize.call( this ); // Initialization this.frame.$content.addClass( 've-ui-inspector-content' ); this.$form = this.$( '