Merge "Remove two deprecated functions and one depreciated variable in a function...
[lhc/web/wiklou.git] / resources / lib / oojs-ui / oojs-ui-widgets.js
index e69cae2..bd85e33 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.22.3
+ * OOjs UI v0.22.5
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2017 OOjs UI Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2017-07-11T22:12:33Z
+ * Date: 2017-08-22T21:37:37Z
  */
 ( function ( OO ) {
 
@@ -35,14 +35,10 @@ OO.ui.mixin.DraggableElement = function OoUiMixinDraggableElement( config ) {
        this.index = null;
        this.$handle = config.$handle || this.$element;
        this.wasHandleUsed = null;
-       this.draggable = config.draggable === undefined ? true : !!config.draggable;
 
        // Initialize and events
-       this.$element.addClass( 'oo-ui-draggableElement' )
-               // We make the entire element draggable, not just the handle, so that
-               // the whole element appears to move. wasHandleUsed prevents drags from
-               // starting outside the handle
-               .attr( 'draggable', true )
+       this.$element
+               .addClass( 'oo-ui-draggableElement' )
                .on( {
                        mousedown: this.onDragMouseDown.bind( this ),
                        dragstart: this.onDragStart.bind( this ),
@@ -51,6 +47,7 @@ OO.ui.mixin.DraggableElement = function OoUiMixinDraggableElement( config ) {
                        drop: this.onDrop.bind( this )
                } );
        this.$handle.addClass( 'oo-ui-draggableElement-handle' );
+       this.toggleDraggable( config.draggable === undefined ? true : !!config.draggable );
 };
 
 OO.initClass( OO.ui.mixin.DraggableElement );
@@ -99,6 +96,11 @@ OO.ui.mixin.DraggableElement.prototype.toggleDraggable = function ( isDraggable
                this.draggable = isDraggable;
 
                this.$handle.toggleClass( 'oo-ui-draggableElement-undraggable', !this.draggable );
+
+               // We make the entire element draggable, not just the handle, so that
+               // the whole element appears to move. wasHandleUsed prevents drags from
+               // starting outside the handle
+               this.$element.prop( 'draggable', this.draggable );
        }
 };
 
@@ -277,7 +279,6 @@ OO.ui.mixin.DraggableGroupElement = function OoUiMixinDraggableGroupElement( con
        }
        this.$element
                .addClass( 'oo-ui-draggableGroupElement' )
-               .attr( 'role', 'listbox' )
                .append( this.$status )
                .toggleClass( 'oo-ui-draggableGroupElement-horizontal', this.orientation === 'horizontal' );
 };
@@ -1120,7 +1121,7 @@ OO.ui.TabPanelLayout.prototype.setActive = function ( active ) {
  * @deprecated since v0.21.3
  */
 OO.ui.CardLayout = function OoUiCardLayout() {
-       OO.ui.warnDeprecation( 'CardLayout has been renamed to TabPanel layout. Use that instead. See T155152' );
+       OO.ui.warnDeprecation( 'CardLayout has been renamed to TabPanel layout. Use that instead. See T155152.' );
        // Parent constructor
        OO.ui.CardLayout.parent.apply( this, arguments );
 };
@@ -1983,8 +1984,8 @@ OO.ui.BookletLayout.prototype.toggleOutline = function ( show ) {
                this.outlineVisible = show;
                this.toggleMenu( show );
                if ( show && this.editable ) {
-                       // HACK: When the sidebar stops animating, kill dumb scrollbars (T161798). Only necessary when
-                       // outline controls are present, The delay matches transition on `.oo-ui-menuLayout-menu`.
+                       // HACK: Kill dumb scrollbars when the sidebar stops animating, see T161798. Only necessary when
+                       // outline controls are present, delay matches transition on `.oo-ui-menuLayout-menu`.
                        setTimeout( function () {
                                OO.ui.Element.static.reconsiderScrollbars( booklet.outlinePanel.$element[ 0 ] );
                        }, 200 );
@@ -2318,11 +2319,11 @@ OO.ui.IndexLayout = function OoUiIndexLayout( config ) {
                configurable: true,
                enumerable: true,
                get: function () {
-                       OO.ui.warnDeprecation( 'IndexLayout\'s currentCardName property is deprecated. Use currentTabPanelName instead. See T155152' );
+                       OO.ui.warnDeprecation( 'IndexLayout\'s currentCardName property is deprecated. Use currentTabPanelName instead. See T155152.' );
                        return this.currentTabPanelName;
                },
                set: function ( value ) {
-                       OO.ui.warnDeprecation( 'IndexLayout\'s currentCardName property is deprecated. Use currentTabPanelName instead. See T155152' );
+                       OO.ui.warnDeprecation( 'IndexLayout\'s currentCardName property is deprecated. Use currentTabPanelName instead. See T155152.' );
                        this.currentTabPanelName = value;
                }
        } );
@@ -2332,11 +2333,11 @@ OO.ui.IndexLayout = function OoUiIndexLayout( config ) {
                configurable: true,
                enumerable: true,
                get: function () {
-                       OO.ui.warnDeprecation( 'IndexLayout\'s cards property is deprecated. Use tabPanels instead. See T155152' );
+                       OO.ui.warnDeprecation( 'IndexLayout\'s cards property is deprecated. Use tabPanels instead. See T155152.' );
                        return this.tabPanels;
                },
                set: function ( value ) {
-                       OO.ui.warnDeprecation( 'IndexLayout\'s cards property is deprecated. Use tabPanels instead. See T155152' );
+                       OO.ui.warnDeprecation( 'IndexLayout\'s cards property is deprecated. Use tabPanels instead. See T155152.' );
                        this.tabPanels = value;
                }
        } );
@@ -2529,7 +2530,7 @@ OO.ui.IndexLayout.prototype.getClosestTabPanel = function ( tabPanel ) {
  * @deprecated since v0.21.3, use `getClosestTabPanel` instead
  */
 OO.ui.IndexLayout.prototype.getClosestCard = function ( tabPanel ) {
-       OO.ui.warnDeprecation( 'IndexLayout\'s getClosestCard method is deprecated. Use getClosestTabPanel instead. See T155152' );
+       OO.ui.warnDeprecation( 'IndexLayout\'s getClosestCard method is deprecated. Use getClosestTabPanel instead. See T155152.' );
        return this.getClosestTabPanel( tabPanel );
 };
 
@@ -2560,7 +2561,7 @@ OO.ui.IndexLayout.prototype.getTabPanel = function ( name ) {
  * @deprecated since v0.21.3, use `getTabPanel` instead
  */
 OO.ui.IndexLayout.prototype.getCard = function ( name ) {
-       OO.ui.warnDeprecation( 'IndexLayout\'s getCard method is deprecated. Use getTabPanel instead. See T155152' );
+       OO.ui.warnDeprecation( 'IndexLayout\'s getCard method is deprecated. Use getTabPanel instead. See T155152.' );
        return this.getTabPanel( name );
 };
 
@@ -2581,7 +2582,7 @@ OO.ui.IndexLayout.prototype.getCurrentTabPanel = function () {
  * @deprecated since v0.21.3, use `getCurrentTabPanel` instead
  */
 OO.ui.IndexLayout.prototype.getCurrentCard = function () {
-       OO.ui.warnDeprecation( 'IndexLayout\'s getCurrentCard method is deprecated. Use getCurrentTabPanel instead. See T155152' );
+       OO.ui.warnDeprecation( 'IndexLayout\'s getCurrentCard method is deprecated. Use getCurrentTabPanel instead. See T155152.' );
        return this.getCurrentTabPanel();
 };
 
@@ -2601,7 +2602,7 @@ OO.ui.IndexLayout.prototype.getCurrentTabPanelName = function () {
  * @deprecated since v0.21.3, use `getCurrentTabPanelName` instead
  */
 OO.ui.IndexLayout.prototype.getCurrentCardName = function () {
-       OO.ui.warnDeprecation( 'IndexLayout\'s getCurrentCardName method is deprecated. Use getCurrentTabPanelName instead. See T155152' );
+       OO.ui.warnDeprecation( 'IndexLayout\'s getCurrentCardName method is deprecated. Use getCurrentTabPanelName instead. See T155152.' );
        return this.getCurrentTabPanelName();
 };
 
@@ -2673,7 +2674,7 @@ OO.ui.IndexLayout.prototype.addTabPanels = function ( tabPanels, index ) {
  * @deprecated since v0.21.3, use `addTabPanels` instead
  */
 OO.ui.IndexLayout.prototype.addCards = function ( tabPanels, index ) {
-       OO.ui.warnDeprecation( 'IndexLayout\'s addCards method is deprecated. Use addTabPanels instead. See T155152' );
+       OO.ui.warnDeprecation( 'IndexLayout\'s addCards method is deprecated. Use addTabPanels instead. See T155152.' );
        return this.addTabPanels( tabPanels, index );
 };
 
@@ -3752,7 +3753,8 @@ OO.ui.CapsuleItemWidget = function OoUiCapsuleItemWidget( config ) {
        this.closeButton = new OO.ui.ButtonWidget( {
                framed: false,
                icon: 'close',
-               tabIndex: -1
+               tabIndex: -1,
+               title: OO.ui.msg( 'ooui-item-remove' )
        } ).on( 'click', this.onCloseClick.bind( this ) );
 
        this.on( 'disable', function ( disabled ) {
@@ -4674,7 +4676,8 @@ OO.ui.TagItemWidget = function OoUiTagItemWidget( config ) {
        this.closeButton = new OO.ui.ButtonWidget( {
                framed: false,
                icon: 'close',
-               tabIndex: -1
+               tabIndex: -1,
+               title: OO.ui.msg( 'ooui-item-remove' )
        } );
        this.closeButton.setDisabled( this.isDisabled() );
 
@@ -4928,7 +4931,8 @@ OO.ui.TagMultiselectWidget = function OoUiTagMultiselectWidget( config ) {
                        true : !!config.allowReordering
        );
 
-       this.inputPosition = this.constructor.static.allowedInputPositions.indexOf( config.inputPosition ) > -1 ?
+       this.inputPosition =
+               this.constructor.static.allowedInputPositions.indexOf( config.inputPosition ) > -1 ?
                        config.inputPosition : 'inline';
        this.allowEditTags = config.allowEditTags === undefined ? true : !!config.allowEditTags;
        this.allowArbitrary = !!config.allowArbitrary;