From 86ff8ccdcd424d5a381bbf54dcf35195528d8585 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Thu, 4 Oct 2018 10:12:39 -0700 Subject: [PATCH] Update OOUI to v0.29.1 Release notes: https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v0.29.1 Local fix to rcfilters for renamed parent method. Bug: T130434 Bug: T165650 Bug: T183299 Bug: T196756 Bug: T205472 Bug: T205692 Bug: T205979 Bug: T206153 Bug: T206155 Depends-On: Ie847465af6762fd0322a5be4adf601cabda2d458 Change-Id: I704e3197e86d484be3ab91b9282d6ac1b7db2251 --- composer.json | 2 +- maintenance/resources/foreign-resources.yaml | 4 +- resources/lib/ooui/History.md | 42 + resources/lib/ooui/i18n/gu.json | 4 +- resources/lib/ooui/i18n/jv.json | 8 +- resources/lib/ooui/i18n/sr-ec.json | 2 +- resources/lib/ooui/oojs-ui-apex.js | 4 +- resources/lib/ooui/oojs-ui-core-apex.css | 56 +- .../lib/ooui/oojs-ui-core-wikimediaui.css | 60 +- resources/lib/ooui/oojs-ui-core.js | 270 +++-- resources/lib/ooui/oojs-ui-core.js.map.json | 2 +- resources/lib/ooui/oojs-ui-toolbars-apex.css | 12 +- .../lib/ooui/oojs-ui-toolbars-wikimediaui.css | 16 +- resources/lib/ooui/oojs-ui-toolbars.js | 47 +- .../lib/ooui/oojs-ui-toolbars.js.map.json | 2 +- resources/lib/ooui/oojs-ui-widgets-apex.css | 216 +--- .../lib/ooui/oojs-ui-widgets-wikimediaui.css | 251 +---- resources/lib/ooui/oojs-ui-widgets.js | 940 +----------------- .../lib/ooui/oojs-ui-widgets.js.map.json | 2 +- resources/lib/ooui/oojs-ui-wikimediaui.js | 4 +- resources/lib/ooui/oojs-ui-windows-apex.css | 9 +- .../lib/ooui/oojs-ui-windows-wikimediaui.css | 13 +- resources/lib/ooui/oojs-ui-windows.js | 4 +- .../images/icons/userAvatar-invert.png | Bin 198 -> 186 bytes .../images/icons/userAvatar-invert.svg | 2 +- .../images/icons/userAvatar-progressive.png | Bin 263 -> 226 bytes .../images/icons/userAvatar-progressive.svg | 2 +- .../wikimediaui/images/icons/userAvatar.png | Bin 196 -> 188 bytes .../wikimediaui/images/icons/userAvatar.svg | 2 +- .../ui/mw.rcfilters.ui.MenuSelectWidget.js | 4 +- 30 files changed, 479 insertions(+), 1501 deletions(-) diff --git a/composer.json b/composer.json index 0707f0400b..3cc54f800c 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ "ext-mbstring": "*", "ext-xml": "*", "liuggio/statsd-php-client": "1.0.18", - "oojs/oojs-ui": "0.28.2", + "oojs/oojs-ui": "0.29.1", "oyejorge/less.php": "1.7.0.14", "pear/mail": "1.4.1", "pear/mail_mime": "1.10.2", diff --git a/maintenance/resources/foreign-resources.yaml b/maintenance/resources/foreign-resources.yaml index 8c496b486d..c610b3c90a 100644 --- a/maintenance/resources/foreign-resources.yaml +++ b/maintenance/resources/foreign-resources.yaml @@ -102,8 +102,8 @@ oojs: ooui: type: tar - src: https://registry.npmjs.org/oojs-ui/-/oojs-ui-0.28.2.tgz - integrity: sha384-wZSNhrZFu8mDYVRIBTObP1X+o1WuFgmxeaCHnRJ2O8MP+FizOomibPHJSNOPwrjv + src: https://registry.npmjs.org/oojs-ui/-/oojs-ui-0.29.1.tgz + integrity: sha384-YqKIMkbjQ3gtpf+B38K12EGMEyoGQjgLcxjDJT2AoSMxQOWERZQ7uG3SNqePM2+K dest: # Main stuff package/dist/oojs-ui-core.js{,.map.json}: diff --git a/resources/lib/ooui/History.md b/resources/lib/ooui/History.md index 61b4a4c611..38ebdeda6f 100644 --- a/resources/lib/ooui/History.md +++ b/resources/lib/ooui/History.md @@ -1,4 +1,46 @@ # OOUI Release History +## v0.29.1 / 2018-10-03 +### Styles +* TabOptionWidget: Increase contrast between normal & selected states (Volker E.) + +### Code +* MultilineTextInputWidget: Fix fatal (Bartosz Dziewoński) +* build: Fail in CI if there are uncommited build artefacts (James D. Forrester) +* tests: Commit JS/PHP comparison test suite (Bartosz Dziewoński) +* tests: Ensure consistent order in JSPHP-suite.json (Bartosz Dziewoński) +* tests: Ensure we write LF newlines to JSPHP-suite.json, even on Windows (Bartosz Dziewoński) +* tests: Fix generation of JS/PHP comparison test suite (Bartosz Dziewoński) +* tests: Increase Karma tests timeout so that they actually finish (Bartosz Dziewoński) + + +## v0.29.0 / 2018-10-02 +### Breaking changes +* [BREAKING CHANGE] Consistently name document listeners (Ed Sanders) +* [BREAKING CHANGE] Drop CapsuleMultiselectWidget, deprecated since v0.27.5 (James D. Forrester) +* [BREAKING CHANGE] Formally require PHP 7 (5.6.99+) (James D. Forrester) +* [BREAKING CHANGE] TextInputWidget: Drop support for `multiline: true` (James D. Forrester) +* [BREAKING CHANGE] Upgrade jQuery from 3.2.1 to 3.3.1 (James D. Forrester) +* [BREAKING CHANGE] Use PHP 5.6 variadic function syntax (Bartosz Dziewoński) +* [BREAKING CHANGE] Use PHP 7 "\u{NNNN}" Unicode codepoint escapes (Bartosz Dziewoński) +* [BREAKING CHANGE] Use PHP 7 '??' operator instead of '?:' with 'isset()' (Bartosz Dziewoński) + +### Features +* Use jQuery 3.3.x class feature (Ed Sanders) + +### Styles +* icons: Refine 'userAvatar' slightly (Volker E.) + +### Code +* Avoid including the `/**` comment from WikimediaUI Base in our output (Bartosz Dziewoński) +* Centralize the definition of which classes belong in which module (Bartosz Dziewoński) +* Remove unnecessary empty-theme.less (Bartosz Dziewoński) +* WikimediaUI theme: Correct several code comments (Volker E.) +* WikimediaUI theme: Remove vars covered by WikimediaUI Base vars (Volker E.) +* build: Bump eslint-config and grunt-karma devDependencies to latest (James D. Forrester) +* build: Updating mediawiki/mediawiki-codesniffer to 22.0.0 (James D. Forrester) +* demos: Unbreak from reliance on removed CapsuleMultiselectWidget (James D. Forrester) + + ## v0.28.2 / 2018-09-11 ### Deprecations * [DEPRECATING CHANGE]: icons: Rename 'advanced' to 'settings' (Volker E.) diff --git a/resources/lib/ooui/i18n/gu.json b/resources/lib/ooui/i18n/gu.json index e7dfeb2043..24fdbef06c 100644 --- a/resources/lib/ooui/i18n/gu.json +++ b/resources/lib/ooui/i18n/gu.json @@ -14,6 +14,7 @@ "ooui-toolbar-more": "વધુ", "ooui-toolgroup-expand": "વધુ", "ooui-toolgroup-collapse": "ઓછા", + "ooui-item-remove": "દૂર કરો", "ooui-dialog-message-accept": "બરાબર", "ooui-dialog-message-reject": "રદ કરો", "ooui-dialog-process-error": "કંઇક ગરબડ થઇ", @@ -23,5 +24,6 @@ "ooui-selectfile-button-select": "ફાઈલ પસંદ કરો", "ooui-selectfile-not-supported": "ફાઇલ પસંદગીની જોગવાઈ નથી", "ooui-selectfile-placeholder": "કોઇ ફાઇલ પસંદ નથી કરાઈ", - "ooui-selectfile-dragdrop-placeholder": "અહીં ફાઇલ મૂકો" + "ooui-selectfile-dragdrop-placeholder": "અહીં ફાઇલ મૂકો", + "ooui-field-help": "મદદ" } diff --git a/resources/lib/ooui/i18n/jv.json b/resources/lib/ooui/i18n/jv.json index 5ade01560d..4264be5325 100644 --- a/resources/lib/ooui/i18n/jv.json +++ b/resources/lib/ooui/i18n/jv.json @@ -14,14 +14,16 @@ "ooui-toolbar-more": "Liyané", "ooui-toolgroup-expand": "Liyané", "ooui-toolgroup-collapse": "Sacukupé", + "ooui-item-remove": "Buwang", "ooui-dialog-message-accept": "Oké", "ooui-dialog-message-reject": "Wurung", - "ooui-dialog-process-error": "Ana sing salah", + "ooui-dialog-process-error": "Ana masalah", "ooui-dialog-process-dismiss": "Tutup", "ooui-dialog-process-retry": "Jajalen manèh", "ooui-dialog-process-continue": "Bacutaké", "ooui-selectfile-button-select": "Pilih barkas", "ooui-selectfile-not-supported": "Ora bisa milih barkas", - "ooui-selectfile-placeholder": "Ora ana barkas sing dipilih", - "ooui-selectfile-dragdrop-placeholder": "Dèkèk barkas ing kéné" + "ooui-selectfile-placeholder": "Ora ana barkas kang pinilih", + "ooui-selectfile-dragdrop-placeholder": "Dèkèk barkas ing kéné", + "ooui-field-help": "Pitulung" } diff --git a/resources/lib/ooui/i18n/sr-ec.json b/resources/lib/ooui/i18n/sr-ec.json index 0f6b1912c8..c686190c28 100644 --- a/resources/lib/ooui/i18n/sr-ec.json +++ b/resources/lib/ooui/i18n/sr-ec.json @@ -25,7 +25,7 @@ "ooui-dialog-process-continue": "Настави", "ooui-selectfile-button-select": "Изабери датотеку", "ooui-selectfile-not-supported": "Избор датотеке није подржан", - "ooui-selectfile-placeholder": "Није изабрана ниједна датотека", + "ooui-selectfile-placeholder": "Датотека није изабрана", "ooui-selectfile-dragdrop-placeholder": "Овде отпустите датотеку", "ooui-field-help": "Помоћ" } diff --git a/resources/lib/ooui/oojs-ui-apex.js b/resources/lib/ooui/oojs-ui-apex.js index dddbeabd42..79245d724f 100644 --- a/resources/lib/ooui/oojs-ui-apex.js +++ b/resources/lib/ooui/oojs-ui-apex.js @@ -1,12 +1,12 @@ /*! - * OOUI v0.28.2 + * OOUI v0.29.1 * https://www.mediawiki.org/wiki/OOUI * * Copyright 2011–2018 OOUI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2018-09-11T23:05:15Z + * Date: 2018-10-04T00:42:40Z */ ( function ( OO ) { diff --git a/resources/lib/ooui/oojs-ui-core-apex.css b/resources/lib/ooui/oojs-ui-core-apex.css index 50f45997ee..cc0d52f54e 100644 --- a/resources/lib/ooui/oojs-ui-core-apex.css +++ b/resources/lib/ooui/oojs-ui-core-apex.css @@ -1,16 +1,17 @@ /*! - * OOUI v0.28.2 + * OOUI v0.29.1 * https://www.mediawiki.org/wiki/OOUI * * Copyright 2011–2018 OOUI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2018-09-11T23:05:21Z + * Date: 2018-10-04T00:42:47Z */ .oo-ui-element-hidden { display: none !important; } + .oo-ui-buttonElement { display: inline-block; line-height: normal; @@ -251,15 +252,20 @@ border-color: #ccc; box-shadow: none; } + .oo-ui-clippableElement-clippable { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; min-height: 3.125em; } + .oo-ui-floatableElement { position: absolute; } + + + .oo-ui-iconElement-icon { background-size: contain; background-position: center center; @@ -284,6 +290,7 @@ margin: 0.15625em; opacity: 0.8; } + .oo-ui-indicatorElement-indicator { background-size: contain; background-position: center center; @@ -304,6 +311,7 @@ height: 0.9375em; opacity: 0.8; } + .oo-ui-labelElement .oo-ui-labelElement-label, .oo-ui-labelElement.oo-ui-labelElement-label { -webkit-box-sizing: border-box; @@ -313,9 +321,15 @@ .oo-ui-labelElement .oo-ui-labelElement-label-highlight { font-weight: bold; } + .oo-ui-pendingElement-pending { background-image: /* @embed */ url(themes/wikimediaui/images/textures/pending.gif); } + + + + + .oo-ui-fieldLayout { display: block; margin-top: 0.75em; @@ -452,6 +466,7 @@ line-height: 1.5em; vertical-align: middle; } + .oo-ui-actionFieldLayout-input, .oo-ui-actionFieldLayout-button { display: table-cell; @@ -485,6 +500,7 @@ .oo-ui-actionFieldLayout .oo-ui-actionFieldLayout-button > .oo-ui-buttonElement > .oo-ui-buttonElement-button:focus { z-index: 1; } + .oo-ui-fieldsetLayout { position: relative; min-width: 0; @@ -559,10 +575,12 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-fieldsetLayout > .oo-ui-fieldsetLayout-header > .oo-ui-popupButtonWidget:last-child { margin-right: 0; } + .oo-ui-formLayout + .oo-ui-fieldsetLayout, .oo-ui-formLayout + .oo-ui-formLayout { margin-top: 2em; } + .oo-ui-panelLayout { position: relative; } @@ -586,6 +604,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-panelLayout-padded.oo-ui-panelLayout-framed { margin: 1em 0; } + .oo-ui-horizontalLayout > .oo-ui-widget { display: inline-block; vertical-align: middle; @@ -607,6 +626,9 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-horizontalLayout > .oo-ui-widget { margin-bottom: 0.5em; } + + + .oo-ui-optionWidget { position: relative; display: block; @@ -641,6 +663,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-optionWidget.oo-ui-widget-disabled { color: #ccc; } + .oo-ui-decoratedOptionWidget { padding: 0.5em 2em 0.5em 3em; } @@ -661,6 +684,8 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-decoratedOptionWidget.oo-ui-widget-disabled .oo-ui-indicatorElement-indicator { opacity: 0.2; } + + .oo-ui-radioOptionWidget { display: table; width: 100%; @@ -686,6 +711,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-radioOptionWidget .oo-ui-radioInputWidget { margin-right: 0; } + .oo-ui-labelWidget { display: inline-block; } @@ -694,6 +720,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { color: #595959; font-size: 0.9375em; } + .oo-ui-iconWidget { vertical-align: middle; line-height: 2.5em; @@ -706,6 +733,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-iconWidget.oo-ui-widget-disabled { opacity: 0.2; } + .oo-ui-indicatorWidget { vertical-align: middle; line-height: 2.5em; @@ -718,12 +746,14 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-indicatorWidget.oo-ui-widget-disabled { opacity: 0.2; } + .oo-ui-buttonWidget { margin-right: 0.5em; } .oo-ui-buttonWidget:last-child { margin-right: 0; } + .oo-ui-buttonGroupWidget { display: inline-block; white-space: nowrap; @@ -773,6 +803,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-buttonGroupWidget.oo-ui-widget-enabled .oo-ui-buttonElement.oo-ui-toggleWidget-on + .oo-ui-toggleWidget-on > .oo-ui-buttonElement-button:active { z-index: 3; } + .oo-ui-popupWidget { position: absolute; } @@ -946,18 +977,21 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-popupWidget-body-padded { margin: 0.75em 1em; } + .oo-ui-popupButtonWidget { position: relative; } .oo-ui-popupButtonWidget .oo-ui-popupWidget { cursor: auto; } + .oo-ui-inputWidget { margin-right: 0.5em; } .oo-ui-inputWidget:last-child { margin-right: 0; } + .oo-ui-buttonInputWidget > button, .oo-ui-buttonInputWidget > input { background-color: transparent; @@ -965,18 +999,21 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { border: 0; padding: 0; } + .oo-ui-checkboxInputWidget { display: inline-block; } .oo-ui-checkboxInputWidget-checkIcon { display: none; } + .oo-ui-checkboxMultiselectInputWidget .oo-ui-fieldLayout { margin-top: 0; } .oo-ui-checkboxMultiselectInputWidget .oo-ui-fieldLayout .oo-ui-fieldLayout-body { padding: 0.3125em 0; } + .oo-ui-dropdownInputWidget { position: relative; vertical-align: middle; @@ -1030,15 +1067,18 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { border-color: #ddd; background-color: #f3f3f3; } + .oo-ui-radioInputWidget { display: inline-block; } + .oo-ui-radioSelectInputWidget .oo-ui-fieldLayout { margin-top: 0; } .oo-ui-radioSelectInputWidget .oo-ui-fieldLayout .oo-ui-fieldLayout-body { padding: 0.3125em 0; } + .oo-ui-textInputWidget { position: relative; vertical-align: middle; @@ -1231,6 +1271,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-textInputWidget-labelPosition-before.oo-ui-iconElement > .oo-ui-labelElement-label { margin-left: 2.075em; } + .oo-ui-menuSelectWidget { position: absolute; width: 100%; @@ -1248,6 +1289,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-menuSelectWidget-invisible { display: none; } + .oo-ui-menuOptionWidget .oo-ui-menuOptionWidget-checkIcon { display: none; } @@ -1267,6 +1309,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-menuOptionWidget.oo-ui-optionWidget-highlighted.oo-ui-optionWidget-selected { background-color: #e1f3ff; } + .oo-ui-menuSectionOptionWidget { padding: 0.33em 0.75em; color: #767676; @@ -1274,6 +1317,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-menuSectionOptionWidget.oo-ui-widget-enabled { cursor: default; } + .oo-ui-dropdownWidget { display: inline-block; position: relative; @@ -1353,6 +1397,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-dropdownWidget.oo-ui-indicatorElement .oo-ui-dropdownWidget-handle .oo-ui-labelElement-label { margin-right: 2em; } + .oo-ui-comboBoxInputWidget { display: inline-block; position: relative; @@ -1423,6 +1468,8 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { cursor: default; opacity: 0.2; } + + .oo-ui-multioptionWidget { position: relative; display: block; @@ -1445,6 +1492,8 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-multioptionWidget.oo-ui-widget-disabled { color: #ccc; } + + .oo-ui-checkboxMultioptionWidget { display: table; width: 100%; @@ -1467,6 +1516,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-checkboxMultioptionWidget .oo-ui-checkboxInputWidget { margin-right: 0; } + .oo-ui-progressBarWidget { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; @@ -1545,6 +1595,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { transform: translate(350%); } } + .oo-ui-numberInputWidget { display: inline-block; position: relative; @@ -1580,6 +1631,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { border-bottom-left-radius: 0; border-left-width: 0; } + .oo-ui-defaultOverlay { position: absolute; top: 0; diff --git a/resources/lib/ooui/oojs-ui-core-wikimediaui.css b/resources/lib/ooui/oojs-ui-core-wikimediaui.css index 94ef67992e..927aa88f54 100644 --- a/resources/lib/ooui/oojs-ui-core-wikimediaui.css +++ b/resources/lib/ooui/oojs-ui-core-wikimediaui.css @@ -1,20 +1,17 @@ /*! - * OOUI v0.28.2 + * OOUI v0.29.1 * https://www.mediawiki.org/wiki/OOUI * * Copyright 2011–2018 OOUI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2018-09-11T23:05:21Z - */ -/** - * WikimediaUI Base v0.12.0 - * Wikimedia Foundation user interface base variables + * Date: 2018-10-04T00:42:47Z */ .oo-ui-element-hidden { display: none !important; } + .oo-ui-buttonElement { display: inline-block; line-height: normal; @@ -392,15 +389,20 @@ .oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary > .oo-ui-buttonElement-button > .oo-ui-indicatorElement-indicator { opacity: 1; } + .oo-ui-clippableElement-clippable { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; min-height: 3.125em; } + .oo-ui-floatableElement { position: absolute; } + + + .oo-ui-iconElement-icon { background-size: contain; background-position: center center; @@ -415,6 +417,7 @@ .oo-ui-iconElement-noIcon { display: none; } + .oo-ui-indicatorElement-indicator { background-size: contain; background-position: center center; @@ -429,6 +432,7 @@ .oo-ui-indicatorElement-noIndicator { display: none; } + .oo-ui-labelElement .oo-ui-labelElement-label, .oo-ui-labelElement.oo-ui-labelElement-label { -webkit-box-sizing: border-box; @@ -441,9 +445,15 @@ .oo-ui-labelElement .oo-ui-labelElement-label-highlight { font-weight: bold; } + .oo-ui-pendingElement-pending { background-image: /* @embed */ url(themes/wikimediaui/images/textures/pending.gif); } + + + + + .oo-ui-fieldLayout { display: block; margin-top: 1.14285714em; @@ -595,6 +605,7 @@ .oo-ui-fieldLayout-disabled > .oo-ui-fieldLayout-body > .oo-ui-fieldLayout-header > .oo-ui-labelElement-label { color: #72777d; } + .oo-ui-actionFieldLayout-input, .oo-ui-actionFieldLayout-button { display: table-cell; @@ -631,6 +642,7 @@ .oo-ui-actionFieldLayout .oo-ui-actionFieldLayout-button > .oo-ui-buttonElement > .oo-ui-buttonElement-button:focus { z-index: 1; } + .oo-ui-fieldsetLayout { position: relative; min-width: 0; @@ -711,10 +723,12 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { padding-top: 1.42857143em; padding-right: 0; } + .oo-ui-formLayout + .oo-ui-fieldsetLayout, .oo-ui-formLayout + .oo-ui-formLayout { margin-top: 1.71428571em; } + .oo-ui-panelLayout { position: relative; } @@ -742,6 +756,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-panelLayout-padded.oo-ui-panelLayout-framed { margin: 0.85714286em 0; } + .oo-ui-horizontalLayout > .oo-ui-widget { display: inline-block; vertical-align: middle; @@ -763,6 +778,9 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-horizontalLayout > .oo-ui-widget { margin-bottom: 0.5em; } + + + .oo-ui-optionWidget { position: relative; display: block; @@ -785,6 +803,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-optionWidget.oo-ui-widget-disabled { color: #72777d; } + .oo-ui-decoratedOptionWidget { padding: 0.64285714em 0.85714286em 0.57142857em; line-height: 1; @@ -819,12 +838,14 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-decoratedOptionWidget.oo-ui-widget-disabled .oo-ui-indicatorElement-indicator { opacity: 0.51; } + .oo-ui-radioSelectWidget:focus { outline: 0; } .oo-ui-radioSelectWidget:focus [type='radio']:checked + span:before { border-color: #fff; } + .oo-ui-radioOptionWidget { display: table; width: 100%; @@ -847,6 +868,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-radioOptionWidget .oo-ui-radioInputWidget { margin-right: 0; } + .oo-ui-labelWidget { display: inline-block; } @@ -855,6 +877,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { color: #54595d; font-size: 0.92857143em; } + .oo-ui-iconWidget { vertical-align: middle; line-height: 2.5; @@ -866,6 +889,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-iconWidget.oo-ui-widget-disabled { opacity: 0.51; } + .oo-ui-indicatorWidget { vertical-align: middle; line-height: 2.5; @@ -878,12 +902,14 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-indicatorWidget.oo-ui-widget-disabled { opacity: 0.51; } + .oo-ui-buttonWidget { margin-right: 0.5em; } .oo-ui-buttonWidget:last-child { margin-right: 0; } + .oo-ui-buttonGroupWidget { display: inline-block; white-space: nowrap; @@ -938,6 +964,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { border-left-color: #a2a9b1; z-index: 3; } + .oo-ui-popupWidget { position: absolute; } @@ -1117,18 +1144,21 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-popupWidget-footer { margin: 0.64285714em 0.85714286em 0.57142857em; } + .oo-ui-popupButtonWidget { position: relative; } .oo-ui-popupButtonWidget .oo-ui-popupWidget { cursor: auto; } + .oo-ui-inputWidget { margin-right: 0.5em; } .oo-ui-inputWidget:last-child { margin-right: 0; } + .oo-ui-buttonInputWidget > button, .oo-ui-buttonInputWidget > input { background-color: transparent; @@ -1136,6 +1166,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { border: 0; padding: 0; } + .oo-ui-checkboxInputWidget { display: inline-block; position: relative; @@ -1214,9 +1245,11 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { border-color: #2a4b8d; box-shadow: inset 0 0 0 1px #2a4b8d; } + .oo-ui-checkboxMultiselectInputWidget .oo-ui-fieldLayout { margin-top: 0.28571429em; } + .oo-ui-dropdownInputWidget { position: relative; vertical-align: middle; @@ -1301,6 +1334,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { color: #72777d; border-color: #c8ccd1; } + .oo-ui-radioInputWidget { display: inline-block; position: relative; @@ -1386,9 +1420,11 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-radioInputWidget.oo-ui-widget-enabled [type='radio']:checked:active + span:before { border-color: #2a4b8d; } + .oo-ui-radioSelectInputWidget .oo-ui-fieldLayout { margin-top: 0.28571429em; } + .oo-ui-textInputWidget { position: relative; vertical-align: middle; @@ -1609,6 +1645,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-textInputWidget-labelPosition-before.oo-ui-iconElement > .oo-ui-labelElement-label { padding-left: 2.64285714em; } + .oo-ui-menuSelectWidget { position: absolute; width: 100%; @@ -1626,6 +1663,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-menuSelectWidget-invisible { display: none; } + .oo-ui-menuOptionWidget { -webkit-transition: background-color 100ms, color 100ms; -moz-transition: background-color 100ms, color 100ms; @@ -1647,6 +1685,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { background-color: rgba(41, 98, 204, 0.1); color: #36c; } + .oo-ui-menuSectionOptionWidget { color: #72777d; padding: 0.64285714em 0.85714286em 0.28571429em; @@ -1664,6 +1703,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-menuSectionOptionWidget ~ .oo-ui-menuOptionWidget.oo-ui-iconElement .oo-ui-iconElement-icon { left: 1.71428571em; } + .oo-ui-dropdownWidget { display: inline-block; position: relative; @@ -1767,6 +1807,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-dropdownWidget.oo-ui-widget-disabled .oo-ui-dropdownWidget-handle .oo-ui-indicatorElement-indicator { opacity: 0.15; } + .oo-ui-comboBoxInputWidget { display: inline-block; position: relative; @@ -1849,6 +1890,8 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-comboBoxInputWidget.oo-ui-widget-disabled .oo-ui-indicatorElement-indicator { opacity: 1; } + + .oo-ui-multioptionWidget { position: relative; display: block; @@ -1868,6 +1911,8 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-multioptionWidget.oo-ui-widget-disabled { color: #72777d; } + + .oo-ui-checkboxMultioptionWidget { display: table; width: 100%; @@ -1890,6 +1935,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-checkboxMultioptionWidget .oo-ui-checkboxInputWidget { margin-right: 0; } + .oo-ui-progressBarWidget { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; @@ -1965,6 +2011,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { transform: translate(350%); } } + .oo-ui-numberInputWidget { display: inline-block; position: relative; @@ -2010,6 +2057,7 @@ body:not( :-moz-handler-blocked ) .oo-ui-fieldsetLayout { .oo-ui-numberInputWidget.oo-ui-widget-disabled.oo-ui-numberInputWidget-buttoned .oo-ui-iconElement-icon { opacity: 1; } + .oo-ui-defaultOverlay { position: absolute; top: 0; diff --git a/resources/lib/ooui/oojs-ui-core.js b/resources/lib/ooui/oojs-ui-core.js index 1398d27132..717cfed0e3 100644 --- a/resources/lib/ooui/oojs-ui-core.js +++ b/resources/lib/ooui/oojs-ui-core.js @@ -1,12 +1,12 @@ /*! - * OOUI v0.28.2 + * OOUI v0.29.1 * https://www.mediawiki.org/wiki/OOUI * * Copyright 2011–2018 OOUI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2018-09-11T23:05:15Z + * Date: 2018-10-04T00:42:40Z */ ( function ( OO ) { @@ -630,7 +630,7 @@ OO.ui.Element = function OoUiElement( config ) { // Initialization if ( Array.isArray( config.classes ) ) { - this.$element.addClass( config.classes.join( ' ' ) ); + this.$element.addClass( config.classes ); } if ( config.id ) { this.setElementId( config.id ); @@ -1818,8 +1818,8 @@ OO.ui.Theme.prototype.updateElementClasses = function ( element ) { } $elements - .removeClass( classes.off.join( ' ' ) ) - .addClass( classes.on.join( ' ' ) ); + .removeClass( classes.off ) + .addClass( classes.on ); }; /** @@ -2107,10 +2107,10 @@ OO.ui.mixin.ButtonElement = function OoUiMixinButtonElement( config ) { this.$button = null; this.framed = null; this.active = config.active !== undefined && config.active; - this.onMouseUpHandler = this.onMouseUp.bind( this ); + this.onDocumentMouseUpHandler = this.onDocumentMouseUp.bind( this ); this.onMouseDownHandler = this.onMouseDown.bind( this ); + this.onDocumentKeyUpHandler = this.onDocumentKeyUp.bind( this ); this.onKeyDownHandler = this.onKeyDown.bind( this ); - this.onKeyUpHandler = this.onKeyUp.bind( this ); this.onClickHandler = this.onClick.bind( this ); this.onKeyPressHandler = this.onKeyPress.bind( this ); @@ -2201,7 +2201,7 @@ OO.ui.mixin.ButtonElement.prototype.onMouseDown = function ( e ) { this.$element.addClass( 'oo-ui-buttonElement-pressed' ); // Run the mouseup handler no matter where the mouse is when the button is let go, so we can // reliably remove the pressed class - this.getElementDocument().addEventListener( 'mouseup', this.onMouseUpHandler, true ); + this.getElementDocument().addEventListener( 'mouseup', this.onDocumentMouseUpHandler, true ); // Prevent change of focus unless specifically configured otherwise if ( this.constructor.static.cancelButtonMouseDownEvents ) { return false; @@ -2209,18 +2209,24 @@ OO.ui.mixin.ButtonElement.prototype.onMouseDown = function ( e ) { }; /** - * Handles mouse up events. + * Handles document mouse up events. * * @protected * @param {MouseEvent} e Mouse up event */ -OO.ui.mixin.ButtonElement.prototype.onMouseUp = function ( e ) { +OO.ui.mixin.ButtonElement.prototype.onDocumentMouseUp = function ( e ) { if ( this.isDisabled() || e.which !== OO.ui.MouseButtons.LEFT ) { return; } this.$element.removeClass( 'oo-ui-buttonElement-pressed' ); // Stop listening for mouseup, since we only needed this once - this.getElementDocument().removeEventListener( 'mouseup', this.onMouseUpHandler, true ); + this.getElementDocument().removeEventListener( 'mouseup', this.onDocumentMouseUpHandler, true ); +}; + +// Deprecated alias since 0.28.3 +OO.ui.mixin.ButtonElement.prototype.onMouseUp = function () { + OO.ui.warnDeprecation( 'onMouseUp is deprecated, use onDocumentMouseUp instead' ); + this.onDocumentMouseUp.apply( this, arguments ); }; /** @@ -2251,22 +2257,28 @@ OO.ui.mixin.ButtonElement.prototype.onKeyDown = function ( e ) { this.$element.addClass( 'oo-ui-buttonElement-pressed' ); // Run the keyup handler no matter where the key is when the button is let go, so we can // reliably remove the pressed class - this.getElementDocument().addEventListener( 'keyup', this.onKeyUpHandler, true ); + this.getElementDocument().addEventListener( 'keyup', this.onDocumentKeyUpHandler, true ); }; /** - * Handles key up events. + * Handles document key up events. * * @protected * @param {KeyboardEvent} e Key up event */ -OO.ui.mixin.ButtonElement.prototype.onKeyUp = function ( e ) { +OO.ui.mixin.ButtonElement.prototype.onDocumentKeyUp = function ( e ) { if ( this.isDisabled() || ( e.which !== OO.ui.Keys.SPACE && e.which !== OO.ui.Keys.ENTER ) ) { return; } this.$element.removeClass( 'oo-ui-buttonElement-pressed' ); // Stop listening for keyup, since we only needed this once - this.getElementDocument().removeEventListener( 'keyup', this.onKeyUpHandler, true ); + this.getElementDocument().removeEventListener( 'keyup', this.onDocumentKeyUpHandler, true ); +}; + +// Deprecated alias since 0.28.3 +OO.ui.mixin.ButtonElement.prototype.onKeyUp = function () { + OO.ui.warnDeprecation( 'onKeyUp is deprecated, use onDocumentKeyUp instead' ); + this.onDocumentKeyUp.apply( this, arguments ); }; /** @@ -3206,7 +3218,7 @@ OO.ui.mixin.FlaggedElement = function OoUiMixinFlaggedElement( config ) { OO.ui.mixin.FlaggedElement.prototype.setFlaggedElement = function ( $flagged ) { var classNames = Object.keys( this.flags ).map( function ( flag ) { return 'oo-ui-flaggedElement-' + flag; - } ).join( ' ' ); + } ); if ( this.$flagged ) { this.$flagged.removeClass( classNames ); @@ -3256,7 +3268,7 @@ OO.ui.mixin.FlaggedElement.prototype.clearFlags = function () { } if ( this.$flagged ) { - this.$flagged.removeClass( remove.join( ' ' ) ); + this.$flagged.removeClass( remove ); } this.updateThemeClasses(); @@ -3322,8 +3334,8 @@ OO.ui.mixin.FlaggedElement.prototype.setFlags = function ( flags ) { if ( this.$flagged ) { this.$flagged - .addClass( add.join( ' ' ) ) - .removeClass( remove.join( ' ' ) ); + .addClass( add ) + .removeClass( remove ); } this.updateThemeClasses(); @@ -5150,7 +5162,7 @@ OO.ui.PopupWidget = function OoUiPopupWidget( config ) { this.autoClose = !!config.autoClose; this.transitionTimeout = null; this.anchored = false; - this.onMouseDownHandler = this.onMouseDown.bind( this ); + this.onDocumentMouseDownHandler = this.onDocumentMouseDown.bind( this ); this.onDocumentKeyDownHandler = this.onDocumentKeyDown.bind( this ); // Initialization @@ -5219,12 +5231,12 @@ OO.mixinClass( OO.ui.PopupWidget, OO.ui.mixin.FloatableElement ); /* Methods */ /** - * Handles mouse down events. + * Handles document mouse down events. * * @private * @param {MouseEvent} e Mouse down event */ -OO.ui.PopupWidget.prototype.onMouseDown = function ( e ) { +OO.ui.PopupWidget.prototype.onDocumentMouseDown = function ( e ) { if ( this.isVisible() && !OO.ui.contains( this.$element.add( this.$autoCloseIgnore ).get(), e.target, true ) @@ -5233,21 +5245,33 @@ OO.ui.PopupWidget.prototype.onMouseDown = function ( e ) { } }; +// Deprecated alias since 0.28.3 +OO.ui.PopupWidget.prototype.onMouseDown = function () { + OO.ui.warnDeprecation( 'onMouseDown is deprecated, use onDocumentMouseDown instead' ); + this.onDocumentMouseDown.apply( this, arguments ); +}; + /** - * Bind mouse down listener. + * Bind document mouse down listener. * * @private */ -OO.ui.PopupWidget.prototype.bindMouseDownListener = function () { +OO.ui.PopupWidget.prototype.bindDocumentMouseDownListener = function () { // Capture clicks outside popup - this.getElementWindow().addEventListener( 'mousedown', this.onMouseDownHandler, true ); + this.getElementDocument().addEventListener( 'mousedown', this.onDocumentMouseDownHandler, true ); // We add 'click' event because iOS safari needs to respond to this event. // We can't use 'touchstart' (as is usually the equivalent to 'mousedown') because // then it will trigger when scrolling. While iOS Safari has some reported behavior // of occasionally not emitting 'click' properly, that event seems to be the standard // that it should be emitting, so we add it to this and will operate the event handler // on whichever of these events was triggered first - this.getElementDocument().addEventListener( 'click', this.onMouseDownHandler, true ); + this.getElementDocument().addEventListener( 'click', this.onDocumentMouseDownHandler, true ); +}; + +// Deprecated alias since 0.28.3 +OO.ui.PopupWidget.prototype.bindMouseDownListener = function () { + OO.ui.warnDeprecation( 'bindMouseDownListener is deprecated, use bindDocumentMouseDownListener instead' ); + this.bindDocumentMouseDownListener.apply( this, arguments ); }; /** @@ -5262,17 +5286,23 @@ OO.ui.PopupWidget.prototype.onCloseButtonClick = function () { }; /** - * Unbind mouse down listener. + * Unbind document mouse down listener. * * @private */ +OO.ui.PopupWidget.prototype.unbindDocumentMouseDownListener = function () { + this.getElementDocument().removeEventListener( 'mousedown', this.onDocumentMouseDownHandler, true ); + this.getElementDocument().removeEventListener( 'click', this.onDocumentMouseDownHandler, true ); +}; + +// Deprecated alias since 0.28.3 OO.ui.PopupWidget.prototype.unbindMouseDownListener = function () { - this.getElementWindow().removeEventListener( 'mousedown', this.onMouseDownHandler, true ); - this.getElementDocument().removeEventListener( 'click', this.onMouseDownHandler, true ); + OO.ui.warnDeprecation( 'unbindMouseDownListener is deprecated, use unbindDocumentMouseDownListener instead' ); + this.unbindDocumentMouseDownListener.apply( this, arguments ); }; /** - * Handles key down events. + * Handles document key down events. * * @private * @param {KeyboardEvent} e Key down event @@ -5289,21 +5319,33 @@ OO.ui.PopupWidget.prototype.onDocumentKeyDown = function ( e ) { }; /** - * Bind key down listener. + * Bind document key down listener. * * @private */ +OO.ui.PopupWidget.prototype.bindDocumentKeyDownListener = function () { + this.getElementDocument().addEventListener( 'keydown', this.onDocumentKeyDownHandler, true ); +}; + +// Deprecated alias since 0.28.3 OO.ui.PopupWidget.prototype.bindKeyDownListener = function () { - this.getElementWindow().addEventListener( 'keydown', this.onDocumentKeyDownHandler, true ); + OO.ui.warnDeprecation( 'bindKeyDownListener is deprecated, use bindDocumentKeyDownListener instead' ); + this.bindDocumentKeyDownListener.apply( this, arguments ); }; /** - * Unbind key down listener. + * Unbind document key down listener. * * @private */ +OO.ui.PopupWidget.prototype.unbindDocumentKeyDownListener = function () { + this.getElementDocument().removeEventListener( 'keydown', this.onDocumentKeyDownHandler, true ); +}; + +// Deprecated alias since 0.28.3 OO.ui.PopupWidget.prototype.unbindKeyDownListener = function () { - this.getElementWindow().removeEventListener( 'keydown', this.onDocumentKeyDownHandler, true ); + OO.ui.warnDeprecation( 'unbindKeyDownListener is deprecated, use unbindDocumentKeyDownListener instead' ); + this.unbindDocumentKeyDownListener.apply( this, arguments ); }; /** @@ -5394,8 +5436,8 @@ OO.ui.PopupWidget.prototype.toggle = function ( show ) { if ( show ) { if ( this.autoClose ) { - this.bindMouseDownListener(); - this.bindKeyDownListener(); + this.bindDocumentMouseDownListener(); + this.bindDocumentKeyDownListener(); } this.updateDimensions(); this.toggleClipping( true ); @@ -5451,8 +5493,8 @@ OO.ui.PopupWidget.prototype.toggle = function ( show ) { } else { this.toggleClipping( false ); if ( this.autoClose ) { - this.unbindMouseDownListener(); - this.unbindKeyDownListener(); + this.unbindDocumentMouseDownListener(); + this.unbindDocumentKeyDownListener(); } } } @@ -6252,10 +6294,10 @@ OO.ui.SelectWidget = function OoUiSelectWidget( config ) { // Properties this.pressed = false; this.selecting = null; - this.onMouseUpHandler = this.onMouseUp.bind( this ); - this.onMouseMoveHandler = this.onMouseMove.bind( this ); - this.onKeyDownHandler = this.onKeyDown.bind( this ); - this.onKeyPressHandler = this.onKeyPress.bind( this ); + this.onDocumentMouseUpHandler = this.onDocumentMouseUp.bind( this ); + this.onDocumentMouseMoveHandler = this.onDocumentMouseMove.bind( this ); + this.onDocumentKeyDownHandler = this.onDocumentKeyDown.bind( this ); + this.onDocumentKeyPressHandler = this.onDocumentKeyPress.bind( this ); this.keyPressBuffer = ''; this.keyPressBufferTimer = null; this.blockMouseOverEvents = 0; @@ -6394,20 +6436,20 @@ OO.ui.SelectWidget.prototype.onMouseDown = function ( e ) { if ( item && item.isSelectable() ) { this.pressItem( item ); this.selecting = item; - this.getElementDocument().addEventListener( 'mouseup', this.onMouseUpHandler, true ); - this.getElementDocument().addEventListener( 'mousemove', this.onMouseMoveHandler, true ); + this.getElementDocument().addEventListener( 'mouseup', this.onDocumentMouseUpHandler, true ); + this.getElementDocument().addEventListener( 'mousemove', this.onDocumentMouseMoveHandler, true ); } } return false; }; /** - * Handle mouse up events. + * Handle document mouse up events. * * @private * @param {MouseEvent} e Mouse up event */ -OO.ui.SelectWidget.prototype.onMouseUp = function ( e ) { +OO.ui.SelectWidget.prototype.onDocumentMouseUp = function ( e ) { var item; this.togglePressed( false ); @@ -6423,19 +6465,25 @@ OO.ui.SelectWidget.prototype.onMouseUp = function ( e ) { this.selecting = null; } - this.getElementDocument().removeEventListener( 'mouseup', this.onMouseUpHandler, true ); - this.getElementDocument().removeEventListener( 'mousemove', this.onMouseMoveHandler, true ); + this.getElementDocument().removeEventListener( 'mouseup', this.onDocumentMouseUpHandler, true ); + this.getElementDocument().removeEventListener( 'mousemove', this.onDocumentMouseMoveHandler, true ); return false; }; +// Deprecated alias since 0.28.3 +OO.ui.SelectWidget.prototype.onMouseUp = function () { + OO.ui.warnDeprecation( 'onMouseUp is deprecated, use onDocumentMouseUp instead' ); + this.onDocumentMouseUp.apply( this, arguments ); +}; + /** - * Handle mouse move events. + * Handle document mouse move events. * * @private * @param {MouseEvent} e Mouse move event */ -OO.ui.SelectWidget.prototype.onMouseMove = function ( e ) { +OO.ui.SelectWidget.prototype.onDocumentMouseMove = function ( e ) { var item; if ( !this.isDisabled() && this.pressed ) { @@ -6447,6 +6495,12 @@ OO.ui.SelectWidget.prototype.onMouseMove = function ( e ) { } }; +// Deprecated alias since 0.28.3 +OO.ui.SelectWidget.prototype.onMouseMove = function () { + OO.ui.warnDeprecation( 'onMouseMove is deprecated, use onDocumentMouseMove instead' ); + this.onDocumentMouseMove.apply( this, arguments ); +}; + /** * Handle mouse over events. * @@ -6479,12 +6533,12 @@ OO.ui.SelectWidget.prototype.onMouseLeave = function () { }; /** - * Handle key down events. + * Handle document key down events. * * @protected * @param {KeyboardEvent} e Key down event */ -OO.ui.SelectWidget.prototype.onKeyDown = function ( e ) { +OO.ui.SelectWidget.prototype.onDocumentKeyDown = function ( e ) { var nextItem, handled = false, currentItem = this.findHighlightedItem() || this.findSelectedItem(); @@ -6515,8 +6569,8 @@ OO.ui.SelectWidget.prototype.onKeyDown = function ( e ) { if ( currentItem && currentItem.constructor.static.highlightable ) { currentItem.setHighlighted( false ); } - this.unbindKeyDownListener(); - this.unbindKeyPressListener(); + this.unbindDocumentKeyDownListener(); + this.unbindDocumentKeyPressListener(); // Don't prevent tabbing away / defocusing handled = false; break; @@ -6538,22 +6592,40 @@ OO.ui.SelectWidget.prototype.onKeyDown = function ( e ) { } }; +// Deprecated alias since 0.28.3 +OO.ui.SelectWidget.prototype.onKeyDown = function () { + OO.ui.warnDeprecation( 'onKeyDown is deprecated, use onDocumentKeyDown instead' ); + this.onDocumentKeyDown.apply( this, arguments ); +}; + /** - * Bind key down listener. + * Bind document key down listener. * * @protected */ +OO.ui.SelectWidget.prototype.bindDocumentKeyDownListener = function () { + this.getElementDocument().addEventListener( 'keydown', this.onDocumentKeyDownHandler, true ); +}; + +// Deprecated alias since 0.28.3 OO.ui.SelectWidget.prototype.bindKeyDownListener = function () { - this.getElementWindow().addEventListener( 'keydown', this.onKeyDownHandler, true ); + OO.ui.warnDeprecation( 'bindKeyDownListener is deprecated, use bindDocumentKeyDownListener instead' ); + this.bindDocumentKeyDownListener.apply( this, arguments ); }; /** - * Unbind key down listener. + * Unbind document key down listener. * * @protected */ +OO.ui.SelectWidget.prototype.unbindDocumentKeyDownListener = function () { + this.getElementDocument().removeEventListener( 'keydown', this.onDocumentKeyDownHandler, true ); +}; + +// Deprecated alias since 0.28.3 OO.ui.SelectWidget.prototype.unbindKeyDownListener = function () { - this.getElementWindow().removeEventListener( 'keydown', this.onKeyDownHandler, true ); + OO.ui.warnDeprecation( 'unbindKeyDownListener is deprecated, use unbindDocumentKeyDownListener instead' ); + this.unbindDocumentKeyDownListener.apply( this, arguments ); }; /** @@ -6592,7 +6664,7 @@ OO.ui.SelectWidget.prototype.clearKeyPressBuffer = function () { * @protected * @param {KeyboardEvent} e Key press event */ -OO.ui.SelectWidget.prototype.onKeyPress = function ( e ) { +OO.ui.SelectWidget.prototype.onDocumentKeyPress = function ( e ) { var c, filter, item; if ( !e.charCode ) { @@ -6642,6 +6714,12 @@ OO.ui.SelectWidget.prototype.onKeyPress = function ( e ) { e.stopPropagation(); }; +// Deprecated alias since 0.28.3 +OO.ui.SelectWidget.prototype.onKeyPress = function () { + OO.ui.warnDeprecation( 'onKeyPress is deprecated, use onDocumentKeyPress instead' ); + this.onDocumentKeyPress.apply( this, arguments ); +}; + /** * Get a matcher for the specific string * @@ -6672,27 +6750,39 @@ OO.ui.SelectWidget.prototype.getItemMatcher = function ( s, exact ) { }; /** - * Bind key press listener. + * Bind document key press listener. * * @protected */ +OO.ui.SelectWidget.prototype.bindDocumentKeyPressListener = function () { + this.getElementDocument().addEventListener( 'keypress', this.onDocumentKeyPressHandler, true ); +}; + +// Deprecated alias since 0.28.3 OO.ui.SelectWidget.prototype.bindKeyPressListener = function () { - this.getElementWindow().addEventListener( 'keypress', this.onKeyPressHandler, true ); + OO.ui.warnDeprecation( 'bindKeyPressListener is deprecated, use bindDocumentKeyPressListener instead' ); + this.bindDocumentKeyPressListener.apply( this, arguments ); }; /** - * Unbind key down listener. + * Unbind document key down listener. * * If you override this, be sure to call this.clearKeyPressBuffer() from your * implementation. * * @protected */ -OO.ui.SelectWidget.prototype.unbindKeyPressListener = function () { - this.getElementWindow().removeEventListener( 'keypress', this.onKeyPressHandler, true ); +OO.ui.SelectWidget.prototype.unbindDocumentKeyPressListener = function () { + this.getElementDocument().removeEventListener( 'keypress', this.onDocumentKeyPressHandler, true ); this.clearKeyPressBuffer(); }; +// Deprecated alias since 0.28.3 +OO.ui.SelectWidget.prototype.unbindKeyPressListener = function () { + OO.ui.warnDeprecation( 'unbindDocumentKeyPressListener is deprecated, use unbindDocumentKeyPressListener instead' ); + this.unbindDocumentKeyPressListener.apply( this, arguments ); +}; + /** * Visibility change handler * @@ -7286,7 +7376,7 @@ OO.ui.MenuSectionOptionWidget.static.highlightable = false; * the text the user types. This config is used by {@link OO.ui.ComboBoxInputWidget ComboBoxInputWidget} * and {@link OO.ui.mixin.LookupElement LookupElement} * @cfg {jQuery} [$input] Text input used to implement option highlighting for menu items that match - * the text the user types. This config is used by {@link OO.ui.CapsuleMultiselectWidget CapsuleMultiselectWidget} + * the text the user types. This config is used by {@link OO.ui.TagMultiselectWidget TagMultiselectWidget} * @cfg {OO.ui.Widget} [widget] Widget associated with the menu's active state. If the user clicks the mouse * anywhere on the page outside of this widget, the menu is hidden. For example, if there is a button * that toggles the menu's visibility on click, the menu will be hidden then re-shown when the user clicks @@ -7392,7 +7482,7 @@ OO.ui.MenuSelectWidget.prototype.onDocumentMouseDown = function ( e ) { /** * @inheritdoc */ -OO.ui.MenuSelectWidget.prototype.onKeyDown = function ( e ) { +OO.ui.MenuSelectWidget.prototype.onDocumentKeyDown = function ( e ) { var currentItem = this.findHighlightedItem() || this.findSelectedItem(); if ( !this.isDisabled() && this.isVisible() ) { @@ -7491,50 +7581,50 @@ OO.ui.MenuSelectWidget.prototype.updateItemVisibility = function () { /** * @inheritdoc */ -OO.ui.MenuSelectWidget.prototype.bindKeyDownListener = function () { +OO.ui.MenuSelectWidget.prototype.bindDocumentKeyDownListener = function () { if ( this.$input ) { this.$input.on( 'keydown', this.onKeyDownHandler ); } else { - OO.ui.MenuSelectWidget.parent.prototype.bindKeyDownListener.call( this ); + OO.ui.MenuSelectWidget.parent.prototype.bindDocumentKeyDownListener.call( this ); } }; /** * @inheritdoc */ -OO.ui.MenuSelectWidget.prototype.unbindKeyDownListener = function () { +OO.ui.MenuSelectWidget.prototype.unbindDocumentKeyDownListener = function () { if ( this.$input ) { this.$input.off( 'keydown', this.onKeyDownHandler ); } else { - OO.ui.MenuSelectWidget.parent.prototype.unbindKeyDownListener.call( this ); + OO.ui.MenuSelectWidget.parent.prototype.unbindDocumentKeyDownListener.call( this ); } }; /** * @inheritdoc */ -OO.ui.MenuSelectWidget.prototype.bindKeyPressListener = function () { +OO.ui.MenuSelectWidget.prototype.bindDocumentKeyPressListener = function () { if ( this.$input ) { if ( this.filterFromInput ) { this.$input.on( 'keydown mouseup cut paste change input select', this.onInputEditHandler ); this.updateItemVisibility(); } } else { - OO.ui.MenuSelectWidget.parent.prototype.bindKeyPressListener.call( this ); + OO.ui.MenuSelectWidget.parent.prototype.bindDocumentKeyPressListener.call( this ); } }; /** * @inheritdoc */ -OO.ui.MenuSelectWidget.prototype.unbindKeyPressListener = function () { +OO.ui.MenuSelectWidget.prototype.unbindDocumentKeyPressListener = function () { if ( this.$input ) { if ( this.filterFromInput ) { this.$input.off( 'keydown mouseup cut paste change input select', this.onInputEditHandler ); this.updateItemVisibility(); } } else { - OO.ui.MenuSelectWidget.parent.prototype.unbindKeyPressListener.call( this ); + OO.ui.MenuSelectWidget.parent.prototype.unbindDocumentKeyPressListener.call( this ); } }; @@ -7645,8 +7735,8 @@ OO.ui.MenuSelectWidget.prototype.toggle = function ( visible ) { this.togglePositioning( !!this.$floatableContainer ); this.toggleClipping( true ); - this.bindKeyDownListener(); - this.bindKeyPressListener(); + this.bindDocumentKeyDownListener(); + this.bindDocumentKeyPressListener(); if ( ( this.isClippedVertically() || this.isFloatableOutOfView() ) && @@ -7684,8 +7774,8 @@ OO.ui.MenuSelectWidget.prototype.toggle = function ( visible ) { this.emit( 'ready' ); } else { this.$focusOwner.removeAttr( 'aria-activedescendant' ); - this.unbindKeyDownListener(); - this.unbindKeyPressListener(); + this.unbindDocumentKeyDownListener(); + this.unbindDocumentKeyPressListener(); this.$focusOwner.attr( 'aria-expanded', 'false' ); this.getElementDocument().removeEventListener( 'mousedown', this.onDocumentMouseDownHandler, true ); this.togglePositioning( false ); @@ -8046,8 +8136,8 @@ OO.ui.RadioSelectWidget = function OoUiRadioSelectWidget( config ) { // Events this.$element.on( { - focus: this.bindKeyDownListener.bind( this ), - blur: this.unbindKeyDownListener.bind( this ) + focus: this.bindDocumentKeyDownListener.bind( this ), + blur: this.unbindDocumentKeyDownListener.bind( this ) } ); // Initialization @@ -8172,7 +8262,7 @@ OO.ui.MultiselectWidget = function OoUiMultiselectWidget( config ) { // Events this.aggregate( { change: 'select' } ); - // This is mostly for compatibility with CapsuleMultiselectWidget... normally, 'change' is emitted + // This is mostly for compatibility with TagMultiselectWidget... normally, 'change' is emitted // by GroupElement only when items are added/removed this.connect( this, { select: [ 'emit', 'change' ] } ); @@ -10093,11 +10183,6 @@ OO.ui.TextInputWidget = function OoUiTextInputWidget( config ) { labelPosition: 'after' }, config ); - if ( config.multiline ) { - OO.ui.warnDeprecation( 'TextInputWidget: config.multiline is deprecated. Use the MultilineTextInputWidget instead. See T130434.' ); - return new OO.ui.MultilineTextInputWidget( config ); - } - // Parent constructor OO.ui.TextInputWidget.parent.call( this, config ); @@ -10841,12 +10926,10 @@ OO.ui.MultilineTextInputWidget = function OoUiMultilineTextInputWidget( config ) config = $.extend( { type: 'text' }, config ); - config.multiline = false; // Parent constructor OO.ui.MultilineTextInputWidget.parent.call( this, config ); // Properties - this.multiline = true; this.autosize = !!config.autosize; this.minRows = config.rows !== undefined ? config.rows : ''; this.maxRows = config.maxRows || Math.max( 2 * ( this.minRows || 0 ), 10 ); @@ -10868,7 +10951,7 @@ OO.ui.MultilineTextInputWidget = function OoUiMultilineTextInputWidget( config ) } ); // Initialization - if ( this.multiline && config.rows ) { + if ( config.rows ) { this.$input.attr( 'rows', config.rows ); } if ( this.autosize ) { @@ -11018,15 +11101,6 @@ OO.ui.MultilineTextInputWidget.prototype.getInputElement = function () { return $( '