Merge "Show a warning in edit preview when a template loop is detected"
[lhc/web/wiklou.git] / resources / lib / oojs-ui / oojs-ui-widgets.js
index bd85e33..37c0540 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.22.5
+ * OOjs UI v0.23.0
  * 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-08-22T21:37:37Z
+ * Date: 2017-09-05T21:23:58Z
  */
 ( function ( OO ) {
 
@@ -1111,23 +1111,6 @@ OO.ui.TabPanelLayout.prototype.setActive = function ( active ) {
        }
 };
 
-/**
- * The deprecated name for the TabPanelLayout, provided for backwards-compatibility.
- *
- * @class
- * @extends OO.ui.TabPanelLayout
- *
- * @constructor
- * @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.' );
-       // Parent constructor
-       OO.ui.CardLayout.parent.apply( this, arguments );
-};
-
-OO.inheritClass( OO.ui.CardLayout, OO.ui.TabPanelLayout );
-
 /**
  * PageLayouts are used within {@link OO.ui.BookletLayout booklet layouts} to create pages that users can select and display
  * from the booklet's optional {@link OO.ui.OutlineSelectWidget outline} navigation. Pages are usually not instantiated directly,
@@ -1996,12 +1979,12 @@ OO.ui.BookletLayout.prototype.toggleOutline = function ( show ) {
 };
 
 /**
- * Get the page closest to the specified page.
+ * Find the page closest to the specified page.
  *
  * @param {OO.ui.PageLayout} page Page to use as a reference point
  * @return {OO.ui.PageLayout|null} Page closest to the specified page
  */
-OO.ui.BookletLayout.prototype.getClosestPage = function ( page ) {
+OO.ui.BookletLayout.prototype.findClosestPage = function ( page ) {
        var next, prev, level,
                pages = this.stackLayout.getItems(),
                index = pages.indexOf( page );
@@ -2029,6 +2012,18 @@ OO.ui.BookletLayout.prototype.getClosestPage = function ( page ) {
        return prev || next || null;
 };
 
+/**
+ * Get the page closest to the specified page.
+ *
+ * @deprecated 0.22.6 Use {@link OO.ui.BookletLayout#findClosestPage} instead.
+ * @param {OO.ui.PageLayout} page Page to use as a reference point
+ * @return {OO.ui.PageLayout|null} Page closest to the specified page
+ */
+OO.ui.BookletLayout.prototype.getClosestPage = function ( page ) {
+       OO.ui.warnDeprecation( 'BookletLayout#getClosestPage: Deprecated function. Use findClosestPage instead. See T76630.' );
+       return this.findClosestPage( page );
+};
+
 /**
  * Get the outline widget.
  *
@@ -2314,34 +2309,6 @@ OO.ui.IndexLayout = function OoUiIndexLayout( config ) {
        this.currentTabPanelName = null;
        this.tabPanels = {};
 
-       Object.defineProperty( this, 'currentCardName', {
-               // TODO: read documentation
-               configurable: true,
-               enumerable: true,
-               get: function () {
-                       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.' );
-                       this.currentTabPanelName = value;
-               }
-       } );
-
-       Object.defineProperty( this, 'cards', {
-               // TODO: read documentation
-               configurable: true,
-               enumerable: true,
-               get: function () {
-                       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.' );
-                       this.tabPanels = value;
-               }
-       } );
-
        this.ignoreFocus = false;
        this.stackLayout = new OO.ui.StackLayout( {
                continuous: !!config.continuous,
@@ -2522,18 +2489,6 @@ OO.ui.IndexLayout.prototype.getClosestTabPanel = function ( tabPanel ) {
        return prev || next || null;
 };
 
-/**
- * Get the tab panel closest to the specified tab panel.
- *
- * @param {OO.ui.TabPanelLayout} tabPanel Tab panel to use as a reference point
- * @return {OO.ui.TabPanelLayout|null} Tab panel closest to the specified
- * @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.' );
-       return this.getClosestTabPanel( tabPanel );
-};
-
 /**
  * Get the tabs widget.
  *
@@ -2553,18 +2508,6 @@ OO.ui.IndexLayout.prototype.getTabPanel = function ( name ) {
        return this.tabPanels[ name ];
 };
 
-/**
- * Get a tab panel by its symbolic name.
- *
- * @param {string} name Symbolic name of tab panel
- * @return {OO.ui.TabPanelLayout|undefined} Tab panel, if found
- * @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.' );
-       return this.getTabPanel( name );
-};
-
 /**
  * Get the current tab panel.
  *
@@ -2575,17 +2518,6 @@ OO.ui.IndexLayout.prototype.getCurrentTabPanel = function () {
        return name ? this.getTabPanel( name ) : undefined;
 };
 
-/**
- * Get the current tab panel.
- *
- * @return {OO.ui.TabPanelLayout|undefined} Current tab panel, if found
- * @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.' );
-       return this.getCurrentTabPanel();
-};
-
 /**
  * Get the symbolic name of the current tab panel.
  *
@@ -2595,17 +2527,6 @@ OO.ui.IndexLayout.prototype.getCurrentTabPanelName = function () {
        return this.currentTabPanelName;
 };
 
-/**
- * Get the symbolic name of the current tab panel.
- *
- * @return {string|null} Symbolic name of the current tab panel
- * @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.' );
-       return this.getCurrentTabPanelName();
-};
-
 /**
  * Add tab panels to the index layout
  *
@@ -2661,23 +2582,6 @@ OO.ui.IndexLayout.prototype.addTabPanels = function ( tabPanels, index ) {
        return this;
 };
 
-/**
- * Add tab panels to the index layout
- *
- * When tab panels are added with the same names as existing tab panels, the existing tab panels
- * will be automatically removed before the new tab panels are added.
- *
- * @param {OO.ui.TabPanelLayout[]} tabPanels Tab panels to add
- * @param {number} index Index of the insertion point
- * @fires add
- * @chainable
- * @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.' );
-       return this.addTabPanels( tabPanels, index );
-};
-
 /**
  * Remove the specified tab panels from the index layout.
  *
@@ -2708,21 +2612,6 @@ OO.ui.IndexLayout.prototype.removeTabPanels = function ( tabPanels ) {
        return this;
 };
 
-/**
- * Remove the specified tab panels from the index layout.
- *
- * To remove all tab panels from the index, you may wish to use the #clearTabPanels method instead.
- *
- * @param {OO.ui.TabPanelLayout[]} tabPanels An array of tab panels to remove
- * @fires remove
- * @chainable
- * @deprecated since v0.21.3, use `removeTabPanels` instead
- */
-OO.ui.IndexLayout.prototype.removeCards = function ( tabPanels ) {
-       OO.ui.warnDeprecation( 'IndexLayout\'s removeCards method is deprecated. Use removeTabPanels instead. See T155152.' );
-       return this.removeTabPanels( tabPanels );
-};
-
 /**
  * Clear all tab panels from the index layout.
  *
@@ -2748,20 +2637,6 @@ OO.ui.IndexLayout.prototype.clearTabPanels = function () {
        return this;
 };
 
-/**
- * Clear all tab panels from the index layout.
- *
- * To remove only a subset of tab panels from the index, use the #removeTabPanels method.
- *
- * @fires remove
- * @chainable
- * @deprecated since v0.21.3, use `clearTabPanels` instead
- */
-OO.ui.IndexLayout.prototype.clearCards = function () {
-       OO.ui.warnDeprecation( 'IndexLayout\'s clearCards method is deprecated. Use clearTabPanels instead. See T155152.' );
-       return this.clearTabPanels();
-};
-
 /**
  * Set the current tab panel by symbolic name.
  *
@@ -2814,18 +2689,6 @@ OO.ui.IndexLayout.prototype.setTabPanel = function ( name ) {
        }
 };
 
-/**
- * Set the current tab panel by symbolic name.
- *
- * @fires set
- * @param {string} name Symbolic name of tab panel
- * @deprecated since v0.21.3, use `setTabPanel` instead
- */
-OO.ui.IndexLayout.prototype.setCard = function ( name ) {
-       OO.ui.warnDeprecation( 'IndexLayout\'s setCard method is deprecated. Use setTabPanel instead. See T155152.' );
-       return this.setTabPanel( name );
-};
-
 /**
  * Select the first selectable tab panel.
  *
@@ -2839,17 +2702,6 @@ OO.ui.IndexLayout.prototype.selectFirstSelectableTabPanel = function () {
        return this;
 };
 
-/**
- * Select the first selectable tab panel.
- *
- * @chainable
- * @deprecated since v0.21.3, use `selectFirstSelectableTabPanel` instead
- */
-OO.ui.IndexLayout.prototype.selectFirstSelectableCard = function () {
-       OO.ui.warnDeprecation( 'IndexLayout\'s selectFirstSelectableCard method is deprecated. Use selectFirestSelectableTabPanel instead. See T155152.' );
-       return this.selectFirstSelectableTabPanel();
-};
-
 /**
  * ToggleWidget implements basic behavior of widgets with an on/off state.
  * Please see OO.ui.ToggleButtonWidget and OO.ui.ToggleSwitchWidget for examples.