From 5cca0292b04ccf0471943c8e5a8685db1eac4043 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Fri, 10 Oct 2014 18:05:44 -0700 Subject: [PATCH] Update OOjs UI to v0.1.0-pre (837b2f733e) New changes: d40dd30 build: Update grunt-contrib-uglify to v0.6.0 0d89c99 test: Load a theme for the test HTML file so the tests don't fail f245aa4 Element: Remove test for deprecated onDOMEvent() cd15f18 Follow-up I730e3d7d: Tab not spaces a923881 build: Use Karma instead of grunt-contrib-qunit 381864c build: Use Chrome and Firefox for tests instead of PhantomJS 044faa5 Follow-up If2da01a2: Fix grunt watch d6e7af8 Adding OO.ui.TitledElement as mixin to label widget 6385af7 MediaWiki theme: Add filled white background to toolbars 837b2f7 Revert "Try to stop user from tabbing outside of open dialog box" Change-Id: I63d51311f73d1295a2a35ebadf7d9ac835dec5c7 --- resources/lib/oojs-ui/oojs-ui-apex.css | 4 +-- resources/lib/oojs-ui/oojs-ui-apex.js | 4 +-- resources/lib/oojs-ui/oojs-ui-apex.svg.css | 4 +-- resources/lib/oojs-ui/oojs-ui-mediawiki.css | 5 ++-- resources/lib/oojs-ui/oojs-ui-mediawiki.js | 4 +-- .../lib/oojs-ui/oojs-ui-mediawiki.svg.css | 5 ++-- resources/lib/oojs-ui/oojs-ui-minerva.css | 4 +-- resources/lib/oojs-ui/oojs-ui-minerva.js | 4 +-- resources/lib/oojs-ui/oojs-ui-minerva.svg.css | 4 +-- resources/lib/oojs-ui/oojs-ui.js | 25 ++++++------------- 10 files changed, 27 insertions(+), 36 deletions(-) diff --git a/resources/lib/oojs-ui/oojs-ui-apex.css b/resources/lib/oojs-ui/oojs-ui-apex.css index 564b75bf40..a8f1e8e4be 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 (26dadbc60f) + * OOjs UI v0.1.0-pre (837b2f733e) * 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-10-06T16:03:50Z + * Date: 2014-10-11T01:05:40Z */ /* @noflip */ .oo-ui-rtl { diff --git a/resources/lib/oojs-ui/oojs-ui-apex.js b/resources/lib/oojs-ui/oojs-ui-apex.js index 0f9701c9ef..3835239f51 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 (26dadbc60f) + * OOjs UI v0.1.0-pre (837b2f733e) * 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-10-06T16:03:39Z + * Date: 2014-10-11T01:05:29Z */ /* Instantiation */ diff --git a/resources/lib/oojs-ui/oojs-ui-apex.svg.css b/resources/lib/oojs-ui/oojs-ui-apex.svg.css index 63e20d268a..8a70e544e2 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 (26dadbc60f) + * OOjs UI v0.1.0-pre (837b2f733e) * 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-10-06T16:03:50Z + * Date: 2014-10-11T01:05:40Z */ /* @noflip */ .oo-ui-rtl { diff --git a/resources/lib/oojs-ui/oojs-ui-mediawiki.css b/resources/lib/oojs-ui/oojs-ui-mediawiki.css index 48526faaf0..f18c048bdf 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 (26dadbc60f) + * OOjs UI v0.1.0-pre (837b2f733e) * 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-10-06T16:03:50Z + * Date: 2014-10-11T01:05:40Z */ /* @noflip */ .oo-ui-rtl { @@ -718,6 +718,7 @@ } .oo-ui-toolbar-bar { border-bottom: solid 1px #cccccc; + background: #ffffff; } .oo-ui-toolbar-bar .oo-ui-toolbar-bar { border: none; diff --git a/resources/lib/oojs-ui/oojs-ui-mediawiki.js b/resources/lib/oojs-ui/oojs-ui-mediawiki.js index d485b23b31..9c1ca576a6 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 (26dadbc60f) + * OOjs UI v0.1.0-pre (837b2f733e) * 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-10-06T16:03:39Z + * Date: 2014-10-11T01:05:29Z */ /** * @class diff --git a/resources/lib/oojs-ui/oojs-ui-mediawiki.svg.css b/resources/lib/oojs-ui/oojs-ui-mediawiki.svg.css index 513c8017df..2888159313 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 (26dadbc60f) + * OOjs UI v0.1.0-pre (837b2f733e) * 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-10-06T16:03:50Z + * Date: 2014-10-11T01:05:40Z */ /* @noflip */ .oo-ui-rtl { @@ -718,6 +718,7 @@ } .oo-ui-toolbar-bar { border-bottom: solid 1px #cccccc; + background: #ffffff; } .oo-ui-toolbar-bar .oo-ui-toolbar-bar { border: none; diff --git a/resources/lib/oojs-ui/oojs-ui-minerva.css b/resources/lib/oojs-ui/oojs-ui-minerva.css index 73cdbabe3c..9d39fdbd28 100644 --- a/resources/lib/oojs-ui/oojs-ui-minerva.css +++ b/resources/lib/oojs-ui/oojs-ui-minerva.css @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.1.0-pre (26dadbc60f) + * OOjs UI v0.1.0-pre (837b2f733e) * 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-10-06T16:03:50Z + * Date: 2014-10-11T01:05:40Z */ /* @noflip */ .oo-ui-rtl { diff --git a/resources/lib/oojs-ui/oojs-ui-minerva.js b/resources/lib/oojs-ui/oojs-ui-minerva.js index 0f9701c9ef..3835239f51 100644 --- a/resources/lib/oojs-ui/oojs-ui-minerva.js +++ b/resources/lib/oojs-ui/oojs-ui-minerva.js @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.1.0-pre (26dadbc60f) + * OOjs UI v0.1.0-pre (837b2f733e) * 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-10-06T16:03:39Z + * Date: 2014-10-11T01:05:29Z */ /* Instantiation */ diff --git a/resources/lib/oojs-ui/oojs-ui-minerva.svg.css b/resources/lib/oojs-ui/oojs-ui-minerva.svg.css index a28347947d..3f671e020a 100644 --- a/resources/lib/oojs-ui/oojs-ui-minerva.svg.css +++ b/resources/lib/oojs-ui/oojs-ui-minerva.svg.css @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.1.0-pre (26dadbc60f) + * OOjs UI v0.1.0-pre (837b2f733e) * 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-10-06T16:03:50Z + * Date: 2014-10-11T01:05:40Z */ /* @noflip */ .oo-ui-rtl { diff --git a/resources/lib/oojs-ui/oojs-ui.js b/resources/lib/oojs-ui/oojs-ui.js index 91f1c2e953..f98f3f3e25 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 (26dadbc60f) + * OOjs UI v0.1.0-pre (837b2f733e) * 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-10-06T16:03:39Z + * Date: 2014-10-11T01:05:29Z */ ( function ( OO ) { @@ -1900,7 +1900,6 @@ OO.ui.Window.prototype.initialize = function () { this.$head = this.$( '
' ); this.$body = this.$( '
' ); this.$foot = this.$( '
' ); - this.$focusTrap = this.$( '
' ).prop( 'tabIndex', 0 ); // Events this.$element.on( 'mousedown', OO.ui.bind( this.onMouseDown, this ) ); @@ -1909,20 +1908,11 @@ OO.ui.Window.prototype.initialize = function () { this.$head.addClass( 'oo-ui-window-head' ); this.$body.addClass( 'oo-ui-window-body' ); this.$foot.addClass( 'oo-ui-window-foot' ); - this.$focusTrap.addClass( 'oo-ui-window-focustrap' ); - this.$content.append( this.$head, this.$body, this.$foot, this.$focusTrap ); + this.$content.append( this.$head, this.$body, this.$foot ); return this; }; -/** - * Called when someone tries to focus the hidden element at the end of the dialog. - * Sends focus back to the start of the dialog. - */ -OO.ui.Window.prototype.onFocusTrapFocused = function () { - this.$content.find( ':focusable:first' ).focus(); -}; - /** * Open window. * @@ -1965,8 +1955,6 @@ OO.ui.Window.prototype.setup = function ( data ) { this.$element.show(); this.visible = true; - this.focusTrapHandler = OO.ui.bind( this.onFocusTrapFocused, this ); - this.$focusTrap.on( 'focus', this.focusTrapHandler ); this.getSetupProcess( data ).execute().done( function () { // Force redraw by asking the browser to measure the elements' widths win.$element.addClass( 'oo-ui-window-setup' ).width(); @@ -2045,15 +2033,14 @@ OO.ui.Window.prototype.teardown = function ( data ) { var win = this, deferred = $.Deferred(); - this.getTeardownProcess( data ).execute().done( OO.ui.bind( function () { + this.getTeardownProcess( data ).execute().done( function () { // Force redraw by asking the browser to measure the elements' widths win.$element.removeClass( 'oo-ui-window-setup' ).width(); win.$content.removeClass( 'oo-ui-window-content-setup' ).width(); win.$element.hide(); - this.$focusTrap.off( 'focus', this.focusTrapHandler ); win.visible = false; deferred.resolve(); - }, this ) ); + } ); return deferred.promise(); }; @@ -9469,6 +9456,7 @@ OO.ui.LabelWidget = function OoUiLabelWidget( config ) { // Mixin constructors OO.ui.LabelElement.call( this, $.extend( {}, config, { $label: this.$element } ) ); + OO.ui.TitledElement.call( this, config ); // Properties this.input = config.input; @@ -9486,6 +9474,7 @@ OO.ui.LabelWidget = function OoUiLabelWidget( config ) { OO.inheritClass( OO.ui.LabelWidget, OO.ui.Widget ); OO.mixinClass( OO.ui.LabelWidget, OO.ui.LabelElement ); +OO.mixinClass( OO.ui.LabelWidget, OO.ui.TitledElement ); /* Static Properties */ -- 2.20.1