' );
// Events
- this.dismissButton.connect( this, { 'click': 'onDismissErrorButtonClick' } );
- this.retryButton.connect( this, { 'click': 'onRetryButtonClick' } );
+ this.dismissButton.connect( this, { click: 'onDismissErrorButtonClick' } );
+ this.retryButton.connect( this, { click: 'onRetryButtonClick' } );
// Initialization
this.title.$element.addClass( 'oo-ui-processDialog-title' );
@@ -5497,7 +5500,7 @@ OO.ui.ProcessDialog.prototype.fitLabel = function () {
this.$safeActions.is( ':visible' ) ? this.$safeActions.width() : 0,
this.$primaryActions.is( ':visible' ) ? this.$primaryActions.width() : 0
);
- this.$location.css( { 'padding-left': width, 'padding-right': width } );
+ this.$location.css( { paddingLeft: width, paddingRight: width } );
return this;
};
@@ -5565,31 +5568,31 @@ OO.ui.BookletLayout = function OoUiBookletLayout( config ) {
this.currentPageName = null;
this.pages = {};
this.ignoreFocus = false;
- this.stackLayout = new OO.ui.StackLayout( { '$': this.$, 'continuous': !!config.continuous } );
+ this.stackLayout = new OO.ui.StackLayout( { $: this.$, continuous: !!config.continuous } );
this.autoFocus = config.autoFocus === undefined || !!config.autoFocus;
this.outlineVisible = false;
this.outlined = !!config.outlined;
if ( this.outlined ) {
this.editable = !!config.editable;
this.outlineControlsWidget = null;
- this.outlineWidget = new OO.ui.OutlineWidget( { '$': this.$ } );
- this.outlinePanel = new OO.ui.PanelLayout( { '$': this.$, 'scrollable': true } );
+ this.outlineWidget = new OO.ui.OutlineWidget( { $: this.$ } );
+ this.outlinePanel = new OO.ui.PanelLayout( { $: this.$, scrollable: true } );
this.gridLayout = new OO.ui.GridLayout(
[ this.outlinePanel, this.stackLayout ],
- { '$': this.$, 'widths': [ 1, 2 ] }
+ { $: this.$, widths: [ 1, 2 ] }
);
this.outlineVisible = true;
if ( this.editable ) {
this.outlineControlsWidget = new OO.ui.OutlineControlsWidget(
- this.outlineWidget, { '$': this.$ }
+ this.outlineWidget, { $: this.$ }
);
}
}
// Events
- this.stackLayout.connect( this, { 'set': 'onStackLayoutSet' } );
+ this.stackLayout.connect( this, { set: 'onStackLayoutSet' } );
if ( this.outlined ) {
- this.outlineWidget.connect( this, { 'select': 'onOutlineWidgetSelect' } );
+ this.outlineWidget.connect( this, { select: 'onOutlineWidgetSelect' } );
}
if ( this.autoFocus ) {
// Event 'focus' does not bubble, but 'focusin' does
@@ -5665,7 +5668,7 @@ OO.ui.BookletLayout.prototype.onStackLayoutFocus = function ( e ) {
OO.ui.BookletLayout.prototype.onStackLayoutSet = function ( page ) {
var $input, layout = this;
if ( page ) {
- page.scrollElementIntoView( { 'complete': function () {
+ page.scrollElementIntoView( { complete: function () {
if ( layout.autoFocus ) {
// Set focus to the first input if nothing on the page is focused yet
if ( !page.$element.find( ':focus' ).length ) {
@@ -5845,7 +5848,7 @@ OO.ui.BookletLayout.prototype.addPages = function ( pages, index ) {
name = page.getName();
this.pages[page.getName()] = page;
if ( this.outlined ) {
- item = new OO.ui.OutlineItemWidget( name, page, { '$': this.$ } );
+ item = new OO.ui.OutlineItemWidget( name, page, { $: this.$ } );
page.setOutlineItem( item );
items.push( item );
}
@@ -5976,13 +5979,13 @@ OO.ui.BookletLayout.prototype.updateOutlineWidget = function () {
* @mixins OO.ui.LabeledElement
*
* Available label alignment modes include:
- * - 'left': Label is before the field and aligned away from it, best for when the user will be
+ * - left: Label is before the field and aligned away from it, best for when the user will be
* scanning for a specific label in a form with many fields
- * - 'right': Label is before the field and aligned toward it, best for forms the user is very
+ * - right: Label is before the field and aligned toward it, best for forms the user is very
* familiar with and will tab through field checking quickly to verify which field they are in
- * - 'top': Label is before the field and above it, best for when the use will need to fill out all
+ * - top: Label is before the field and above it, best for when the use will need to fill out all
* fields from top to bottom in a form with few fields
- * - 'inline': Label is after the field and aligned toward it, best for small boolean fields like
+ * - inline: Label is after the field and aligned toward it, best for small boolean fields like
* checkboxes or radio buttons
*
* @constructor
@@ -5994,7 +5997,7 @@ OO.ui.BookletLayout.prototype.updateOutlineWidget = function () {
OO.ui.FieldLayout = function OoUiFieldLayout( field, config ) {
var popupButtonWidget;
// Config initialization
- config = $.extend( { 'align': 'left' }, config );
+ config = $.extend( { align: 'left' }, config );
// Parent constructor
OO.ui.FieldLayout.super.call( this, config );
@@ -6005,10 +6008,10 @@ OO.ui.FieldLayout = function OoUiFieldLayout( field, config ) {
if ( config.help ) {
popupButtonWidget = new OO.ui.PopupButtonWidget( $.extend(
{
- '$': this.$,
- 'frameless': true,
- 'icon': 'info',
- 'title': config.help
+ $: this.$,
+ frameless: true,
+ icon: 'info',
+ title: config.help
},
config,
{ label: null }
@@ -6026,7 +6029,7 @@ OO.ui.FieldLayout = function OoUiFieldLayout( field, config ) {
if ( this.field instanceof OO.ui.InputWidget ) {
this.$label.on( 'click', OO.ui.bind( this.onLabelClick, this ) );
}
- this.field.connect( this, { 'disable': 'onFieldDisable' } );
+ this.field.connect( this, { disable: 'onFieldDisable' } );
// Initialization
this.$element.addClass( 'oo-ui-fieldLayout' );
@@ -6095,6 +6098,11 @@ OO.ui.FieldLayout.prototype.setAlignment = function ( value ) {
this.$element.removeClass( 'oo-ui-fieldLayout-align-' + this.align );
}
this.align = value;
+ // The following classes can be used here:
+ // oo-ui-fieldLayout-align-left
+ // oo-ui-fieldLayout-align-right
+ // oo-ui-fieldLayout-align-top
+ // oo-ui-fieldLayout-align-inline
this.$element.addClass( 'oo-ui-fieldLayout-align-' + this.align );
}
@@ -6326,11 +6334,11 @@ OO.ui.GridLayout.prototype.update = function () {
panel = this.panels[i];
width = this.widths[x];
dimensions = {
- 'width': Math.round( width * 100 ) + '%',
- 'height': Math.round( height * 100 ) + '%',
- 'top': Math.round( top * 100 ) + '%',
+ width: Math.round( width * 100 ) + '%',
+ height: Math.round( height * 100 ) + '%',
+ top: Math.round( top * 100 ) + '%',
// HACK: Work around IE bug by setting visibility: hidden; if width or height is zero
- 'visibility': width === 0 || height === 0 ? 'hidden' : ''
+ visibility: width === 0 || height === 0 ? 'hidden' : ''
};
// If RTL, reverse:
if ( OO.ui.Element.getDir( this.$.context ) === 'rtl' ) {
@@ -6413,7 +6421,7 @@ OO.inheritClass( OO.ui.PanelLayout, OO.ui.Layout );
*/
OO.ui.PageLayout = function OoUiPageLayout( name, config ) {
// Configuration initialization
- config = $.extend( { 'scrollable': true }, config );
+ config = $.extend( { scrollable: true }, config );
// Parent constructor
OO.ui.PageLayout.super.call( this, config );
@@ -6529,7 +6537,7 @@ OO.ui.PageLayout.prototype.setActive = function ( active ) {
*/
OO.ui.StackLayout = function OoUiStackLayout( config ) {
// Config initialization
- config = $.extend( { 'scrollable': true }, config );
+ config = $.extend( { scrollable: true }, config );
// Parent constructor
OO.ui.StackLayout.super.call( this, config );
@@ -6624,7 +6632,7 @@ OO.ui.StackLayout.prototype.removeItems = function ( items ) {
// Mixin method
OO.ui.GroupElement.prototype.removeItems.call( this, items );
- if ( $.inArray( this.currentItem, items ) !== -1 ) {
+ if ( $.inArray( this.currentItem, items ) !== -1 ) {
if ( this.items.length ) {
this.setItem( this.items[0] );
} else {
@@ -6916,7 +6924,7 @@ OO.ui.MenuToolGroup = function OoUiMenuToolGroup( toolbar, config ) {
OO.ui.MenuToolGroup.super.call( this, toolbar, config );
// Events
- this.toolbar.connect( this, { 'updateState': 'onUpdateState' } );
+ this.toolbar.connect( this, { updateState: 'onUpdateState' } );
// Initialization
this.$element.addClass( 'oo-ui-menuToolGroup' );
@@ -7125,9 +7133,9 @@ OO.ui.LookupInputWidget = function OoUiLookupInputWidget( input, config ) {
this.lookupInput = input;
this.$overlay = config.$overlay || this.$( 'body,.oo-ui-window-overlay' ).last();
this.lookupMenu = new OO.ui.TextInputMenuWidget( this, {
- '$': OO.ui.Element.getJQuery( this.$overlay ),
- 'input': this.lookupInput,
- '$container': config.$container
+ $: OO.ui.Element.getJQuery( this.$overlay ),
+ input: this.lookupInput,
+ $container: config.$container
} );
this.lookupCache = {};
this.lookupQuery = null;
@@ -7138,11 +7146,11 @@ OO.ui.LookupInputWidget = function OoUiLookupInputWidget( input, config ) {
this.$overlay.append( this.lookupMenu.$element );
this.lookupInput.$input.on( {
- 'focus': OO.ui.bind( this.onLookupInputFocus, this ),
- 'blur': OO.ui.bind( this.onLookupInputBlur, this ),
- 'mousedown': OO.ui.bind( this.onLookupInputMouseDown, this )
+ focus: OO.ui.bind( this.onLookupInputFocus, this ),
+ blur: OO.ui.bind( this.onLookupInputBlur, this ),
+ mousedown: OO.ui.bind( this.onLookupInputMouseDown, this )
} );
- this.lookupInput.connect( this, { 'change': 'onLookupInputChange' } );
+ this.lookupInput.connect( this, { change: 'onLookupInputChange' } );
// Initialization
this.$element.addClass( 'oo-ui-lookupWidget' );
@@ -7356,7 +7364,7 @@ OO.ui.LookupInputWidget.prototype.getLookupMenuItemsFromData = function () {
*/
OO.ui.OutlineControlsWidget = function OoUiOutlineControlsWidget( outline, config ) {
// Configuration initialization
- config = $.extend( { 'icon': 'add-item' }, config );
+ config = $.extend( { icon: 'add-item' }, config );
// Parent constructor
OO.ui.OutlineControlsWidget.super.call( this, config );
@@ -7369,33 +7377,33 @@ OO.ui.OutlineControlsWidget = function OoUiOutlineControlsWidget( outline, confi
this.outline = outline;
this.$movers = this.$( '
' );
this.upButton = new OO.ui.ButtonWidget( {
- '$': this.$,
- 'framed': false,
- 'icon': 'collapse',
- 'title': OO.ui.msg( 'ooui-outline-control-move-up' )
+ $: this.$,
+ framed: false,
+ icon: 'collapse',
+ title: OO.ui.msg( 'ooui-outline-control-move-up' )
} );
this.downButton = new OO.ui.ButtonWidget( {
- '$': this.$,
- 'framed': false,
- 'icon': 'expand',
- 'title': OO.ui.msg( 'ooui-outline-control-move-down' )
+ $: this.$,
+ framed: false,
+ icon: 'expand',
+ title: OO.ui.msg( 'ooui-outline-control-move-down' )
} );
this.removeButton = new OO.ui.ButtonWidget( {
- '$': this.$,
- 'framed': false,
- 'icon': 'remove',
- 'title': OO.ui.msg( 'ooui-outline-control-remove' )
+ $: this.$,
+ framed: false,
+ icon: 'remove',
+ title: OO.ui.msg( 'ooui-outline-control-remove' )
} );
// Events
outline.connect( this, {
- 'select': 'onOutlineChange',
- 'add': 'onOutlineChange',
- 'remove': 'onOutlineChange'
+ select: 'onOutlineChange',
+ add: 'onOutlineChange',
+ remove: 'onOutlineChange'
} );
- this.upButton.connect( this, { 'click': [ 'emit', 'move', -1 ] } );
- this.downButton.connect( this, { 'click': [ 'emit', 'move', 1 ] } );
- this.removeButton.connect( this, { 'click': [ 'emit', 'remove' ] } );
+ this.upButton.connect( this, { click: [ 'emit', 'move', -1 ] } );
+ this.downButton.connect( this, { click: [ 'emit', 'move', 1 ] } );
+ this.removeButton.connect( this, { click: [ 'emit', 'remove' ] } );
// Initialization
this.$element.addClass( 'oo-ui-outlineControlsWidget' );
@@ -7566,7 +7574,7 @@ OO.mixinClass( OO.ui.ButtonGroupWidget, OO.ui.GroupElement );
*/
OO.ui.ButtonWidget = function OoUiButtonWidget( config ) {
// Configuration initialization
- config = $.extend( { 'target': '_blank' }, config );
+ config = $.extend( { target: '_blank' }, config );
// Parent constructor
OO.ui.ButtonWidget.super.call( this, config );
@@ -7586,8 +7594,8 @@ OO.ui.ButtonWidget = function OoUiButtonWidget( config ) {
// Events
this.$button.on( {
- 'click': OO.ui.bind( this.onClick, this ),
- 'keypress': OO.ui.bind( this.onKeyPress, this )
+ click: OO.ui.bind( this.onClick, this ),
+ keypress: OO.ui.bind( this.onKeyPress, this )
} );
// Initialization
@@ -7722,7 +7730,7 @@ OO.ui.ButtonWidget.prototype.setTarget = function ( target ) {
*/
OO.ui.ActionWidget = function OoUiActionWidget( config ) {
// Config intialization
- config = $.extend( { 'framed': false }, config );
+ config = $.extend( { framed: false }, config );
// Parent constructor
OO.ui.ActionWidget.super.call( this, config );
@@ -8060,7 +8068,7 @@ OO.ui.IndicatorWidget.static.tagName = 'span';
*/
OO.ui.InlineMenuWidget = function OoUiInlineMenuWidget( config ) {
// Configuration initialization
- config = $.extend( { 'indicator': 'down' }, config );
+ config = $.extend( { indicator: 'down' }, config );
// Parent constructor
OO.ui.InlineMenuWidget.super.call( this, config );
@@ -8072,12 +8080,12 @@ OO.ui.InlineMenuWidget = function OoUiInlineMenuWidget( config ) {
OO.ui.TitledElement.call( this, this.$label, config );
// Properties
- this.menu = new OO.ui.MenuWidget( $.extend( { '$': this.$, 'widget': this }, config.menu ) );
+ this.menu = new OO.ui.MenuWidget( $.extend( { $: this.$, widget: this }, config.menu ) );
this.$handle = this.$( '
' );
// Events
- this.$element.on( { 'click': OO.ui.bind( this.onClick, this ) } );
- this.menu.connect( this, { 'select': 'onMenuSelect' } );
+ this.$element.on( { click: OO.ui.bind( this.onClick, this ) } );
+ this.menu.connect( this, { select: 'onMenuSelect' } );
// Initialization
this.$handle
@@ -8166,7 +8174,7 @@ OO.ui.InlineMenuWidget.prototype.onClick = function ( e ) {
*/
OO.ui.InputWidget = function OoUiInputWidget( config ) {
// Config intialization
- config = $.extend( { 'readOnly': false }, config );
+ config = $.extend( { readOnly: false }, config );
// Parent constructor
OO.ui.InputWidget.super.call( this, config );
@@ -8441,7 +8449,7 @@ OO.ui.CheckboxInputWidget.prototype.onEdit = function () {
*/
OO.ui.TextInputWidget = function OoUiTextInputWidget( config ) {
var widget = this;
- config = $.extend( { 'maxRows': 10 }, config );
+ config = $.extend( { maxRows: 10 }, config );
// Parent constructor
OO.ui.TextInputWidget.super.call( this, config );
@@ -8546,7 +8554,7 @@ OO.ui.TextInputWidget.prototype.adjustSize = function () {
if ( this.multiline && this.autosize ) {
$clone = this.$input.clone()
.val( this.$input.val() )
- .css( { 'height': 0 } )
+ .css( { height: 0 } )
.insertAfter( this.$input );
// Set inline height property to 0 to measure scroll height
scrollHeight = $clone[0].scrollHeight;
@@ -9004,7 +9012,7 @@ OO.ui.ButtonOptionWidget.prototype.setSelected = function ( state ) {
*/
OO.ui.MenuItemWidget = function OoUiMenuItemWidget( data, config ) {
// Configuration initialization
- config = $.extend( { 'icon': 'check' }, config );
+ config = $.extend( { icon: 'check' }, config );
// Parent constructor
OO.ui.MenuItemWidget.super.call( this, data, config );
@@ -9217,11 +9225,11 @@ OO.ui.PopupWidget = function OoUiPopupWidget( config ) {
this.width = config.width !== undefined ? config.width : 320;
this.height = config.height !== undefined ? config.height : null;
this.align = config.align || 'center';
- this.closeButton = new OO.ui.ButtonWidget( { '$': this.$, 'framed': false, 'icon': 'close' } );
+ this.closeButton = new OO.ui.ButtonWidget( { $: this.$, framed: false, icon: 'close' } );
this.onMouseDownHandler = OO.ui.bind( this.onMouseDown, this );
// Events
- this.closeButton.connect( this, { 'click': 'onCloseButtonClick' } );
+ this.closeButton.connect( this, { click: 'onCloseButtonClick' } );
// Initialization
this.toggleAnchor( config.anchor === undefined || config.anchor );
@@ -9396,7 +9404,7 @@ OO.ui.PopupWidget.prototype.updateDimensions = function ( transition ) {
containerLeft = Math.round( this.$container.offset().left ),
containerWidth = this.$container.innerWidth(),
containerRight = containerLeft + containerWidth,
- popupOffset = this.width * ( { 'left': 0, 'center': -0.5, 'right': -1 } )[this.align],
+ popupOffset = this.width * ( { left: 0, center: -0.5, right: -1 } )[this.align],
anchorWidth = this.$anchor.width(),
popupLeft = popupOffset - padding,
popupRight = popupOffset + padding + this.width + padding,
@@ -9425,9 +9433,9 @@ OO.ui.PopupWidget.prototype.updateDimensions = function ( transition ) {
// Position body relative to anchor and resize
this.$popup.css( {
- 'left': popupOffset,
- 'width': this.width,
- 'height': this.height !== null ? this.height : 'auto'
+ left: popupOffset,
+ width: this.width,
+ height: this.height !== null ? this.height : 'auto'
} );
if ( transition ) {
@@ -9466,23 +9474,23 @@ OO.ui.SearchWidget = function OoUiSearchWidget( config ) {
// Properties
this.query = new OO.ui.TextInputWidget( {
- '$': this.$,
- 'icon': 'search',
- 'placeholder': config.placeholder,
- 'value': config.value
+ $: this.$,
+ icon: 'search',
+ placeholder: config.placeholder,
+ value: config.value
} );
- this.results = new OO.ui.SelectWidget( { '$': this.$ } );
+ this.results = new OO.ui.SelectWidget( { $: this.$ } );
this.$query = this.$( '' );
this.$results = this.$( '
' );
// Events
this.query.connect( this, {
- 'change': 'onQueryChange',
- 'enter': 'onQueryEnter'
+ change: 'onQueryChange',
+ enter: 'onQueryEnter'
} );
this.results.connect( this, {
- 'highlight': 'onResultsHighlight',
- 'select': 'onResultsSelect'
+ highlight: 'onResultsHighlight',
+ select: 'onResultsSelect'
} );
this.query.$input.on( 'keydown', OO.ui.bind( this.onQueryKeydown, this ) );
@@ -9633,9 +9641,9 @@ OO.ui.SelectWidget = function OoUiSelectWidget( config ) {
// Events
this.$element.on( {
- 'mousedown': OO.ui.bind( this.onMouseDown, this ),
- 'mouseover': OO.ui.bind( this.onMouseOver, this ),
- 'mouseleave': OO.ui.bind( this.onMouseLeave, this )
+ mousedown: OO.ui.bind( this.onMouseDown, this ),
+ mouseover: OO.ui.bind( this.onMouseOver, this ),
+ mouseleave: OO.ui.bind( this.onMouseLeave, this )
} );
// Initialization