From bb698dd1a0015fafb2636160b8653dd4fa21c31c Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Thu, 20 Nov 2014 16:12:50 -0800 Subject: [PATCH] Update OOjs UI to v0.1.0-pre (d4cfcce969) 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 | 21 ++++----------- resources/lib/oojs-ui/oojs-ui-apex.js | 4 +-- resources/lib/oojs-ui/oojs-ui-apex.svg.css | 21 ++++----------- resources/lib/oojs-ui/oojs-ui-mediawiki.css | 21 ++++----------- resources/lib/oojs-ui/oojs-ui-mediawiki.js | 4 +-- .../lib/oojs-ui/oojs-ui-mediawiki.svg.css | 21 ++++----------- resources/lib/oojs-ui/oojs-ui.js | 26 +++++++++++-------- 7 files changed, 39 insertions(+), 79 deletions(-) diff --git a/resources/lib/oojs-ui/oojs-ui-apex.css b/resources/lib/oojs-ui/oojs-ui-apex.css index 901b2ffe19..6af125fab9 100644 --- a/resources/lib/oojs-ui/oojs-ui-apex.css +++ b/resources/lib/oojs-ui/oojs-ui-apex.css @@ -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%; @@ -383,6 +383,7 @@ } .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; @@ -1306,15 +1307,9 @@ .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; @@ -2030,7 +2025,7 @@ 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; @@ -2052,12 +2047,6 @@ 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%; @@ -2088,7 +2077,7 @@ -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 { diff --git a/resources/lib/oojs-ui/oojs-ui-apex.js b/resources/lib/oojs-ui/oojs-ui-apex.js index 0ef5aa173c..3d06808db3 100644 --- a/resources/lib/oojs-ui/oojs-ui-apex.js +++ b/resources/lib/oojs-ui/oojs-ui-apex.js @@ -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 */ diff --git a/resources/lib/oojs-ui/oojs-ui-apex.svg.css b/resources/lib/oojs-ui/oojs-ui-apex.svg.css index c50ad4f00a..a3a7e34e77 100644 --- a/resources/lib/oojs-ui/oojs-ui-apex.svg.css +++ b/resources/lib/oojs-ui/oojs-ui-apex.svg.css @@ -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%; @@ -383,6 +383,7 @@ } .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; @@ -1306,15 +1307,9 @@ .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; @@ -2030,7 +2025,7 @@ 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; @@ -2052,12 +2047,6 @@ 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%; @@ -2088,7 +2077,7 @@ -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 { diff --git a/resources/lib/oojs-ui/oojs-ui-mediawiki.css b/resources/lib/oojs-ui/oojs-ui-mediawiki.css index 11e6204be2..de3a155b70 100644 --- a/resources/lib/oojs-ui/oojs-ui-mediawiki.css +++ b/resources/lib/oojs-ui/oojs-ui-mediawiki.css @@ -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%; @@ -369,6 +369,7 @@ } .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; @@ -1184,15 +1185,9 @@ .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; @@ -1901,7 +1896,7 @@ 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; @@ -1923,12 +1918,6 @@ 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%; @@ -1959,7 +1948,7 @@ -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 { diff --git a/resources/lib/oojs-ui/oojs-ui-mediawiki.js b/resources/lib/oojs-ui/oojs-ui-mediawiki.js index e2520a1b88..00ac3512cb 100644 --- a/resources/lib/oojs-ui/oojs-ui-mediawiki.js +++ b/resources/lib/oojs-ui/oojs-ui-mediawiki.js @@ -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 diff --git a/resources/lib/oojs-ui/oojs-ui-mediawiki.svg.css b/resources/lib/oojs-ui/oojs-ui-mediawiki.svg.css index 63d5399a9a..2b5dfa1c47 100644 --- a/resources/lib/oojs-ui/oojs-ui-mediawiki.svg.css +++ b/resources/lib/oojs-ui/oojs-ui-mediawiki.svg.css @@ -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%; @@ -369,6 +369,7 @@ } .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; @@ -1184,15 +1185,9 @@ .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; @@ -1901,7 +1896,7 @@ 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; @@ -1923,12 +1918,6 @@ 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%; @@ -1959,7 +1948,7 @@ -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 { diff --git a/resources/lib/oojs-ui/oojs-ui.js b/resources/lib/oojs-ui/oojs-ui.js index 80d4c1de85..a7d4fc2e32 100644 --- a/resources/lib/oojs-ui/oojs-ui.js +++ b/resources/lib/oojs-ui/oojs-ui.js @@ -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 -- 2.20.1