From: James D. Forrester Date: Tue, 3 Nov 2015 21:44:50 +0000 (-0800) Subject: Update OOjs UI to v0.13.1 X-Git-Tag: 1.31.0-rc.0~9116 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=ce9c1264b42eef9e89d1fdef11208b7fb2699b64 Update OOjs UI to v0.13.1 Release notes: https://git.wikimedia.org/blob/oojs%2Fui.git/v0.13.1/History.md Change-Id: Ic8fbb6ee4326c73243ea655708b9cfd09bc7e52a --- diff --git a/composer.json b/composer.json index 553ec44f6a..78c23cef11 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "ext-iconv": "*", "liuggio/statsd-php-client": "1.0.16", "mediawiki/at-ease": "1.1.0", - "oojs/oojs-ui": "0.13.0", + "oojs/oojs-ui": "0.13.1", "oyejorge/less.php": "1.7.0.9", "php": ">=5.3.3", "psr/log": "1.0.0", diff --git a/resources/lib/oojs-ui/i18n/hy.json b/resources/lib/oojs-ui/i18n/hy.json index c2b45a8b2e..2cd688e868 100644 --- a/resources/lib/oojs-ui/i18n/hy.json +++ b/resources/lib/oojs-ui/i18n/hy.json @@ -19,6 +19,8 @@ "ooui-dialog-process-dismiss": "Փակել", "ooui-dialog-process-retry": "Կրկին փորձել", "ooui-dialog-process-continue": "Շարունակել", + "ooui-selectfile-button-select": "Ընտրել նիշք", "ooui-selectfile-not-supported": "Ֆայլի ընտրությունը չի պաշտպանվում", - "ooui-selectfile-placeholder": "Ֆայլն ընտրված չէ" + "ooui-selectfile-placeholder": "Ֆայլն ընտրված չէ", + "ooui-selectfile-dragdrop-placeholder": "Ֆայլը գցել այստե" } diff --git a/resources/lib/oojs-ui/i18n/jv.json b/resources/lib/oojs-ui/i18n/jv.json index 677b1c3dfe..1024d2ad02 100644 --- a/resources/lib/oojs-ui/i18n/jv.json +++ b/resources/lib/oojs-ui/i18n/jv.json @@ -4,14 +4,15 @@ "Gleki", "NoiX180", "Pras", - "Jadinegara" + "Jadinegara", + "Meursault2004" ] }, "ooui-outline-control-move-down": "Pindhahaken butir mangandhap", - "ooui-outline-control-move-up": "Pindhah kara mêndhuwur", + "ooui-outline-control-move-up": "Pindhah kara menyang dhuwur", "ooui-outline-control-remove": "Busak kara", - "ooui-toolbar-more": "Mênèh", - "ooui-toolgroup-expand": "Mênèh", + "ooui-toolbar-more": "Manèh", + "ooui-toolgroup-expand": "Manèh", "ooui-toolgroup-collapse": "Suda", "ooui-dialog-message-accept": "Oké", "ooui-dialog-message-reject": "Batal", @@ -19,6 +20,6 @@ "ooui-dialog-process-dismiss": "Tutup", "ooui-dialog-process-retry": "Jajal manèh", "ooui-dialog-process-continue": "Tutug", - "ooui-selectfile-not-supported": "Pilihan bêrkas ora disokong", - "ooui-selectfile-placeholder": "Ora ana bêrkas sing kapilih" + "ooui-selectfile-not-supported": "Pilihan berkas ora disokong", + "ooui-selectfile-placeholder": "Ora ana berkas sing kapilih" } diff --git a/resources/lib/oojs-ui/i18n/lb.json b/resources/lib/oojs-ui/i18n/lb.json index 39bc670166..fad4c1c5b9 100644 --- a/resources/lib/oojs-ui/i18n/lb.json +++ b/resources/lib/oojs-ui/i18n/lb.json @@ -23,6 +23,7 @@ "ooui-dialog-process-retry": "Nach eng Kéier probéieren", "ooui-dialog-process-continue": "Virufueren", "ooui-selectfile-button-select": "E Fichier eraussichen", + "ooui-selectfile-not-supported": "D'Eraussiche vu Fichiere gëtt net ënnerstëtzt.", "ooui-selectfile-placeholder": "Et ass kee Fichier erausgesicht", "ooui-selectfile-dragdrop-placeholder": "Fichier hei ofleeën" } diff --git a/resources/lib/oojs-ui/i18n/lt.json b/resources/lib/oojs-ui/i18n/lt.json index fbd22d0f43..86c6d64887 100644 --- a/resources/lib/oojs-ui/i18n/lt.json +++ b/resources/lib/oojs-ui/i18n/lt.json @@ -9,7 +9,7 @@ }, "ooui-outline-control-move-down": "Perkelti elementą žemyn", "ooui-outline-control-move-up": "Perkelti elementą aukštyn", - "ooui-outline-control-remove": "Šalinti elementus", + "ooui-outline-control-remove": "Šalinti įrašą", "ooui-toolbar-more": "Daugiau", "ooui-toolgroup-expand": "Daugiau", "ooui-toolgroup-collapse": "Mažiau", diff --git a/resources/lib/oojs-ui/i18n/pt-br.json b/resources/lib/oojs-ui/i18n/pt-br.json index bcc31e094a..fc299620db 100644 --- a/resources/lib/oojs-ui/i18n/pt-br.json +++ b/resources/lib/oojs-ui/i18n/pt-br.json @@ -26,6 +26,8 @@ "ooui-dialog-process-dismiss": "Dispensar", "ooui-dialog-process-retry": "Tentar novamente", "ooui-dialog-process-continue": "Continuar", + "ooui-selectfile-button-select": "Selecionar um arquivo", "ooui-selectfile-not-supported": "O selecionamento de arquivos não é suportado", - "ooui-selectfile-placeholder": "Nenhum arquivo selecionado" + "ooui-selectfile-placeholder": "Nenhum arquivo selecionado", + "ooui-selectfile-dragdrop-placeholder": "Arraste o arquivo para cá" } diff --git a/resources/lib/oojs-ui/oojs-ui-apex-noimages.css b/resources/lib/oojs-ui/oojs-ui-apex-noimages.css index 131413e37f..9abc847eba 100644 --- a/resources/lib/oojs-ui/oojs-ui-apex-noimages.css +++ b/resources/lib/oojs-ui/oojs-ui-apex-noimages.css @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.13.0 + * OOjs UI v0.13.1 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2015 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2015-10-27T17:53:00Z + * Date: 2015-11-03T21:42:28Z */ @-webkit-keyframes oo-ui-progressBarWidget-slide { from { @@ -1777,9 +1777,6 @@ .oo-ui-textInputWidget textarea.oo-ui-pendingElement-pending { background-color: transparent; } -.oo-ui-textInputWidget-icon { - width: 2em; -} .oo-ui-textInputWidget.oo-ui-widget-enabled input:focus, .oo-ui-textInputWidget.oo-ui-widget-enabled textarea:focus { outline: none; @@ -1815,6 +1812,7 @@ } .oo-ui-textInputWidget.oo-ui-iconElement .oo-ui-iconElement-icon { width: 1.875em; + max-height: 2.375em; margin-left: 0.3em; } .oo-ui-textInputWidget.oo-ui-indicatorElement input, @@ -1823,6 +1821,7 @@ } .oo-ui-textInputWidget.oo-ui-indicatorElement .oo-ui-indicatorElement-indicator { width: 0.9375em; + max-height: 2.375em; margin-right: 0.775em; } .oo-ui-textInputWidget > .oo-ui-labelElement-label { diff --git a/resources/lib/oojs-ui/oojs-ui-apex.js b/resources/lib/oojs-ui/oojs-ui-apex.js index 3158bfe438..00a09663ca 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.13.0 + * OOjs UI v0.13.1 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2015 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2015-10-27T17:52:51Z + * Date: 2015-11-03T21:42:20Z */ /** * @class diff --git a/resources/lib/oojs-ui/oojs-ui-mediawiki-noimages.css b/resources/lib/oojs-ui/oojs-ui-mediawiki-noimages.css index 96ba45c683..fdb06e55b2 100644 --- a/resources/lib/oojs-ui/oojs-ui-mediawiki-noimages.css +++ b/resources/lib/oojs-ui/oojs-ui-mediawiki-noimages.css @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.13.0 + * OOjs UI v0.13.1 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2015 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2015-10-27T17:53:00Z + * Date: 2015-11-03T21:42:28Z */ @-webkit-keyframes oo-ui-progressBarWidget-slide { from { @@ -1974,9 +1974,6 @@ .oo-ui-textInputWidget textarea.oo-ui-pendingElement-pending { background-color: transparent; } -.oo-ui-textInputWidget-icon { - width: 2em; -} .oo-ui-textInputWidget.oo-ui-widget-enabled input, .oo-ui-textInputWidget.oo-ui-widget-enabled textarea { -webkit-transition: border 200ms cubic-bezier(0.39, 0.575, 0.565, 1), box-shadow 200ms cubic-bezier(0.39, 0.575, 0.565, 1); @@ -2031,6 +2028,7 @@ .oo-ui-textInputWidget.oo-ui-iconElement .oo-ui-iconElement-icon { left: 0; width: 1.875em; + max-height: 2.375em; margin-left: 0.5em; height: 100%; background-position: right center; @@ -2041,6 +2039,7 @@ } .oo-ui-textInputWidget.oo-ui-indicatorElement .oo-ui-indicatorElement-indicator { width: 0.9375em; + max-height: 2.375em; margin: 0 0.775em; height: 100%; } @@ -2053,7 +2052,7 @@ margin-right: 2.0875em; } .oo-ui-textInputWidget-labelPosition-before.oo-ui-iconElement > .oo-ui-labelElement-label { - margin-right: 2.475em; + margin-left: 2.475em; } .oo-ui-menuSelectWidget { position: absolute; diff --git a/resources/lib/oojs-ui/oojs-ui-mediawiki.js b/resources/lib/oojs-ui/oojs-ui-mediawiki.js index 95e8b47ba0..d9a17a2249 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.13.0 + * OOjs UI v0.13.1 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2015 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2015-10-27T17:52:51Z + * Date: 2015-11-03T21:42:20Z */ /** * @class diff --git a/resources/lib/oojs-ui/oojs-ui.js b/resources/lib/oojs-ui/oojs-ui.js index fbffe09a77..b4dc48c8e7 100644 --- a/resources/lib/oojs-ui/oojs-ui.js +++ b/resources/lib/oojs-ui/oojs-ui.js @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.13.0 + * OOjs UI v0.13.1 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2015 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2015-10-27T17:52:51Z + * Date: 2015-11-03T21:42:20Z */ ( function ( OO ) { @@ -1289,17 +1289,25 @@ OO.ui.Element.static.unsafeInfuse = function ( idOrNode, domPromise ) { } } } ); + // allow widgets to reuse parts of the DOM + data = cls.static.reusePreInfuseDOM( $elem[ 0 ], data ); // pick up dynamic state, like focus, value of form inputs, scroll position, etc. - state = cls.static.gatherPreInfuseState( $elem, data ); + state = cls.static.gatherPreInfuseState( $elem[ 0 ], data ); + // rebuild widget // jscs:disable requireCapitalizedConstructors - obj = new cls( data ); // rebuild widget + obj = new cls( data ); + // jscs:enable requireCapitalizedConstructors // now replace old DOM with this new DOM. if ( top ) { - $elem.replaceWith( obj.$element ); - // This element is now gone from the DOM, but if anyone is holding a reference to it, - // let's allow them to OO.ui.infuse() it and do what they expect (T105828). - // Do not use jQuery.data(), as using it on detached nodes leaks memory in 1.x line by design. - $elem[ 0 ].oouiInfused = obj; + // An efficient constructor might be able to reuse the entire DOM tree of the original element, + // so only mutate the DOM if we need to. + if ( $elem[ 0 ] !== obj.$element[ 0 ] ) { + $elem.replaceWith( obj.$element ); + // This element is now gone from the DOM, but if anyone is holding a reference to it, + // let's allow them to OO.ui.infuse() it and do what they expect (T105828). + // Do not use jQuery.data(), as using it on detached nodes leaks memory in 1.x line by design. + $elem[ 0 ].oouiInfused = obj; + } top.resolve(); } obj.$element.data( 'ooui-infused', obj ); @@ -1310,6 +1318,22 @@ OO.ui.Element.static.unsafeInfuse = function ( idOrNode, domPromise ) { return obj; }; +/** + * Pick out parts of `node`'s DOM to be reused when infusing a widget. + * + * This method **must not** make any changes to the DOM, only find interesting pieces and add them + * to `config` (which should then be returned). Actual DOM juggling should then be done by the + * constructor, which will be given the enhanced config. + * + * @protected + * @param {HTMLElement} node + * @param {Object} config + * @return {Object} + */ +OO.ui.Element.static.reusePreInfuseDOM = function ( node, config ) { + return config; +}; + /** * Gather the dynamic state (focus, value of form inputs, scroll position, etc.) of a HTML DOM node * (and its children) that represent an Element of the same class and the given configuration, @@ -9021,7 +9045,7 @@ OO.ui.ProcessDialog.prototype.getTeardownProcess = function ( data ) { * @throws {Error} An error is thrown if no widget is specified */ OO.ui.FieldLayout = function OoUiFieldLayout( fieldWidget, config ) { - var hasInputWidget, div, i; + var hasInputWidget, div; // Allow passing positional parameters inside the config object if ( OO.isPlainObject( fieldWidget ) && config === undefined ) { @@ -9048,8 +9072,8 @@ OO.ui.FieldLayout = function OoUiFieldLayout( fieldWidget, config ) { // Properties this.fieldWidget = fieldWidget; - this.errors = config.errors || []; - this.notices = config.notices || []; + this.errors = []; + this.notices = []; this.$field = $( '
' ); this.$messages = $( '