From: James D. Forrester Date: Wed, 30 Apr 2014 00:13:15 +0000 (-0700) Subject: Update OOjs UI to v0.1.0-pre (70f1886a35) X-Git-Tag: 1.31.0-rc.0~15957 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28?a=commitdiff_plain;h=8c6814e05abc6e06b3d7a34de78f30e355b9b87b;p=lhc%2Fweb%2Fwiklou.git Update OOjs UI to v0.1.0-pre (70f1886a35) New changes: c486e35 Add info icon and alert indicator 5928259 Add a 'ready' event to the window open sequence d2f1933 Improve info and alert icons/indicators 6d78021 Defer window 'ready' event to let rendering happen 7705a94 Add focus method to SearchWidget 70f1886 Improve alert and required indicators Change-Id: I58ae4c8154d45b34e2dcd404a5d8c3c9bbffd32f --- diff --git a/resources/lib/oojs-ui/images/icons/info.png b/resources/lib/oojs-ui/images/icons/info.png new file mode 100644 index 0000000000..f43804db7d Binary files /dev/null and b/resources/lib/oojs-ui/images/icons/info.png differ diff --git a/resources/lib/oojs-ui/images/icons/info.svg b/resources/lib/oojs-ui/images/icons/info.svg new file mode 100644 index 0000000000..8c5672a830 --- /dev/null +++ b/resources/lib/oojs-ui/images/icons/info.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/resources/lib/oojs-ui/images/indicators/alert.png b/resources/lib/oojs-ui/images/indicators/alert.png new file mode 100644 index 0000000000..bfc83e7ef5 Binary files /dev/null and b/resources/lib/oojs-ui/images/indicators/alert.png differ diff --git a/resources/lib/oojs-ui/images/indicators/alert.svg b/resources/lib/oojs-ui/images/indicators/alert.svg new file mode 100644 index 0000000000..8ce4b25928 --- /dev/null +++ b/resources/lib/oojs-ui/images/indicators/alert.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/resources/lib/oojs-ui/images/indicators/required.png b/resources/lib/oojs-ui/images/indicators/required.png index aeb35a3c0e..d10e0d4e36 100644 Binary files a/resources/lib/oojs-ui/images/indicators/required.png and b/resources/lib/oojs-ui/images/indicators/required.png differ diff --git a/resources/lib/oojs-ui/images/indicators/required.svg b/resources/lib/oojs-ui/images/indicators/required.svg index 7c60ec0b0d..ee1baf793a 100644 --- a/resources/lib/oojs-ui/images/indicators/required.svg +++ b/resources/lib/oojs-ui/images/indicators/required.svg @@ -2,7 +2,9 @@ - + + + diff --git a/resources/lib/oojs-ui/oojs-ui-apex.css b/resources/lib/oojs-ui/oojs-ui-apex.css index 40e76d2451..ac0780224b 100644 --- a/resources/lib/oojs-ui/oojs-ui-apex.css +++ b/resources/lib/oojs-ui/oojs-ui-apex.css @@ -628,6 +628,10 @@ padding-right: 1.5em; } +.oo-ui-outlineItemWidget.oo-ui-indicatedElement .oo-ui-indicatedElement-indicator { + opacity: 0.5; +} + .oo-ui-outlineItemWidget-level-0 { padding-left: 3.5em; } @@ -665,8 +669,7 @@ font-style: italic; } -.oo-ui-outlineItemWidget.oo-ui-flaggableElement-empty .oo-ui-iconedElement-icon, -.oo-ui-outlineItemWidget.oo-ui-flaggableElement-empty .oo-ui-indicatedElement-indicator { +.oo-ui-outlineItemWidget.oo-ui-flaggableElement-empty .oo-ui-iconedElement-icon { opacity: 0.5; } diff --git a/resources/lib/oojs-ui/oojs-ui.js b/resources/lib/oojs-ui/oojs-ui.js index 60476d51a0..d965ffa7ad 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 (b91660e612) + * OOjs UI v0.1.0-pre (70f1886a35) * 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 Apr 28 2014 12:57:47 GMT-0700 (PDT) + * Date: Tue Apr 29 2014 17:13:10 GMT-0700 (PDT) */ ( function ( OO ) { @@ -1297,7 +1297,9 @@ OO.ui.Window.prototype.teardown = function () { * Do not override this method. See #setup for a way to make changes each time the window opens. * * @param {Object} [data] Window opening data + * @fires opening * @fires open + * @fires ready * @chainable */ OO.ui.Window.prototype.open = function ( data ) { @@ -1308,13 +1310,16 @@ OO.ui.Window.prototype.open = function ( data ) { this.visible = true; this.emit( 'opening', data ); this.setup( data ); - // Focus the content div (which has a tabIndex) to inactivate - // (but not clear) selections in the parent frame. - // Must happen after setup runs (otherwise focusing it doesn't work) - // but before 'open' is emitted (so subclasses can give focus to something else) - this.frame.$content.focus(); this.emit( 'open', data ); - this.opening = false; + 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.emit( 'ready', data ); + this.opening = false; + }, this ) ); }, this ) ); } @@ -1327,6 +1332,7 @@ OO.ui.Window.prototype.open = function ( data ) { * See #teardown for a way to do something each time the window closes. * * @param {Object} [data] Window closing data + * @fires closing * @fires close * @chainable */ @@ -7788,6 +7794,13 @@ OO.ui.SearchWidget.prototype.clear = function () { this.query.setValue( '' ); }; +/** + * Focus the query input. + */ +OO.ui.SearchWidget.prototype.focus = function () { + this.query.$input[0].focus(); +}; + /** * Get the results list. * diff --git a/resources/lib/oojs-ui/oojs-ui.svg.css b/resources/lib/oojs-ui/oojs-ui.svg.css index 321f3f8374..d19eb806d9 100644 --- a/resources/lib/oojs-ui/oojs-ui.svg.css +++ b/resources/lib/oojs-ui/oojs-ui.svg.css @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.1.0-pre (b91660e612) + * OOjs UI v0.1.0-pre (70f1886a35) * 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 Apr 28 2014 12:57:47 GMT-0700 (PDT) + * Date: Tue Apr 29 2014 17:13:10 GMT-0700 (PDT) */ /* Textures */ @@ -1172,6 +1172,10 @@ background-image: /* @embed */ url(images/icons/help.svg); } +.oo-ui-icon-info { + background-image: /* @embed */ url(images/icons/info.svg); +} + .oo-ui-icon-link { background-image: /* @embed */ url(images/icons/link.svg); } @@ -1222,6 +1226,10 @@ /* Indicators */ +.oo-ui-indicator-alert { + background-image: /* @embed */ url(images/indicators/alert.svg); +} + .oo-ui-indicator-down { background-image: /* @embed */ url(images/indicators/down.svg); }