Update OOjs UI to v0.1.0-pre (098f84f8a0)
authorJames D. Forrester <jforrester@wikimedia.org>
Mon, 9 Jun 2014 21:32:31 +0000 (14:32 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Mon, 9 Jun 2014 21:32:31 +0000 (14:32 -0700)
New changes:
371fcff Correct TextInputMenuWidget position for RTL
05467d3 Localisation updates from https://translatewiki.net.
2334482 GroupElement: Improve performance by avoiding .add() overhead

Change-Id: I6701dd1bc08343e14f6b3cacdfe0c8d80b350394

resources/lib/oojs-ui/i18n/be.json
resources/lib/oojs-ui/oojs-ui.js
resources/lib/oojs-ui/oojs-ui.svg.css

index 0ef6829..08fbe0b 100644 (file)
@@ -1,8 +1,13 @@
 {
        "@metadata": {
                "authors": [
-                       "Чаховіч Уладзіслаў"
+                       "Чаховіч Уладзіслаў",
+                       "Artificial123"
                ]
        },
-       "ooui-dialog-action-close": "Закрыць"
+       "ooui-dialog-action-close": "Закрыць",
+       "ooui-dialog-confirm-title": "Пацвердзіць",
+       "ooui-dialog-confirm-default-prompt": "Вы ўпэўненыя?",
+       "ooui-dialog-confirm-default-ok": "ОК",
+       "ooui-dialog-confirm-default-cancel": "Адмяніць"
 }
index 0ed95a2..092af64 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (c9b9f8345d)
+ * OOjs UI v0.1.0-pre (098f84f8a0)
  * 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: Thu Jun 05 2014 18:43:23 GMT-0700 (PDT)
+ * Date: Mon Jun 09 2014 14:32:26 GMT-0700 (PDT)
  */
 ( function ( OO ) {
 
@@ -2524,7 +2524,6 @@ OO.ui.GroupElement = function OoUiGroupElement( $group, config ) {
        // Properties
        this.$group = $group;
        this.items = [];
-       this.$items = this.$( [] );
        this.aggregateItemEvents = {};
 };
 
@@ -2601,7 +2600,7 @@ OO.ui.GroupElement.prototype.aggregate = function ( events ) {
  */
 OO.ui.GroupElement.prototype.addItems = function ( items, index ) {
        var i, len, item, event, events, currentIndex,
-               $items = this.$( [] );
+               itemElements = [];
 
        for ( i = 0, len = items.length; i < len; i++ ) {
                item = items[i];
@@ -2624,22 +2623,20 @@ OO.ui.GroupElement.prototype.addItems = function ( items, index ) {
                        item.connect( this, events );
                }
                item.setElementGroup( this );
-               $items = $items.add( item.$element );
+               itemElements.push( item.$element.get( 0 ) );
        }
 
        if ( index === undefined || index < 0 || index >= this.items.length ) {
-               this.$group.append( $items );
+               this.$group.append( itemElements );
                this.items.push.apply( this.items, items );
        } else if ( index === 0 ) {
-               this.$group.prepend( $items );
+               this.$group.prepend( itemElements );
                this.items.unshift.apply( this.items, items );
        } else {
-               this.$items.eq( index ).before( $items );
+               this.items[index].$element.before( itemElements );
                this.items.splice.apply( this.items, [ index, 0 ].concat( items ) );
        }
 
-       this.$items = this.$items.add( $items );
-
        return this;
 };
 
@@ -2672,7 +2669,6 @@ OO.ui.GroupElement.prototype.removeItems = function ( items ) {
                        item.setElementGroup( null );
                        this.items.splice( index, 1 );
                        item.$element.detach();
-                       this.$items = this.$items.not( item.$element );
                }
        }
 
@@ -2703,10 +2699,8 @@ OO.ui.GroupElement.prototype.clearItems = function () {
                        item.disconnect( this, remove );
                }
                item.setElementGroup( null );
+               item.$element.detach();
        }
-       this.items = [];
-       this.$items.detach();
-       this.$items = this.$( [] );
 
        return this;
 };
@@ -5068,9 +5062,13 @@ OO.ui.StackLayout.prototype.clearItems = function () {
  * @fires set
  */
 OO.ui.StackLayout.prototype.setItem = function ( item ) {
+       var i, len;
+
        if ( item !== this.currentItem ) {
                if ( !this.continuous ) {
-                       this.$items.css( 'display', '' );
+                       for ( i = 0, len = this.items.length; i < len; i++ ) {
+                               this.items[i].$element.css( 'display', '' );
+                       }
                }
                if ( $.inArray( item, this.items ) !== -1 ) {
                        if ( !this.continuous ) {
@@ -8482,7 +8480,7 @@ OO.ui.TextInputMenuWidget.prototype.position = function () {
                // Fix for RTL (for some reason, no need to fix if the frameoffset is set)
                if ( this.$element.css( 'direction' ) === 'rtl' ) {
                        dimensions.right = this.$element.parent().position().left -
-                               dimensions.width - dimensions.left;
+                               $container.width() - dimensions.left;
                        // Erase the value for 'left':
                        delete dimensions.left;
                }
index 46f8741..9e6f976 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (c9b9f8345d)
+ * OOjs UI v0.1.0-pre (098f84f8a0)
  * 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: Thu Jun 05 2014 18:43:23 GMT-0700 (PDT)
+ * Date: Mon Jun 09 2014 14:32:26 GMT-0700 (PDT)
  */
 
 /* Textures */