From: James D. Forrester Date: Wed, 23 Jul 2014 23:48:16 +0000 (-0700) Subject: Update OOjs UI to v0.1.0-pre (a7ce4d48d9) X-Git-Tag: 1.31.0-rc.0~14780^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=5f2195f91827b2022033a53b32acd0443f20f33d;p=lhc%2Fweb%2Fwiklou.git Update OOjs UI to v0.1.0-pre (a7ce4d48d9) New changes: 6847186 Tests: Move …/test/… to …/tests/… to be the same as other repos c2ee74f Handle touch events in toolbars and toolgroups 84b51fe Localisation updates from https://translatewiki.net. a875313 Make TextInputWidget's autosizing work when setValue() is called Change-Id: I9c26f04281f1988cacaaf7d72753e06419541873 --- diff --git a/resources/lib/oojs-ui/i18n/ms.json b/resources/lib/oojs-ui/i18n/ms.json index c2d9bc802f..823d49365b 100644 --- a/resources/lib/oojs-ui/i18n/ms.json +++ b/resources/lib/oojs-ui/i18n/ms.json @@ -6,12 +6,12 @@ "Pizza1016" ] }, - "ooui-dialog-action-close": "Tutup", "ooui-outline-control-move-down": "Alihkan perkara ke bawah", "ooui-outline-control-move-up": "Alihkan perkara ke atas", "ooui-outline-control-remove": "Buang perkara", "ooui-toolbar-more": "Selebihnya", - "ooui-dialog-confirm-title": "Mengesahkan", - "ooui-dialog-confirm-default-prompt": "Adakah anda pasti?", - "ooui-dialog-confirm-default-cancel": "Batal" + "ooui-dialog-message-reject": "Batal", + "ooui-dialog-process-error": "Ada masalah", + "ooui-dialog-process-dismiss": "Singkir", + "ooui-dialog-process-retry": "Cuba lagi" } diff --git a/resources/lib/oojs-ui/oojs-ui-agora.css b/resources/lib/oojs-ui/oojs-ui-agora.css index ae5383c269..a046047b16 100644 --- a/resources/lib/oojs-ui/oojs-ui-agora.css +++ b/resources/lib/oojs-ui/oojs-ui-agora.css @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.1.0-pre (9cd400e3d5) + * OOjs UI v0.1.0-pre (a7ce4d48d9) * 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-07-22T21:59:46Z + * Date: 2014-07-23T23:48:16Z */ .oo-ui-dialog-content > .oo-ui-window-head, .oo-ui-dialog-content > .oo-ui-window-body, diff --git a/resources/lib/oojs-ui/oojs-ui-apex.css b/resources/lib/oojs-ui/oojs-ui-apex.css index b5a6eee042..eefbbc44b4 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 (9cd400e3d5) + * OOjs UI v0.1.0-pre (a7ce4d48d9) * 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-07-22T21:59:46Z + * Date: 2014-07-23T23:48:16Z */ .oo-ui-dialog-content > .oo-ui-window-head, .oo-ui-dialog-content > .oo-ui-window-body, diff --git a/resources/lib/oojs-ui/oojs-ui.js b/resources/lib/oojs-ui/oojs-ui.js index 170d207566..2c271aaa2f 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 (9cd400e3d5) + * OOjs UI v0.1.0-pre (a7ce4d48d9) * 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-07-22T21:59:46Z + * Date: 2014-07-23T23:48:16Z */ ( function ( OO ) { @@ -4612,7 +4612,7 @@ OO.ui.Toolbar = function OoUiToolbar( toolFactory, toolGroupFactory, config ) { // Events this.$element .add( this.$bar ).add( this.$group ).add( this.$actions ) - .on( 'mousedown', OO.ui.bind( this.onMouseDown, this ) ); + .on( 'mousedown touchstart', OO.ui.bind( this.onPointerDown, this ) ); // Initialization this.$group.addClass( 'oo-ui-toolbar-tools' ); @@ -4659,7 +4659,7 @@ OO.ui.Toolbar.prototype.getToolGroupFactory = function () { * * @param {jQuery.Event} e Mouse down event */ -OO.ui.Toolbar.prototype.onMouseDown = function ( e ) { +OO.ui.Toolbar.prototype.onPointerDown = function ( e ) { var $closestWidgetToEvent = this.$( e.target ).closest( '.oo-ui-widget' ), $closestWidgetToToolbar = this.$element.closest( '.oo-ui-widget' ); if ( !$closestWidgetToEvent.length || $closestWidgetToEvent[0] === $closestWidgetToToolbar[0] ) { @@ -4828,8 +4828,8 @@ OO.ui.ToolGroup = function OoUiToolGroup( toolbar, config ) { // Events this.$element.on( { - 'mousedown': OO.ui.bind( this.onMouseDown, this ), - 'mouseup': OO.ui.bind( this.onMouseUp, this ), + 'mousedown touchstart': OO.ui.bind( this.onPointerDown, this ), + 'mouseup touchend': OO.ui.bind( this.onPointerUp, this ), 'mouseover': OO.ui.bind( this.onMouseOver, this ), 'mouseout': OO.ui.bind( this.onMouseOut, this ) } ); @@ -4918,8 +4918,9 @@ OO.ui.ToolGroup.prototype.updateDisabled = function () { * * @param {jQuery.Event} e Mouse down event */ -OO.ui.ToolGroup.prototype.onMouseDown = function ( e ) { - if ( !this.isDisabled() && e.which === 1 ) { +OO.ui.ToolGroup.prototype.onPointerDown = function ( e ) { + // e.which is 0 for touch events, 1 for left mouse button + if ( !this.isDisabled() && e.which <= 1 ) { this.pressed = this.getTargetTool( e ); if ( this.pressed ) { this.pressed.setActive( true ); @@ -4938,9 +4939,9 @@ OO.ui.ToolGroup.prototype.onMouseDown = function ( e ) { */ OO.ui.ToolGroup.prototype.onCapturedMouseUp = function ( e ) { this.getElementDocument().removeEventListener( 'mouseup', this.onCapturedMouseUpHandler, true ); - // onMouseUp may be called a second time, depending on where the mouse is when the button is + // onPointerUp may be called a second time, depending on where the mouse is when the button is // released, but since `this.pressed` will no longer be true, the second call will be ignored. - this.onMouseUp( e ); + this.onPointerUp( e ); }; /** @@ -4948,10 +4949,11 @@ OO.ui.ToolGroup.prototype.onCapturedMouseUp = function ( e ) { * * @param {jQuery.Event} e Mouse up event */ -OO.ui.ToolGroup.prototype.onMouseUp = function ( e ) { +OO.ui.ToolGroup.prototype.onPointerUp = function ( e ) { var tool = this.getTargetTool( e ); - if ( !this.isDisabled() && e.which === 1 && this.pressed && this.pressed === tool ) { + // e.which is 0 for touch events, 1 for left mouse button + if ( !this.isDisabled() && e.which <= 1 && this.pressed && this.pressed === tool ) { this.pressed.onSelect(); } @@ -6752,8 +6754,8 @@ OO.ui.PopupToolGroup = function OoUiPopupToolGroup( toolbar, config ) { // Events this.$handle.on( { - 'mousedown': OO.ui.bind( this.onHandleMouseDown, this ), - 'mouseup': OO.ui.bind( this.onHandleMouseUp, this ) + 'mousedown touchstart': OO.ui.bind( this.onHandlePointerDown, this ), + 'mouseup touchend': OO.ui.bind( this.onHandlePointerUp, this ) } ); // Initialization @@ -6817,11 +6819,12 @@ OO.ui.PopupToolGroup.prototype.onBlur = function ( e ) { /** * @inheritdoc */ -OO.ui.PopupToolGroup.prototype.onMouseUp = function ( e ) { - if ( !this.isDisabled() && e.which === 1 ) { +OO.ui.PopupToolGroup.prototype.onPointerUp = function ( e ) { + // e.which is 0 for touch events, 1 for left mouse button + if ( !this.isDisabled() && e.which <= 1 ) { this.setActive( false ); } - return OO.ui.PopupToolGroup.super.prototype.onMouseUp.call( this, e ); + return OO.ui.PopupToolGroup.super.prototype.onPointerUp.call( this, e ); }; /** @@ -6829,7 +6832,7 @@ OO.ui.PopupToolGroup.prototype.onMouseUp = function ( e ) { * * @param {jQuery.Event} e Mouse up event */ -OO.ui.PopupToolGroup.prototype.onHandleMouseUp = function () { +OO.ui.PopupToolGroup.prototype.onHandlePointerUp = function () { return false; }; @@ -6838,8 +6841,9 @@ OO.ui.PopupToolGroup.prototype.onHandleMouseUp = function () { * * @param {jQuery.Event} e Mouse down event */ -OO.ui.PopupToolGroup.prototype.onHandleMouseDown = function ( e ) { - if ( !this.isDisabled() && e.which === 1 ) { +OO.ui.PopupToolGroup.prototype.onHandlePointerDown = function ( e ) { + // e.which is 0 for touch events, 1 for left mouse button + if ( !this.isDisabled() && e.which <= 1 ) { this.setActive( !this.active ); } return false; @@ -8518,6 +8522,17 @@ OO.ui.TextInputWidget.prototype.onEdit = function () { return OO.ui.TextInputWidget.super.prototype.onEdit.call( this ); }; +/** + * @inheritdoc + */ +OO.ui.TextInputWidget.prototype.setValue = function ( value ) { + // Parent method + OO.ui.TextInputWidget.super.prototype.setValue.call( this, value ); + + this.adjustSize(); + return this; +}; + /** * Automatically adjust the size of the text input. * diff --git a/resources/lib/oojs-ui/oojs-ui.svg.css b/resources/lib/oojs-ui/oojs-ui.svg.css index c7b7d8db6b..abcad23934 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 (9cd400e3d5) + * OOjs UI v0.1.0-pre (a7ce4d48d9) * 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-07-22T21:59:46Z + * Date: 2014-07-23T23:48:16Z */ /* Textures */