Update OOjs UI to v0.1.0-pre (a7ce4d48d9)
authorJames D. Forrester <jforrester@wikimedia.org>
Wed, 23 Jul 2014 23:48:16 +0000 (16:48 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Thu, 24 Jul 2014 00:42:56 +0000 (17:42 -0700)
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

resources/lib/oojs-ui/i18n/ms.json
resources/lib/oojs-ui/oojs-ui-agora.css
resources/lib/oojs-ui/oojs-ui-apex.css
resources/lib/oojs-ui/oojs-ui.js
resources/lib/oojs-ui/oojs-ui.svg.css

index c2d9bc8..823d493 100644 (file)
@@ -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"
 }
index ae5383c..a046047 100644 (file)
@@ -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,
index b5a6eee..eefbbc4 100644 (file)
@@ -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,
index 170d207..2c271aa 100644 (file)
@@ -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.
  *
index c7b7d8d..abcad23 100644 (file)
@@ -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 */