mediawiki-extensions-Visual.../modules/ve/ui/widgets/ve.ui.TextInputWidget.js
Trevor Parscal cd6b54a4e8 ve.ui.LookupWidget
Refactoring of externally sourced suggestions for text inputs.

*.php
* Added links to new file

ve.ui.InputLabelWidget.js
* Changed to focus input element, not wrapper div

ve.ui.InputWidget.js
* Fixed incorrect documentation

ve.ui.LookupInputWidget.js
* New mixing that abstracts placing a menu of options below a text input
  and filling it with data from an external source

ve.ui.MenuWidget.js
* Fixed to get reference to input element, no wrapper div

ve.ui.MWLinkTargetInputWidget.js
* Moved pending and lookup functionality to mixing
* Implemented menu population using only matching pages, rather than a
  combination of that and page existence checks (fewer API calls)

ve.ui.TextInputMenuWidget.js
* Added configurable container to render underneath, rather than assuming
  this.input.$
* Added auto-position-on-window-resize functionality
* Fixed frame position correction to ensure that it only is used when the
  overlay is in a different frame from the container to position
  underneath

ve.ui.TextInputWidget.js
* Added placeholder text feature

Change-Id: If5ed1b64fd15982807691ce8bb0362970633108a
2013-04-30 10:47:32 -07:00

36 lines
833 B
JavaScript

/*!
* VisualEditor UserInterface TextInputWidget class.
*
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* Creates an ve.ui.TextInputWidget object.
*
* @class
* @extends ve.ui.InputWidget
*
* @constructor
* @param {Object} [config] Config options
* @cfg {string} [placeholder] Placeholder text
*/
ve.ui.TextInputWidget = function VeUiTextInputWidget( config ) {
// Parent constructor
ve.ui.InputWidget.call( this, config );
// Initialization
this.$.addClass( 've-ui-textInputWidget' );
if ( config.placeholder ) {
this.$input.attr( 'placeholder', config.placeholder );
}
};
/* Inheritance */
ve.inheritClass( ve.ui.TextInputWidget, ve.ui.InputWidget );
/* Static Properties */
ve.ui.TextInputWidget.static.inputType = 'text';