Update OOjs UI to v0.1.0-pre (d4cfcce969)
authorJames D. Forrester <jforrester@wikimedia.org>
Fri, 21 Nov 2014 00:12:50 +0000 (16:12 -0800)
committerJames D. Forrester <jforrester@wikimedia.org>
Fri, 21 Nov 2014 00:13:21 +0000 (16:13 -0800)
New changes:
f6adfbc Give help content box a reasonable line height for legibility
af5d71c Remove CSS hack for positioning popupButtonWidget
c0768f9 PHP: Add missing OOUI\Exception class
76800b4 PHP: Wrap __toString() in try-catch to avoid unhelpful fatals
d399920 Revert "Followup ca6a16f: use parent selector both for hiding and showing windows"
234cd9f Revert "Show the modal overlay as soon as openWindow is called"

Change-Id: I317b4a747389de35411aca4ffdbbc2306b5b74cc

resources/lib/oojs-ui/oojs-ui-apex.css
resources/lib/oojs-ui/oojs-ui-apex.js
resources/lib/oojs-ui/oojs-ui-apex.svg.css
resources/lib/oojs-ui/oojs-ui-mediawiki.css
resources/lib/oojs-ui/oojs-ui-mediawiki.js
resources/lib/oojs-ui/oojs-ui-mediawiki.svg.css
resources/lib/oojs-ui/oojs-ui.js

index 901b2ff..6af125f 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (20c61ec865)
+ * OOjs UI v0.1.0-pre (d4cfcce969)
  * 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: 2014-11-20T18:41:36Z
+ * Date: 2014-11-21T00:12:46Z
  */
 .oo-ui-progressBarWidget-slide-frames from {
        margin-left: -40%;
 }
 .oo-ui-fieldLayout .oo-ui-fieldLayout-help-content {
        padding: 0.5em 0.75em;
+       line-height: 1.5em;
 }
 .oo-ui-fieldLayout:last-child {
        margin-bottom: 0;
 .oo-ui-popupButtonWidget.oo-ui-buttonElement-frameless > .oo-ui-popupWidget {
        left: 1em;
 }
-.oo-ui-popupButtonWidget.oo-ui-buttonElement-frameless > .oo-ui-popupWidget > .oo-ui-popupWidget-popup {
-       left: -1em;
-}
 .oo-ui-popupButtonWidget.oo-ui-buttonElement-framed > .oo-ui-popupWidget {
        left: 1.25em;
 }
-.oo-ui-popupButtonWidget.oo-ui-buttonElement-framed > .oo-ui-popupWidget > .oo-ui-popupWidget-popup {
-       left: -1.25em;
-}
 .oo-ui-textInputWidget {
        position: relative;
        -webkit-box-sizing: border-box;
        height: 0;
        overflow: hidden;
 }
-.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-load {
+.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-setup {
        width: auto;
        height: auto;
        top: 0;
        width: 100%;
        height: 100%;
 }
-.oo-ui-windowManager-modal > .oo-ui-dialog > .oo-ui-window-frame {
-       visibility: hidden;
-}
-.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-ready > .oo-ui-window-frame {
-       visibility: visible;
-}
 .oo-ui-windowManager-fullscreen > .oo-ui-dialog > .oo-ui-window-frame {
        width: 100%;
        height: 100%;
             -o-transition: all 250ms ease-in-out;
                transition: all 250ms ease-in-out;
 }
-.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-load {
+.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-ready {
        opacity: 1;
 }
 .oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-ready > .oo-ui-window-frame {
index 0ef5aa1..3d06808 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (20c61ec865)
+ * OOjs UI v0.1.0-pre (d4cfcce969)
  * 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: 2014-11-20T18:41:26Z
+ * Date: 2014-11-21T00:12:34Z
  */
 /* Instantiation */
 
index c50ad4f..a3a7e34 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (20c61ec865)
+ * OOjs UI v0.1.0-pre (d4cfcce969)
  * 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: 2014-11-20T18:41:36Z
+ * Date: 2014-11-21T00:12:46Z
  */
 .oo-ui-progressBarWidget-slide-frames from {
        margin-left: -40%;
 }
 .oo-ui-fieldLayout .oo-ui-fieldLayout-help-content {
        padding: 0.5em 0.75em;
+       line-height: 1.5em;
 }
 .oo-ui-fieldLayout:last-child {
        margin-bottom: 0;
 .oo-ui-popupButtonWidget.oo-ui-buttonElement-frameless > .oo-ui-popupWidget {
        left: 1em;
 }
-.oo-ui-popupButtonWidget.oo-ui-buttonElement-frameless > .oo-ui-popupWidget > .oo-ui-popupWidget-popup {
-       left: -1em;
-}
 .oo-ui-popupButtonWidget.oo-ui-buttonElement-framed > .oo-ui-popupWidget {
        left: 1.25em;
 }
-.oo-ui-popupButtonWidget.oo-ui-buttonElement-framed > .oo-ui-popupWidget > .oo-ui-popupWidget-popup {
-       left: -1.25em;
-}
 .oo-ui-textInputWidget {
        position: relative;
        -webkit-box-sizing: border-box;
        height: 0;
        overflow: hidden;
 }
-.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-load {
+.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-setup {
        width: auto;
        height: auto;
        top: 0;
        width: 100%;
        height: 100%;
 }
-.oo-ui-windowManager-modal > .oo-ui-dialog > .oo-ui-window-frame {
-       visibility: hidden;
-}
-.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-ready > .oo-ui-window-frame {
-       visibility: visible;
-}
 .oo-ui-windowManager-fullscreen > .oo-ui-dialog > .oo-ui-window-frame {
        width: 100%;
        height: 100%;
             -o-transition: all 250ms ease-in-out;
                transition: all 250ms ease-in-out;
 }
-.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-load {
+.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-ready {
        opacity: 1;
 }
 .oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-ready > .oo-ui-window-frame {
index 11e6204..de3a155 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (20c61ec865)
+ * OOjs UI v0.1.0-pre (d4cfcce969)
  * 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: 2014-11-20T18:41:36Z
+ * Date: 2014-11-21T00:12:46Z
  */
 .oo-ui-progressBarWidget-slide-frames from {
        margin-left: -40%;
 }
 .oo-ui-fieldLayout .oo-ui-fieldLayout-help-content {
        padding: 0.5em 0.75em;
+       line-height: 1.5em;
 }
 .oo-ui-fieldLayout:last-child {
        margin-bottom: 0;
 .oo-ui-popupButtonWidget.oo-ui-buttonElement-frameless > .oo-ui-popupWidget {
        left: 1em;
 }
-.oo-ui-popupButtonWidget.oo-ui-buttonElement-frameless > .oo-ui-popupWidget > .oo-ui-popupWidget-popup {
-       left: -1em;
-}
 .oo-ui-popupButtonWidget.oo-ui-buttonElement-framed > .oo-ui-popupWidget {
        left: 1.75em;
 }
-.oo-ui-popupButtonWidget.oo-ui-buttonElement-framed > .oo-ui-popupWidget > .oo-ui-popupWidget-popup {
-       left: -1.75em;
-}
 .oo-ui-checkboxInputWidget {
        position: relative;
        line-height: 1.6em;
        height: 0;
        overflow: hidden;
 }
-.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-load {
+.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-setup {
        width: auto;
        height: auto;
        top: 0;
        width: 100%;
        height: 100%;
 }
-.oo-ui-windowManager-modal > .oo-ui-dialog > .oo-ui-window-frame {
-       visibility: hidden;
-}
-.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-ready > .oo-ui-window-frame {
-       visibility: visible;
-}
 .oo-ui-windowManager-fullscreen > .oo-ui-dialog > .oo-ui-window-frame {
        width: 100%;
        height: 100%;
             -o-transition: all 250ms ease-in-out;
                transition: all 250ms ease-in-out;
 }
-.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-load {
+.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-ready {
        opacity: 1;
 }
 .oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-ready > .oo-ui-window-frame {
index e2520a1..00ac351 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (20c61ec865)
+ * OOjs UI v0.1.0-pre (d4cfcce969)
  * 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: 2014-11-20T18:41:26Z
+ * Date: 2014-11-21T00:12:34Z
  */
 /**
  * @class
index 63d5399..2b5dfa1 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (20c61ec865)
+ * OOjs UI v0.1.0-pre (d4cfcce969)
  * 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: 2014-11-20T18:41:36Z
+ * Date: 2014-11-21T00:12:46Z
  */
 .oo-ui-progressBarWidget-slide-frames from {
        margin-left: -40%;
 }
 .oo-ui-fieldLayout .oo-ui-fieldLayout-help-content {
        padding: 0.5em 0.75em;
+       line-height: 1.5em;
 }
 .oo-ui-fieldLayout:last-child {
        margin-bottom: 0;
 .oo-ui-popupButtonWidget.oo-ui-buttonElement-frameless > .oo-ui-popupWidget {
        left: 1em;
 }
-.oo-ui-popupButtonWidget.oo-ui-buttonElement-frameless > .oo-ui-popupWidget > .oo-ui-popupWidget-popup {
-       left: -1em;
-}
 .oo-ui-popupButtonWidget.oo-ui-buttonElement-framed > .oo-ui-popupWidget {
        left: 1.75em;
 }
-.oo-ui-popupButtonWidget.oo-ui-buttonElement-framed > .oo-ui-popupWidget > .oo-ui-popupWidget-popup {
-       left: -1.75em;
-}
 .oo-ui-checkboxInputWidget {
        position: relative;
        line-height: 1.6em;
        height: 0;
        overflow: hidden;
 }
-.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-load {
+.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-setup {
        width: auto;
        height: auto;
        top: 0;
        width: 100%;
        height: 100%;
 }
-.oo-ui-windowManager-modal > .oo-ui-dialog > .oo-ui-window-frame {
-       visibility: hidden;
-}
-.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-ready > .oo-ui-window-frame {
-       visibility: visible;
-}
 .oo-ui-windowManager-fullscreen > .oo-ui-dialog > .oo-ui-window-frame {
        width: 100%;
        height: 100%;
             -o-transition: all 250ms ease-in-out;
                transition: all 250ms ease-in-out;
 }
-.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-load {
+.oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-ready {
        opacity: 1;
 }
 .oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-ready > .oo-ui-window-frame {
index 80d4c1d..a7d4fc2 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (20c61ec865)
+ * OOjs UI v0.1.0-pre (d4cfcce969)
  * 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: 2014-11-20T18:41:26Z
+ * Date: 2014-11-21T00:12:34Z
  */
 ( function ( OO ) {
 
@@ -1463,6 +1463,7 @@ OO.ui.Widget.prototype.updateDisabled = function () {
  * @param {Object} [config] Configuration options
  * @cfg {string} [size] Symbolic name of dialog size, `small`, `medium`, `large` or `full`; omit to
  *   use #static-size
+ * @fires initialize
  */
 OO.ui.Window = function OoUiWindow( config ) {
        // Configuration initialization
@@ -1844,7 +1845,7 @@ OO.ui.Window.prototype.getTeardownProcess = function () {
  * instead of display.
  *
  * @param {boolean} [show] Make window visible, omit to toggle visibility
- * @fires toggle
+ * @fires visible
  * @chainable
  */
 OO.ui.Window.prototype.toggle = function ( show ) {
@@ -2105,7 +2106,7 @@ OO.ui.Window.prototype.teardown = function ( data ) {
 
        this.getTeardownProcess( data ).execute().done( function () {
                // Force redraw by asking the browser to measure the elements' widths
-               win.$element.removeClass( 'oo-ui-window-load oo-ui-window-setup' ).width();
+               win.$element.removeClass( 'oo-ui-window-setup' ).width();
                win.$content.removeClass( 'oo-ui-window-content-setup' ).width();
                win.$element.hide();
                win.visible = false;
@@ -2118,9 +2119,10 @@ OO.ui.Window.prototype.teardown = function ( data ) {
 /**
  * Load the frame contents.
  *
- * Once the iframe's stylesheets are loaded the returned promise will be resolved. Calling while
- * loading will return a promise but not trigger a new loading cycle. Calling after loading is
- * complete will return a promise that's already been resolved.
+ * Once the iframe's stylesheets are loaded, the `load` event will be emitted and the returned
+ * promise will be resolved. Calling while loading will return a promise but not trigger a new
+ * loading cycle. Calling after loading is complete will return a promise that's already been
+ * resolved.
  *
  * Sounds simple right? Read on...
  *
@@ -2149,13 +2151,12 @@ OO.ui.Window.prototype.teardown = function ( data ) {
  * All this stylesheet injection and polling magic is in #transplantStyles.
  *
  * @return {jQuery.Promise} Promise resolved when loading is complete
+ * @fires load
  */
 OO.ui.Window.prototype.load = function () {
        var sub, doc, loading,
                win = this;
 
-       this.$element.addClass( 'oo-ui-window-load' );
-
        // Non-isolated windows are already "loaded"
        if ( !this.loading && !this.isolated ) {
                this.loading = $.Deferred().resolve();
@@ -2879,10 +2880,13 @@ OO.ui.WindowManager.prototype.openWindow = function ( win, data ) {
 
        // Window opening
        if ( opening.state() !== 'rejected' ) {
-               if ( !win.getManager() ) {
+               // Begin loading the window if it's not loading or loaded already - may take noticable time
+               // and we want to do this in parallel with any other preparatory actions
+               if ( !win.isLoading() && !win.isLoaded() ) {
+                       // Finish initializing the window (must be done after manager is attached to DOM)
                        win.setManager( this );
+                       preparing.push( win.load() );
                }
-               preparing.push( win.load() );
 
                if ( this.closing ) {
                        // If a window is currently closing, wait for it to complete