From 914ac132261307c3f71eaa48d5685c3341c124e7 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Mon, 9 Jun 2014 14:32:31 -0700 Subject: [PATCH] Update OOjs UI to v0.1.0-pre (098f84f8a0) 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 | 9 ++++++-- resources/lib/oojs-ui/oojs-ui.js | 30 +++++++++++++-------------- resources/lib/oojs-ui/oojs-ui.svg.css | 4 ++-- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/resources/lib/oojs-ui/i18n/be.json b/resources/lib/oojs-ui/i18n/be.json index 0ef682974b..08fbe0b491 100644 --- a/resources/lib/oojs-ui/i18n/be.json +++ b/resources/lib/oojs-ui/i18n/be.json @@ -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": "Адмяніць" } diff --git a/resources/lib/oojs-ui/oojs-ui.js b/resources/lib/oojs-ui/oojs-ui.js index 0ed95a282c..092af64a00 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 (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; } diff --git a/resources/lib/oojs-ui/oojs-ui.svg.css b/resources/lib/oojs-ui/oojs-ui.svg.css index 46f8741d59..9e6f9769f4 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 (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 */ -- 2.20.1