Update OOjs UI to v0.1.0-pre (b9d403a678)
[lhc/web/wiklou.git] / resources / lib / oojs-ui / oojs-ui.js
index cf680f5..990d955 100644 (file)
@@ -1,16 +1,17 @@
 /*!
- * OOjs UI v0.1.0-pre (6379e76bf5)
+ * OOjs UI v0.1.0-pre (b9d403a678)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: Mon Jun 02 2014 17:52:03 GMT-0700 (PDT)
+ * Date: 2014-06-26T23:45:59Z
  */
 ( function ( OO ) {
 
 'use strict';
+
 /**
  * Namespace for all classes, static methods and static properties.
  *
@@ -94,84 +95,85 @@ OO.ui.getLocalValue = function ( obj, lang, fallback ) {
 
 ( function () {
 
-/**
- * Message store for the default implementation of OO.ui.msg
- *
- * Environments that provide a localization system should not use this, but should override
- * OO.ui.msg altogether.
- *
- * @private
- */
-var messages = {
-       // Label text for button to exit from dialog
-       'ooui-dialog-action-close': 'Close',
-       // Tool tip for a button that moves items in a list down one place
-       'ooui-outline-control-move-down': 'Move item down',
-       // Tool tip for a button that moves items in a list up one place
-       'ooui-outline-control-move-up': 'Move item up',
-       // Tool tip for a button that removes items from a list
-       'ooui-outline-control-remove': 'Remove item',
-       // Label for the toolbar group that contains a list of all other available tools
-       'ooui-toolbar-more': 'More',
-
-       // Label for the generic dialog used to confirm things
-       'ooui-dialog-confirm-title': 'Confirm',
-       // The default prompt of a confirmation dialog
-       'ooui-dialog-confirm-default-prompt': 'Are you sure?',
-       // The default OK button text on a confirmation dialog
-       'ooui-dialog-confirm-default-ok': 'OK',
-       // The default cancel button text on a confirmation dialog
-       'ooui-dialog-confirm-default-cancel': 'Cancel'
-};
+       /**
       * Message store for the default implementation of OO.ui.msg
       *
       * Environments that provide a localization system should not use this, but should override
       * OO.ui.msg altogether.
       *
       * @private
       */
+       var messages = {
+               // Label text for button to exit from dialog
+               'ooui-dialog-action-close': 'Close',
+               // Tool tip for a button that moves items in a list down one place
+               'ooui-outline-control-move-down': 'Move item down',
+               // Tool tip for a button that moves items in a list up one place
+               'ooui-outline-control-move-up': 'Move item up',
+               // Tool tip for a button that removes items from a list
+               'ooui-outline-control-remove': 'Remove item',
+               // Label for the toolbar group that contains a list of all other available tools
+               'ooui-toolbar-more': 'More',
+
+               // Label for the generic dialog used to confirm things
+               'ooui-dialog-confirm-title': 'Confirm',
+               // The default prompt of a confirmation dialog
+               'ooui-dialog-confirm-default-prompt': 'Are you sure?',
+               // The default OK button text on a confirmation dialog
+               'ooui-dialog-confirm-default-ok': 'OK',
+               // The default cancel button text on a confirmation dialog
+               'ooui-dialog-confirm-default-cancel': 'Cancel'
+       };
 
-/**
- * Get a localized message.
- *
- * In environments that provide a localization system, this function should be overridden to
- * return the message translated in the user's language. The default implementation always returns
- * English messages.
- *
- * After the message key, message parameters may optionally be passed. In the default implementation,
- * any occurrences of $1 are replaced with the first parameter, $2 with the second parameter, etc.
- * Alternative implementations of OO.ui.msg may use any substitution system they like, as long as
- * they support unnamed, ordered message parameters.
- *
- * @abstract
- * @param {string} key Message key
- * @param {Mixed...} [params] Message parameters
- * @return {string} Translated message with parameters substituted
- */
-OO.ui.msg = function ( key ) {
-       var message = messages[key], params = Array.prototype.slice.call( arguments, 1 );
-       if ( typeof message === 'string' ) {
-               // Perform $1 substitution
-               message = message.replace( /\$(\d+)/g, function ( unused, n ) {
-                       var i = parseInt( n, 10 );
-                       return params[i - 1] !== undefined ? params[i - 1] : '$' + n;
-               } );
-       } else {
-               // Return placeholder if message not found
-               message = '[' + key + ']';
-       }
-       return message;
-};
+       /**
       * Get a localized message.
       *
       * In environments that provide a localization system, this function should be overridden to
       * return the message translated in the user's language. The default implementation always returns
       * English messages.
       *
       * After the message key, message parameters may optionally be passed. In the default implementation,
       * any occurrences of $1 are replaced with the first parameter, $2 with the second parameter, etc.
       * Alternative implementations of OO.ui.msg may use any substitution system they like, as long as
       * they support unnamed, ordered message parameters.
       *
       * @abstract
       * @param {string} key Message key
       * @param {Mixed...} [params] Message parameters
       * @return {string} Translated message with parameters substituted
       */
+       OO.ui.msg = function ( key ) {
+               var message = messages[key], params = Array.prototype.slice.call( arguments, 1 );
+               if ( typeof message === 'string' ) {
+                       // Perform $1 substitution
+                       message = message.replace( /\$(\d+)/g, function ( unused, n ) {
+                               var i = parseInt( n, 10 );
+                               return params[i - 1] !== undefined ? params[i - 1] : '$' + n;
+                       } );
+               } else {
+                       // Return placeholder if message not found
+                       message = '[' + key + ']';
+               }
+               return message;
+       };
 
-/** */
-OO.ui.deferMsg = function ( key ) {
-       return function () {
-               return OO.ui.msg( key );
+       /** */
+       OO.ui.deferMsg = function ( key ) {
+               return function () {
+                       return OO.ui.msg( key );
+               };
        };
-};
 
-/** */
-OO.ui.resolveMsg = function ( msg ) {
-       if ( $.isFunction( msg ) ) {
-               return msg();
-       }
-       return msg;
-};
+       /** */
+       OO.ui.resolveMsg = function ( msg ) {
+               if ( $.isFunction( msg ) ) {
+                       return msg();
+               }
+               return msg;
+       };
 
 } )();
+
 /**
  * DOM element abstraction.
  *
@@ -486,18 +488,32 @@ OO.ui.Element.scrollIntoView = function ( el, config ) {
        // Configuration initialization
        config = config || {};
 
-       var anim = {},
+       var rel, anim = {},
                callback = typeof config.complete === 'function' && config.complete,
                sc = this.getClosestScrollableContainer( el, config.direction ),
                $sc = $( sc ),
                eld = this.getDimensions( el ),
                scd = this.getDimensions( sc ),
+               $win = $( this.getWindow( el ) );
+
+       // Compute the distances between the edges of el and the edges of the scroll viewport
+       if ( $sc.is( 'body' ) ) {
+               // If the scrollable container is the <body> this is easy
+               rel = {
+                       'top': eld.rect.top,
+                       'bottom': $win.innerHeight() - eld.rect.bottom,
+                       'left': eld.rect.left,
+                       'right': $win.innerWidth() - eld.rect.right
+               };
+       } else {
+               // Otherwise, we have to subtract el's coordinates from sc's coordinates
                rel = {
                        'top': eld.rect.top - ( scd.rect.top + scd.borders.top ),
                        'bottom': scd.rect.bottom - scd.borders.bottom - scd.scrollbar.bottom - eld.rect.bottom,
                        'left': eld.rect.left - ( scd.rect.left + scd.borders.left ),
                        'right': scd.rect.right - scd.borders.right - scd.scrollbar.right - eld.rect.right
                };
+       }
 
        if ( !config.direction || config.direction === 'y' ) {
                if ( rel.top < 0 ) {
@@ -606,6 +622,7 @@ OO.ui.Element.prototype.scrollElementIntoView = function ( config ) {
 /**
  * Bind a handler for an event on this.$element
  *
+ * @deprecated Use jQuery#on instead.
  * @param {string} event
  * @param {Function} callback
  */
@@ -616,6 +633,7 @@ OO.ui.Element.prototype.onDOMEvent = function ( event, callback ) {
 /**
  * Unbind a handler bound with #offDOMEvent
  *
+ * @deprecated Use jQuery#off instead.
  * @param {string} event
  * @param {Function} callback
  */
@@ -624,107 +642,36 @@ OO.ui.Element.prototype.offDOMEvent = function ( event, callback ) {
 };
 
 ( function () {
-       // Static
-
-       // jQuery 1.8.3 has a bug with handling focusin/focusout events inside iframes.
-       // Firefox doesn't support focusin/focusout at all, so we listen for 'focus'/'blur' on the
-       // document, and simulate a 'focusin'/'focusout' event on the target element and make
-       // it bubble from there.
-       //
-       // - http://jsfiddle.net/sw3hr/
-       // - http://bugs.jquery.com/ticket/14180
-       // - https://github.com/jquery/jquery/commit/1cecf64e5aa4153
-       function specialEvent( simulatedName, realName ) {
-               function handler( e ) {
-                       jQuery.event.simulate(
-                               simulatedName,
-                               e.target,
-                               jQuery.event.fix( e ),
-                               /* bubble = */ true
-                       );
-               }
-
-               return {
-                       setup: function () {
-                               var doc = this.ownerDocument || this,
-                                       attaches = $.data( doc, 'ooui-' + simulatedName + '-attaches' );
-                               if ( !attaches ) {
-                                       doc.addEventListener( realName, handler, true );
-                               }
-                               $.data( doc, 'ooui-' + simulatedName + '-attaches', ( attaches || 0 ) + 1 );
-                       },
-                       teardown: function () {
-                               var doc = this.ownerDocument || this,
-                                       attaches = $.data( doc, 'ooui-' + simulatedName + '-attaches' ) - 1;
-                               if ( !attaches ) {
-                                       doc.removeEventListener( realName, handler, true );
-                                       $.removeData( doc, 'ooui-' + simulatedName + '-attaches' );
-                               } else {
-                                       $.data( doc, 'ooui-' + simulatedName + '-attaches', attaches );
-                               }
-                       }
-               };
-       }
-
-       var hasOwn = Object.prototype.hasOwnProperty,
-               specialEvents = {
-                       focusin: specialEvent( 'focusin', 'focus' ),
-                       focusout: specialEvent( 'focusout', 'blur' )
-               };
-
        /**
         * Bind a handler for an event on a DOM element.
         *
-        * Uses jQuery internally for everything except for events which are
-        * known to have issues in the browser or in jQuery. This method
-        * should become obsolete eventually.
+        * Used to be for working around a jQuery bug (jqbug.com/14180),
+        * but obsolete as of jQuery 1.11.0.
         *
         * @static
+        * @deprecated Use jQuery#on instead.
         * @param {HTMLElement|jQuery} el DOM element
         * @param {string} event Event to bind
         * @param {Function} callback Callback to call when the event fires
         */
        OO.ui.Element.onDOMEvent = function ( el, event, callback ) {
-               var orig;
-
-               if ( hasOwn.call( specialEvents, event ) ) {
-                       // Replace jQuery's override with our own
-                       orig = $.event.special[event];
-                       $.event.special[event] = specialEvents[event];
-
-                       $( el ).on( event, callback );
-
-                       // Restore
-                       $.event.special[event] = orig;
-               } else {
-                       $( el ).on( event, callback );
-               }
+               $( el ).on( event, callback );
        };
 
        /**
         * Unbind a handler bound with #static-method-onDOMEvent.
         *
+        * @deprecated Use jQuery#off instead.
         * @static
         * @param {HTMLElement|jQuery} el DOM element
         * @param {string} event Event to unbind
         * @param {Function} [callback] Callback to unbind
         */
        OO.ui.Element.offDOMEvent = function ( el, event, callback ) {
-               var orig;
-               if ( hasOwn.call( specialEvents, event ) ) {
-                       // Replace jQuery's override with our own
-                       orig = $.event.special[event];
-                       $.event.special[event] = specialEvents[event];
-
-                       $( el ).off( event, callback );
-
-                       // Restore
-                       $.event.special[event] = orig;
-               } else {
-                       $( el ).off( event, callback );
-               }
+               $( el ).off( event, callback );
        };
 }() );
+
 /**
  * Embedded iframe with the same styles as its parent.
  *
@@ -955,6 +902,7 @@ OO.ui.Frame.prototype.setSize = function ( width, height ) {
        this.$element.css( { 'width': width, 'height': height } );
        return this;
 };
+
 /**
  * Container for elements in a child frame.
  *
@@ -1023,20 +971,29 @@ OO.mixinClass( OO.ui.Window, OO.EventEmitter );
 /* Events */
 
 /**
- * Open window.
+ * Window is setup.
  *
- * Fired after window has been opened.
+ * Fired after the setup process has been executed.
  *
- * @event open
+ * @event setup
  * @param {Object} data Window opening data
  */
 
 /**
- * Close window.
+ * Window is ready.
  *
- * Fired after window has been closed.
+ * Fired after the ready process has been executed.
  *
- * @event close
+ * @event ready
+ * @param {Object} data Window opening data
+ */
+
+/**
+ * Window is torn down
+ *
+ * Fired after the teardown process has been executed.
+ *
+ * @event teardown
  * @param {Object} data Window closing data
  */
 
@@ -1081,7 +1038,7 @@ OO.ui.Window.prototype.isVisible = function () {
  * @return {boolean} Window is opening
  */
 OO.ui.Window.prototype.isOpening = function () {
-       return !!this.opening && this.opening.state() !== 'resolved';
+       return !!this.opening && this.opening.state() === 'pending';
 };
 
 /**
@@ -1090,7 +1047,7 @@ OO.ui.Window.prototype.isOpening = function () {
  * @return {boolean} Window is closing
  */
 OO.ui.Window.prototype.isClosing = function () {
-       return !!this.closing && this.closing.state() !== 'resolved';
+       return !!this.closing && this.closing.state() === 'pending';
 };
 
 /**
@@ -1099,7 +1056,7 @@ OO.ui.Window.prototype.isClosing = function () {
  * @return {boolean} Window is opened
  */
 OO.ui.Window.prototype.isOpened = function () {
-       return !!this.opened && this.opened.state() !== 'resolved';
+       return !!this.opened && this.opened.state() === 'pending';
 };
 
 /**
@@ -1314,7 +1271,7 @@ OO.ui.Window.prototype.getTeardownProcess = function () {
 /**
  * Open window.
  *
- * Do not override this method. Use #geSetupProcess to do something each time the window closes.
+ * Do not override this method. Use #getSetupProcess to do something each time the window closes.
  *
  * @param {Object} [data] Window opening data
  * @fires initialize
@@ -1332,25 +1289,25 @@ OO.ui.Window.prototype.open = function ( data ) {
 
        // Open the window
        this.opening = $.Deferred();
+
+       this.$ariaHidden = $( 'body' ).children().not( this.$element.parentsUntil( 'body' ).last() )
+               .attr( 'aria-hidden', '' );
+
        this.frame.load().done( OO.ui.bind( function () {
                this.$element.show();
                this.visible = true;
-               this.emit( 'opening', data );
                this.getSetupProcess( data ).execute().done( OO.ui.bind( function () {
-                       this.emit( 'open', data );
+                       this.$element.addClass( 'oo-ui-window-setup' );
+                       this.emit( 'setup', data );
                        setTimeout( OO.ui.bind( function () {
-                               // Focus the content div (which has a tabIndex) to inactivate
-                               // (but not clear) selections in the parent frame.
-                               // Must happen after 'open' is emitted (to ensure it is visible)
-                               // but before 'ready' is emitted (so subclasses can give focus to something
-                               // else)
                                this.frame.$content.focus();
                                this.getReadyProcess( data ).execute().done( OO.ui.bind( function () {
+                                       this.$element.addClass( 'oo-ui-window-ready' );
                                        this.emit( 'ready', data );
                                        this.opened = $.Deferred();
-                                       this.opening.resolve( this.opened.promise() );
                                        // Now that we are totally done opening, it's safe to allow closing
                                        this.closing = null;
+                                       this.opening.resolve( this.opened.promise() );
                                }, this ) );
                        }, this ) );
                }, this ) );
@@ -1370,24 +1327,39 @@ OO.ui.Window.prototype.open = function ( data ) {
  * @return {jQuery.Promise} Promise resolved when window is closed
  */
 OO.ui.Window.prototype.close = function ( data ) {
+       var close;
+
        // Return existing promise if already closing or closed
        if ( this.closing ) {
                return this.closing.promise();
        }
 
+       // Close after opening is done if opening is in progress
+       if ( this.opening && this.opening.state() === 'pending' ) {
+               close = OO.ui.bind( function () {
+                       return this.close( data );
+               }, this );
+               return this.opening.then( close, close );
+       }
+
        // Close the window
        // This.closing needs to exist before we emit the closing event so that handlers can call
        // window.close() and trigger the safety check above
        this.closing = $.Deferred();
        this.frame.$content.find( ':focus' ).blur();
-       this.emit( 'closing', data );
+       this.$element.removeClass( 'oo-ui-window-ready' );
        this.getTeardownProcess( data ).execute().done( OO.ui.bind( function () {
+               this.$element.removeClass( 'oo-ui-window-setup' );
+               this.emit( 'teardown', data );
                // To do something different with #opened, resolve/reject #opened in the teardown process
-               if ( this.opened.state() === 'pending' ) {
+               if ( this.opened && this.opened.state() === 'pending' ) {
                        this.opened.resolve();
                }
-               this.emit( 'close', data );
                this.$element.hide();
+               if ( this.$ariaHidden ) {
+                       this.$ariaHidden.removeAttr( 'aria-hidden' );
+                       this.$ariaHidden = undefined;
+               }
                this.visible = false;
                this.closing.resolve();
                // Now that we are totally done closing, it's safe to allow opening
@@ -1396,6 +1368,7 @@ OO.ui.Window.prototype.close = function ( data ) {
 
        return this.closing.promise();
 };
+
 /**
  * Set of mutually exclusive windows.
  *
@@ -1444,78 +1417,61 @@ OO.mixinClass( OO.ui.WindowSet, OO.EventEmitter );
 /* Events */
 
 /**
- * @event opening
- * @param {OO.ui.Window} win Window that's being opened
+ * @event setup
+ * @param {OO.ui.Window} win Window that's been setup
  * @param {Object} config Window opening information
  */
 
 /**
- * @event open
- * @param {OO.ui.Window} win Window that's been opened
+ * @event ready
+ * @param {OO.ui.Window} win Window that's ready
  * @param {Object} config Window opening information
  */
 
 /**
- * @event closing
- * @param {OO.ui.Window} win Window that's being closed
- * @param {Object} config Window closing information
- */
-
-/**
- * @event close
- * @param {OO.ui.Window} win Window that's been closed
+ * @event teardown
+ * @param {OO.ui.Window} win Window that's been torn down
  * @param {Object} config Window closing information
  */
 
 /* Methods */
 
 /**
- * Handle a window that's being opened.
+ * Handle a window setup event.
  *
- * @param {OO.ui.Window} win Window that's being opened
+ * @param {OO.ui.Window} win Window that's been setup
  * @param {Object} [config] Window opening information
- * @fires opening
+ * @fires setup
  */
-OO.ui.WindowSet.prototype.onWindowOpening = function ( win, config ) {
+OO.ui.WindowSet.prototype.onWindowSetup = function ( win, config ) {
        if ( this.currentWindow && this.currentWindow !== win ) {
                this.currentWindow.close();
        }
        this.currentWindow = win;
-       this.emit( 'opening', win, config );
+       this.emit( 'setup', win, config );
 };
 
 /**
- * Handle a window that's been opened.
+ * Handle a window ready event.
  *
- * @param {OO.ui.Window} win Window that's been opened
+ * @param {OO.ui.Window} win Window that's ready
  * @param {Object} [config] Window opening information
- * @fires open
+ * @fires ready
  */
-OO.ui.WindowSet.prototype.onWindowOpen = function ( win, config ) {
-       this.emit( 'open', win, config );
+OO.ui.WindowSet.prototype.onWindowReady = function ( win, config ) {
+       this.emit( 'ready', win, config );
 };
 
 /**
- * Handle a window that's being closed.
+ * Handle a window teardown event.
  *
- * @param {OO.ui.Window} win Window that's being closed
+ * @param {OO.ui.Window} win Window that's been torn down
  * @param {Object} [config] Window closing information
- * @fires closing
+ * @fires teardown
  */
-OO.ui.WindowSet.prototype.onWindowClosing = function ( win, config ) {
+OO.ui.WindowSet.prototype.onWindowTeardown = function ( win, config ) {
        this.currentWindow = null;
-       this.emit( 'closing', win, config );
-};
-
-/**
- * Handle a window that's been closed.
- *
- * @param {OO.ui.Window} win Window that's been closed
- * @param {Object} [config] Window closing information
- * @fires close
- */
-OO.ui.WindowSet.prototype.onWindowClose = function ( win, config ) {
-       this.emit( 'close', win, config );
+       this.emit( 'teardown', win, config );
 };
 
 /**
@@ -1562,7 +1518,7 @@ OO.ui.WindowSet.prototype.createWindow = function ( name ) {
  * Connects event handlers and attaches it to the DOM. Calling
  * OO.ui.Window#open will not work until the window is added to the set.
  *
- * @param {OO.ui.Window} win
+ * @param {OO.ui.Window} win Window to add
  */
 OO.ui.WindowSet.prototype.addWindow = function ( win ) {
        if ( this.windowList.indexOf( win ) !== -1 ) {
@@ -1572,13 +1528,13 @@ OO.ui.WindowSet.prototype.addWindow = function ( win ) {
        this.windowList.push( win );
 
        win.connect( this, {
-               'opening': [ 'onWindowOpening', win ],
-               'open': [ 'onWindowOpen', win ],
-               'closing': [ 'onWindowClosing', win ],
-               'close': [ 'onWindowClose', win ]
+               'setup': [ 'onWindowSetup', win ],
+               'ready': [ 'onWindowReady', win ],
+               'teardown': [ 'onWindowTeardown', win ]
        } );
        this.$element.append( win.$element );
 };
+
 /**
  * Modal dialog window.
  *
@@ -1608,10 +1564,9 @@ OO.ui.Dialog = function OoUiDialog( config ) {
 
        // Events
        this.$element.on( 'mousedown', false );
-       this.connect( this, { 'open': 'onOpen' } );
 
        // Initialization
-       this.$element.addClass( 'oo-ui-dialog' );
+       this.$element.addClass( 'oo-ui-dialog' ).attr( 'role', 'dialog' );
        this.setSize( config.size );
 };
 
@@ -1694,13 +1649,6 @@ OO.ui.Dialog.prototype.onFrameDocumentKeyDown = function ( e ) {
        }
 };
 
-/**
- * Handle window open events.
- */
-OO.ui.Dialog.prototype.onOpen = function () {
-       this.$element.addClass( 'oo-ui-dialog-open' );
-};
-
 /**
  * Set dialog size.
  *
@@ -1718,9 +1666,6 @@ OO.ui.Dialog.prototype.setSize = function ( size ) {
                state = name === size;
                cssClass = sizeCssClasses[name];
                this.$element.toggleClass( cssClass, state );
-               if ( this.frame.$content ) {
-                       this.frame.$content.toggleClass( cssClass, state );
-               }
        }
 };
 
@@ -1770,7 +1715,7 @@ OO.ui.Dialog.prototype.getSetupProcess = function ( data ) {
 OO.ui.Dialog.prototype.getTeardownProcess = function ( data ) {
        return OO.ui.Dialog.super.prototype.getTeardownProcess.call( this, data )
                .first( function () {
-                       this.$element.removeClass( 'oo-ui-dialog-open' );
+                       // Wait for closing transition
                        return OO.ui.Process.static.delay( 250 );
                }, this )
                .next( function () {
@@ -1822,6 +1767,7 @@ OO.ui.Dialog.prototype.popPending = function () {
 
        return this;
 };
+
 /**
  * Container for elements.
  *
@@ -1851,6 +1797,7 @@ OO.ui.Layout = function OoUiLayout( config ) {
 
 OO.inheritClass( OO.ui.Layout, OO.ui.Element );
 OO.mixinClass( OO.ui.Layout, OO.EventEmitter );
+
 /**
  * User interface control.
  *
@@ -1936,6 +1883,7 @@ OO.ui.Widget.prototype.setDisabled = function ( disabled ) {
        this.wasDisabled = isDisabled;
        return this;
 };
+
 /**
  * A list of functions, called in sequence.
  *
@@ -2052,6 +2000,7 @@ OO.ui.Process.prototype.next = function ( step, context ) {
        this.steps.push( [ step, context || null ] );
        return this;
 };
+
 /**
  * Dialog for showing a confirmation/warning message.
  *
@@ -2099,10 +2048,10 @@ OO.ui.ConfirmationDialog.prototype.initialize = function () {
        this.$promptContainer = this.$( '<div>' ).addClass( 'oo-ui-dialog-confirm-promptContainer' );
 
        this.cancelButton = new OO.ui.ButtonWidget();
-       this.cancelButton.connect( this, { 'click': [ 'emit', 'done', 'cancel' ] } );
+       this.cancelButton.connect( this, { 'click': [ 'close', 'cancel' ] } );
 
        this.okButton = new OO.ui.ButtonWidget();
-       this.okButton.connect( this, { 'click': [ 'emit', 'done', 'ok' ] } );
+       this.okButton.connect( this, { 'click': [ 'close', 'ok' ] } );
 
        // Make the buttons
        contentLayout.$element.append( this.$promptContainer );
@@ -2112,15 +2061,10 @@ OO.ui.ConfirmationDialog.prototype.initialize = function () {
                this.okButton.$element,
                this.cancelButton.$element
        );
-
-       this.connect( this, {
-               'done': 'close',
-               'close': [ 'emit', 'cancel' ]
-       } );
 };
 
 /*
- * Open a confirmation dialog.
+ * Setup a confirmation dialog.
  *
  * @param {Object} [data] Window opening data including text of the dialog and text for the buttons
  * @param {jQuery|string} [data.prompt] Text to display or list of nodes to use as content of the dialog.
@@ -2128,26 +2072,44 @@ OO.ui.ConfirmationDialog.prototype.initialize = function () {
  * @param {jQuery|string|Function|null} [data.cancelLabel] Label of the cancel button
  * @param {string|string[]} [data.okFlags="constructive"] Flags for the OK button
  * @param {string|string[]} [data.cancelFlags="destructive"] Flags for the cancel button
+ * @return {OO.ui.Process} Setup process
  */
-OO.ui.ConfirmationDialog.prototype.setup = function ( data ) {
+OO.ui.ConfirmationDialog.prototype.getSetupProcess = function ( data ) {
        // Parent method
-       OO.ui.Dialog.prototype.setup.call( this, data );
-
-       var prompt = data.prompt || OO.ui.deferMsg( 'ooui-dialog-confirm-default-prompt' ),
-               okLabel = data.okLabel || OO.ui.deferMsg( 'ooui-dialog-confirm-default-ok' ),
-               cancelLabel = data.cancelLabel || OO.ui.deferMsg( 'ooui-dialog-confirm-default-cancel' ),
-               okFlags = data.okFlags || 'constructive',
-               cancelFlags = data.cancelFlags || 'destructive';
+       return OO.ui.ConfirmationDialog.super.prototype.getSetupProcess.call( this, data )
+               .next( function () {
+                       var prompt = data.prompt || OO.ui.deferMsg( 'ooui-dialog-confirm-default-prompt' ),
+                               okLabel = data.okLabel || OO.ui.deferMsg( 'ooui-dialog-confirm-default-ok' ),
+                               cancelLabel = data.cancelLabel || OO.ui.deferMsg( 'ooui-dialog-confirm-default-cancel' ),
+                               okFlags = data.okFlags || 'constructive',
+                               cancelFlags = data.cancelFlags || 'destructive';
+
+                       if ( typeof prompt === 'string' ) {
+                               this.$promptContainer.text( prompt );
+                       } else {
+                               this.$promptContainer.empty().append( prompt );
+                       }
 
-       if ( typeof prompt === 'string' ) {
-               this.$promptContainer.text( prompt );
-       } else {
-               this.$promptContainer.empty().append( prompt );
-       }
+                       this.okButton.setLabel( okLabel ).clearFlags().setFlags( okFlags );
+                       this.cancelButton.setLabel( cancelLabel ).clearFlags().setFlags( cancelFlags );
+               }, this );
+};
 
-       this.okButton.setLabel( okLabel ).clearFlags().setFlags( okFlags );
-       this.cancelButton.setLabel( cancelLabel ).clearFlags().setFlags( cancelFlags );
+/**
+ * @inheritdoc
+ */
+OO.ui.ConfirmationDialog.prototype.getTeardownProcess = function ( data ) {
+       // Parent method
+       return OO.ui.ConfirmationDialog.super.prototype.getTeardownProcess.call( this, data )
+               .first( function () {
+                       if ( data === 'ok' ) {
+                               this.opened.resolve();
+                       } else { // data === 'cancel', or no data
+                               this.opened.reject();
+                       }
+               }, this );
 };
+
 /**
  * Element with a button.
  *
@@ -2255,6 +2217,7 @@ OO.ui.ButtonedElement.prototype.setActive = function ( value ) {
        this.$button.toggleClass( 'oo-ui-buttonedElement-active', !!value );
        return this;
 };
+
 /**
  * Element that can be automatically clipped to visible boundaies.
  *
@@ -2382,18 +2345,23 @@ OO.ui.ClippableElement.prototype.clip = function () {
        if ( clipWidth ) {
                this.$clippable.css( { 'overflow-x': 'auto', 'width': desiredWidth } );
        } else {
-               this.$clippable.css( { 'overflow-x': '', 'width': this.idealWidth || '' } );
+               this.$clippable.css( 'width', this.idealWidth || '' );
+               this.$clippable.width(); // Force reflow for https://code.google.com/p/chromium/issues/detail?id=387290
+               this.$clippable.css( 'overflow-x', '' );
        }
        if ( clipHeight ) {
                this.$clippable.css( { 'overflow-y': 'auto', 'height': desiredHeight } );
        } else {
-               this.$clippable.css( { 'overflow-y': '', 'height': this.idealHeight || '' } );
+               this.$clippable.css( 'height', this.idealHeight || '' );
+               this.$clippable.height(); // Force reflow for https://code.google.com/p/chromium/issues/detail?id=387290
+               this.$clippable.css( 'overflow-y', '' );
        }
 
        this.clipped = clipWidth || clipHeight;
 
        return this;
 };
+
 /**
  * Element with named flags that can be added, removed, listed and checked.
  *
@@ -2493,6 +2461,7 @@ OO.ui.FlaggableElement.prototype.setFlags = function ( flags ) {
        }
        return this;
 };
+
 /**
  * Element containing a sequence of child elements.
  *
@@ -2510,7 +2479,6 @@ OO.ui.GroupElement = function OoUiGroupElement( $group, config ) {
        // Properties
        this.$group = $group;
        this.items = [];
-       this.$items = this.$( [] );
        this.aggregateItemEvents = {};
 };
 
@@ -2587,7 +2555,7 @@ OO.ui.GroupElement.prototype.aggregate = function ( events ) {
  */
 OO.ui.GroupElement.prototype.addItems = function ( items, index ) {
        var i, len, item, event, events, currentIndex,
-               $items = this.$( [] );
+               itemElements = [];
 
        for ( i = 0, len = items.length; i < len; i++ ) {
                item = items[i];
@@ -2610,22 +2578,20 @@ OO.ui.GroupElement.prototype.addItems = function ( items, index ) {
                        item.connect( this, events );
                }
                item.setElementGroup( this );
-               $items = $items.add( item.$element );
+               itemElements.push( item.$element.get( 0 ) );
        }
 
        if ( index === undefined || index < 0 || index >= this.items.length ) {
-               this.$group.append( $items );
+               this.$group.append( itemElements );
                this.items.push.apply( this.items, items );
        } else if ( index === 0 ) {
-               this.$group.prepend( $items );
+               this.$group.prepend( itemElements );
                this.items.unshift.apply( this.items, items );
        } else {
-               this.$items.eq( index ).before( $items );
+               this.items[index].$element.before( itemElements );
                this.items.splice.apply( this.items, [ index, 0 ].concat( items ) );
        }
 
-       this.$items = this.$items.add( $items );
-
        return this;
 };
 
@@ -2658,7 +2624,6 @@ OO.ui.GroupElement.prototype.removeItems = function ( items ) {
                        item.setElementGroup( null );
                        this.items.splice( index, 1 );
                        item.$element.detach();
-                       this.$items = this.$items.not( item.$element );
                }
        }
 
@@ -2689,13 +2654,13 @@ OO.ui.GroupElement.prototype.clearItems = function () {
                        item.disconnect( this, remove );
                }
                item.setElementGroup( null );
+               item.$element.detach();
        }
-       this.items = [];
-       this.$items.detach();
-       this.$items = this.$( [] );
 
+       this.items = [];
        return this;
 };
+
 /**
  * Element containing an icon.
  *
@@ -2783,6 +2748,7 @@ OO.ui.IconedElement.prototype.setIcon = function ( icon ) {
 OO.ui.IconedElement.prototype.getIcon = function () {
        return this.icon;
 };
+
 /**
  * Element containing an indicator.
  *
@@ -2896,6 +2862,7 @@ OO.ui.IndicatedElement.prototype.getIndicator = function () {
 OO.ui.IndicatedElement.prototype.getIndicatorTitle = function () {
        return this.indicatorTitle;
 };
+
 /**
  * Element containing a label.
  *
@@ -2994,6 +2961,7 @@ OO.ui.LabeledElement.prototype.fitLabel = function () {
        }
        return this;
 };
+
 /**
  * Popuppable element.
  *
@@ -3044,6 +3012,7 @@ OO.ui.PopuppableElement.prototype.showPopup = function () {
 OO.ui.PopuppableElement.prototype.hidePopup = function () {
        this.popup.hide();
 };
+
 /**
  * Element with a title.
  *
@@ -3110,6 +3079,7 @@ OO.ui.TitledElement.prototype.setTitle = function ( title ) {
 OO.ui.TitledElement.prototype.getTitle = function () {
        return this.title;
 };
+
 /**
  * Generic toolbar tool.
  *
@@ -3361,6 +3331,7 @@ OO.ui.Tool.prototype.destroy = function () {
        this.toolbar.disconnect( this );
        this.$element.remove();
 };
+
 /**
  * Collection of tool groups.
  *
@@ -3569,6 +3540,7 @@ OO.ui.Toolbar.prototype.releaseTool = function ( tool ) {
 OO.ui.Toolbar.prototype.getToolAccelerator = function () {
        return undefined;
 };
+
 /**
  * Factory for tools.
  *
@@ -3681,6 +3653,7 @@ OO.ui.ToolFactory.prototype.extract = function ( collection, used ) {
        }
        return names;
 };
+
 /**
  * Collection of tools.
  *
@@ -3999,6 +3972,7 @@ OO.ui.ToolGroup.prototype.destroy = function () {
        }
        this.$element.remove();
 };
+
 /**
  * Factory for tool groups.
  *
@@ -4037,6 +4011,7 @@ OO.ui.ToolGroupFactory.static.getDefaultClasses = function () {
                OO.ui.MenuToolGroup
        ];
 };
+
 /**
  * Layout made of a fieldset and optional legend.
  *
@@ -4084,6 +4059,7 @@ OO.mixinClass( OO.ui.FieldsetLayout, OO.ui.GroupElement );
 /* Static Properties */
 
 OO.ui.FieldsetLayout.static.tagName = 'div';
+
 /**
  * Layout made of a field and optional label.
  *
@@ -4199,6 +4175,7 @@ OO.ui.FieldLayout.prototype.setAlignment = function ( value ) {
 
        return this;
 };
+
 /**
  * Layout made of proportionally sized columns and rows.
  *
@@ -4359,6 +4336,7 @@ OO.ui.GridLayout.prototype.update = function () {
 OO.ui.GridLayout.prototype.getPanel = function ( x, y ) {
        return this.panels[( x * this.widths.length ) + y];
 };
+
 /**
  * Layout containing a series of pages.
  *
@@ -4371,7 +4349,6 @@ OO.ui.GridLayout.prototype.getPanel = function ( x, y ) {
  * @cfg {boolean} [autoFocus=true] Focus on the first focusable element when changing to a page
  * @cfg {boolean} [outlined=false] Show an outline
  * @cfg {boolean} [editable=false] Show controls for adding, removing and reordering pages
- * @cfg {Object[]} [adders] List of adders for controls, each with name, icon and title properties
  */
 OO.ui.BookletLayout = function OoUiBookletLayout( config ) {
        // Initialize configuration
@@ -4390,7 +4367,6 @@ OO.ui.BookletLayout = function OoUiBookletLayout( config ) {
        this.outlined = !!config.outlined;
        if ( this.outlined ) {
                this.editable = !!config.editable;
-               this.adders = config.adders || null;
                this.outlineControlsWidget = null;
                this.outlineWidget = new OO.ui.OutlineWidget( { '$': this.$ } );
                this.outlinePanel = new OO.ui.PanelLayout( { '$': this.$, 'scrollable': true } );
@@ -4401,8 +4377,7 @@ OO.ui.BookletLayout = function OoUiBookletLayout( config ) {
                this.outlineVisible = true;
                if ( this.editable ) {
                        this.outlineControlsWidget = new OO.ui.OutlineControlsWidget(
-                               this.outlineWidget,
-                               { '$': this.$, 'adders': this.adders }
+                               this.outlineWidget, { '$': this.$ }
                        );
                }
        }
@@ -4780,6 +4755,7 @@ OO.ui.BookletLayout.prototype.updateOutlineWidget = function () {
 
        return this;
 };
+
 /**
  * Layout that expands to cover the entire area of its parent, with optional scrolling and padding.
  *
@@ -4812,6 +4788,7 @@ OO.ui.PanelLayout = function OoUiPanelLayout( config ) {
 /* Setup */
 
 OO.inheritClass( OO.ui.PanelLayout, OO.ui.Layout );
+
 /**
  * Page within an booklet layout.
  *
@@ -4905,6 +4882,7 @@ OO.ui.PageLayout.prototype.setActive = function ( active ) {
                this.emit( 'active', this.active );
        }
 };
+
 /**
  * Layout containing a series of mutually exclusive pages.
  *
@@ -5054,9 +5032,13 @@ OO.ui.StackLayout.prototype.clearItems = function () {
  * @fires set
  */
 OO.ui.StackLayout.prototype.setItem = function ( item ) {
+       var i, len;
+
        if ( item !== this.currentItem ) {
                if ( !this.continuous ) {
-                       this.$items.css( 'display', '' );
+                       for ( i = 0, len = this.items.length; i < len; i++ ) {
+                               this.items[i].$element.css( 'display', '' );
+                       }
                }
                if ( $.inArray( item, this.items ) !== -1 ) {
                        if ( !this.continuous ) {
@@ -5071,6 +5053,7 @@ OO.ui.StackLayout.prototype.setItem = function ( item ) {
 
        return this;
 };
+
 /**
  * Horizontal bar layout of tools as icon buttons.
  *
@@ -5100,6 +5083,7 @@ OO.ui.BarToolGroup.static.titleTooltips = true;
 OO.ui.BarToolGroup.static.accelTooltips = true;
 
 OO.ui.BarToolGroup.static.name = 'bar';
+
 /**
  * Popup list of tools with an icon and optional label.
  *
@@ -5252,6 +5236,7 @@ OO.ui.PopupToolGroup.prototype.setActive = function ( value ) {
                }
        }
 };
+
 /**
  * Drop down list layout of tools as labeled icon buttons.
  *
@@ -5279,6 +5264,7 @@ OO.inheritClass( OO.ui.ListToolGroup, OO.ui.PopupToolGroup );
 OO.ui.ListToolGroup.static.accelTooltips = true;
 
 OO.ui.ListToolGroup.static.name = 'list';
+
 /**
  * Drop down menu layout of tools as selectable menu items.
  *
@@ -5333,6 +5319,7 @@ OO.ui.MenuToolGroup.prototype.onUpdateState = function () {
 
        this.setLabel( labelTexts.join( ', ' ) || ' ' );
 };
+
 /**
  * Tool that shows a popup when selected.
  *
@@ -5390,6 +5377,7 @@ OO.ui.PopupTool.prototype.onSelect = function () {
 OO.ui.PopupTool.prototype.onUpdateState = function () {
        this.setActive( false );
 };
+
 /**
  * Group widget.
  *
@@ -5440,6 +5428,7 @@ OO.ui.GroupWidget.prototype.setDisabled = function ( disabled ) {
 
        return this;
 };
+
 /**
  * Item widget.
  *
@@ -5484,6 +5473,7 @@ OO.ui.ItemWidget.prototype.setElementGroup = function ( group ) {
 
        return this;
 };
+
 /**
  * Icon widget.
  *
@@ -5519,6 +5509,7 @@ OO.mixinClass( OO.ui.IconWidget, OO.ui.TitledElement );
 /* Static Properties */
 
 OO.ui.IconWidget.static.tagName = 'span';
+
 /**
  * Indicator widget.
  *
@@ -5554,6 +5545,7 @@ OO.mixinClass( OO.ui.IndicatorWidget, OO.ui.TitledElement );
 /* Static Properties */
 
 OO.ui.IndicatorWidget.static.tagName = 'span';
+
 /**
  * Container for multiple related buttons.
  *
@@ -5585,6 +5577,7 @@ OO.ui.ButtonGroupWidget = function OoUiButtonGroupWidget( config ) {
 
 OO.inheritClass( OO.ui.ButtonGroupWidget, OO.ui.Widget );
 OO.mixinClass( OO.ui.ButtonGroupWidget, OO.ui.GroupElement );
+
 /**
  * Button widget.
  *
@@ -5685,6 +5678,7 @@ OO.ui.ButtonWidget.prototype.onKeyPress = function ( e ) {
        }
        return false;
 };
+
 /**
  * Input widget.
  *
@@ -5880,6 +5874,7 @@ OO.ui.InputWidget.prototype.focus = function () {
        this.$input.focus();
        return this;
 };
+
 /**
  * Checkbox widget.
  *
@@ -5946,6 +5941,7 @@ OO.ui.CheckboxInputWidget.prototype.onEdit = function () {
                }, this ) );
        }
 };
+
 /**
  * Label widget.
  *
@@ -5998,6 +5994,7 @@ OO.ui.LabelWidget.prototype.onClick = function () {
        this.input.simulateLabelClick();
        return false;
 };
+
 /**
  * Lookup input widget.
  *
@@ -6231,6 +6228,7 @@ OO.ui.LookupInputWidget.prototype.getLookupMenuItemsFromData = function () {
        // Stub, implemented in subclass
        return [];
 };
+
 /**
  * Option widget.
  *
@@ -6363,7 +6361,7 @@ OO.ui.OptionWidget.prototype.isPressed = function () {
  * @chainable
  */
 OO.ui.OptionWidget.prototype.setSelected = function ( state ) {
-       if ( !this.isDisabled() && this.constructor.static.selectable ) {
+       if ( this.constructor.static.selectable ) {
                this.selected = !!state;
                if ( this.selected ) {
                        this.$element.addClass( 'oo-ui-optionWidget-selected' );
@@ -6384,7 +6382,7 @@ OO.ui.OptionWidget.prototype.setSelected = function ( state ) {
  * @chainable
  */
 OO.ui.OptionWidget.prototype.setHighlighted = function ( state ) {
-       if ( !this.isDisabled() && this.constructor.static.highlightable ) {
+       if ( this.constructor.static.highlightable ) {
                this.highlighted = !!state;
                if ( this.highlighted ) {
                        this.$element.addClass( 'oo-ui-optionWidget-highlighted' );
@@ -6402,7 +6400,7 @@ OO.ui.OptionWidget.prototype.setHighlighted = function ( state ) {
  * @chainable
  */
 OO.ui.OptionWidget.prototype.setPressed = function ( state ) {
-       if ( !this.isDisabled() && this.constructor.static.pressable ) {
+       if ( this.constructor.static.pressable ) {
                this.pressed = !!state;
                if ( this.pressed ) {
                        this.$element.addClass( 'oo-ui-optionWidget-pressed' );
@@ -6448,6 +6446,7 @@ OO.ui.OptionWidget.prototype.flash = function () {
 OO.ui.OptionWidget.prototype.getData = function () {
        return this.data;
 };
+
 /**
  * Selection of options.
  *
@@ -6959,6 +6958,7 @@ OO.ui.SelectWidget.prototype.clearItems = function () {
 
        return this;
 };
+
 /**
  * Menu item widget.
  *
@@ -6985,6 +6985,7 @@ OO.ui.MenuItemWidget = function OoUiMenuItemWidget( data, config ) {
 /* Setup */
 
 OO.inheritClass( OO.ui.MenuItemWidget, OO.ui.OptionWidget );
+
 /**
  * Menu widget.
  *
@@ -7242,6 +7243,7 @@ OO.ui.MenuWidget.prototype.hide = function () {
 
        return this;
 };
+
 /**
  * Inline menu of options.
  *
@@ -7349,6 +7351,7 @@ OO.ui.InlineMenuWidget.prototype.onClick = function ( e ) {
        }
        return false;
 };
+
 /**
  * Menu section item widget.
  *
@@ -7378,6 +7381,7 @@ OO.inheritClass( OO.ui.MenuSectionItemWidget, OO.ui.OptionWidget );
 OO.ui.MenuSectionItemWidget.static.selectable = false;
 
 OO.ui.MenuSectionItemWidget.static.highlightable = false;
+
 /**
  * Create an OO.ui.OutlineWidget object.
  *
@@ -7403,6 +7407,7 @@ OO.ui.OutlineWidget = function OoUiOutlineWidget( config ) {
 /* Setup */
 
 OO.inheritClass( OO.ui.OutlineWidget, OO.ui.SelectWidget );
+
 /**
  * Creates an OO.ui.OutlineControlsWidget object.
  *
@@ -7459,7 +7464,7 @@ OO.ui.OutlineControlsWidget = function OoUiOutlineControlsWidget( outline, confi
 
        // Initialization
        this.$element.addClass( 'oo-ui-outlineControlsWidget' );
-       this.$group.addClass( 'oo-ui-outlineControlsWidget-adders' );
+       this.$group.addClass( 'oo-ui-outlineControlsWidget-items' );
        this.$movers
                .addClass( 'oo-ui-outlineControlsWidget-movers' )
                .append( this.removeButton.$element, this.upButton.$element, this.downButton.$element );
@@ -7516,6 +7521,7 @@ OO.ui.OutlineControlsWidget.prototype.onOutlineChange = function () {
        this.downButton.setDisabled( !movable || selectedItem === lastMovable );
        this.removeButton.setDisabled( !removable );
 };
+
 /**
  * Creates an OO.ui.OutlineItemWidget object.
  *
@@ -7642,6 +7648,7 @@ OO.ui.OutlineItemWidget.prototype.setLevel = function ( level ) {
 
        return this;
 };
+
 /**
  * Option widget that looks like a button.
  *
@@ -7689,10 +7696,13 @@ OO.ui.ButtonOptionWidget.static.cancelButtonMouseDownEvents = false;
 OO.ui.ButtonOptionWidget.prototype.setSelected = function ( state ) {
        OO.ui.ButtonOptionWidget.super.prototype.setSelected.call( this, state );
 
-       this.setActive( state );
+       if ( this.constructor.static.selectable ) {
+               this.setActive( state );
+       }
 
        return this;
 };
+
 /**
  * Select widget containing button options.
  *
@@ -7715,6 +7725,7 @@ OO.ui.ButtonSelectWidget = function OoUiButtonSelectWidget( config ) {
 /* Setup */
 
 OO.inheritClass( OO.ui.ButtonSelectWidget, OO.ui.SelectWidget );
+
 /**
  * Container for content that is overlaid and positioned absolutely.
  *
@@ -7960,6 +7971,7 @@ OO.ui.PopupWidget.prototype.display = function ( width, height, transition ) {
 
        return this;
 };
+
 /**
  * Button that shows and hides a popup.
  *
@@ -8011,6 +8023,7 @@ OO.ui.PopupButtonWidget.prototype.onClick = function ( e ) {
        }
        return false;
 };
+
 /**
  * Search widget.
  *
@@ -8164,6 +8177,7 @@ OO.ui.SearchWidget.prototype.getQuery = function () {
 OO.ui.SearchWidget.prototype.getResults = function () {
        return this.results;
 };
+
 /**
  * Text input widget.
  *
@@ -8376,6 +8390,7 @@ OO.ui.TextInputWidget.prototype.select = function () {
        this.$input.select();
        return this;
 };
+
 /**
  * Menu for a text input widget.
  *
@@ -8466,7 +8481,7 @@ OO.ui.TextInputMenuWidget.prototype.position = function () {
                // Fix for RTL (for some reason, no need to fix if the frameoffset is set)
                if ( this.$element.css( 'direction' ) === 'rtl' ) {
                        dimensions.right = this.$element.parent().position().left -
-                               dimensions.width - dimensions.left;
+                               $container.width() - dimensions.left;
                        // Erase the value for 'left':
                        delete dimensions.left;
                }
@@ -8476,6 +8491,7 @@ OO.ui.TextInputMenuWidget.prototype.position = function () {
        this.setIdealSize( $container.width() );
        return this;
 };
+
 /**
  * Width with on and off states.
  *
@@ -8535,6 +8551,7 @@ OO.ui.ToggleWidget.prototype.setValue = function ( value ) {
        }
        return this;
 };
+
 /**
  * Button that toggles on and off.
  *
@@ -8593,6 +8610,7 @@ OO.ui.ToggleButtonWidget.prototype.setValue = function ( value ) {
 
        return this;
 };
+
 /**
  * Switch that slides on and off.
  *
@@ -8646,4 +8664,7 @@ OO.ui.ToggleSwitchWidget.prototype.onClick = function ( e ) {
                this.setValue( !this.value );
        }
 };
+
 }( OO ) );
+
+//# sourceMappingURL=oojs-ui.js.map
\ No newline at end of file