Update OOjs UI to v0.1.0-pre (d4baf57069)
authorJames D. Forrester <jforrester@wikimedia.org>
Mon, 21 Apr 2014 19:42:09 +0000 (12:42 -0700)
committerJames D. Forrester <jforrester@wikimedia.org>
Mon, 21 Apr 2014 19:42:09 +0000 (12:42 -0700)
New changes:
351db20 Localisation updates from https://translatewiki.net.
1a21253 Set up jsduck
d492a0f Revert "Add aggregate method"

Change-Id: Ida003c21a1f748f78ac0b36511d86e9dd3f8da58

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

index 105d806..09415fd 100644 (file)
@@ -12,6 +12,6 @@
        "ooui-dialog-action-close": "Racnê",
        "ooui-outline-control-move-down": "Bendi bere cêr",
        "ooui-outline-control-move-up": "Bendi bere cor",
-       "ooui-outline-control-remove": "Obji hewad",
+       "ooui-outline-control-remove": "Obcey wedare",
        "ooui-toolbar-more": "Zewbi"
 }
index cd8c9f2..403b200 100644 (file)
@@ -18,6 +18,6 @@
        "ooui-dialog-action-close": "סגירה",
        "ooui-outline-control-move-down": "להזיז את הפריט מטה",
        "ooui-outline-control-move-up": "להזיז את הפריט מעלה",
-       "ooui-outline-control-remove": "×\94סרת פריט",
+       "ooui-outline-control-remove": "×\9c×\94ס×\99ר ×\90ת ×\94פריט",
        "ooui-toolbar-more": "עוד"
 }
index 3257604..47a9a93 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (989950a4db)
+ * OOjs UI v0.1.0-pre (d4baf57069)
  * 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: Fri Apr 18 2014 13:02:46 GMT-0700 (PDT)
+ * Date: Mon Apr 21 2014 12:42:04 GMT-0700 (PDT)
  */
 ( function ( OO ) {
 
@@ -556,8 +556,6 @@ OO.ui.Element.prototype.getElementWindow = function () {
 
 /**
  * Get closest scrollable container.
- *
- * @see #static-method-getClosestScrollableContainer
  */
 OO.ui.Element.prototype.getClosestScrollableElementContainer = function () {
        return OO.ui.Element.getClosestScrollableContainer( this.$element[0] );
@@ -586,7 +584,6 @@ OO.ui.Element.prototype.setElementGroup = function ( group ) {
 /**
  * Scroll element into view.
  *
- * @see #static-method-scrollIntoView
  * @param {Object} [config={}]
  */
 OO.ui.Element.prototype.scrollElementIntoView = function ( config ) {
@@ -595,7 +592,7 @@ OO.ui.Element.prototype.scrollElementIntoView = function ( config ) {
 
 /**
  * Bind a handler for an event on this.$element
- * @see #static-method-onDOMEvent
+ *
  * @param {string} event
  * @param {Function} callback
  */
@@ -605,7 +602,7 @@ OO.ui.Element.prototype.onDOMEvent = function ( event, callback ) {
 
 /**
  * Unbind a handler bound with #offDOMEvent
- * @see #static-method-offDOMEvent
+ *
  * @param {string} event
  * @param {Function} callback
  */
@@ -2192,6 +2189,7 @@ OO.ui.FlaggableElement.prototype.setFlags = function ( flags ) {
  * @constructor
  * @param {jQuery} $group Container node, assigned to #$group
  * @param {Object} [config] Configuration options
+ * @cfg {Object.<string,string>} [aggregations] Events to aggregate, keyed by item event name
  */
 OO.ui.GroupElement = function OoUiGroupElement( $group, config ) {
        // Configuration
@@ -2201,7 +2199,8 @@ OO.ui.GroupElement = function OoUiGroupElement( $group, config ) {
        this.$group = $group;
        this.items = [];
        this.$items = this.$( [] );
-       this.aggregateItemEvents = {};
+       this.aggregate = !$.isEmptyObject( config.aggregations );
+       this.aggregations = config.aggregations || {};
 };
 
 /* Methods */
@@ -2215,54 +2214,6 @@ OO.ui.GroupElement.prototype.getItems = function () {
        return this.items.slice( 0 );
 };
 
-/**
- * Add an aggregate item event.
- *
- * Aggregated events are listened to on each item and then emitted by the group under a new name,
- * and with an additional leading parameter containing the item that emitted the original event.
- * Other arguments that were emitted from the original event are passed through.
- *
- * @param {Object.<string,string|null>} events Aggregate events emitted by group, keyed by item
- *   event, use null value to remove aggregation
- * @throws {Error} If aggregation already exists
- */
-OO.ui.GroupElement.prototype.aggregate = function ( events ) {
-       var i, len, item, add, remove, itemEvent, groupEvent;
-
-       for ( itemEvent in events ) {
-               groupEvent = events[itemEvent];
-
-               // Remove existing aggregated event
-               if ( itemEvent in this.aggregateItemEvents ) {
-                       // Don't allow duplicate aggregations
-                       if ( groupEvent ) {
-                               throw new Error( 'Duplicate item event aggregation for ' + itemEvent );
-                       }
-                       // Remove event aggregation from existing items
-                       remove = {};
-                       remove[itemEvent] = this.aggregateItemEvents[itemEvent];
-                       for ( i = 0, len = this.items.length; i < len; i++ ) {
-                               this.items[i].disconnect( this, remove );
-                       }
-                       // Prevent future items from aggregating event
-                       delete this.aggregateItemEvents[itemEvent];
-               }
-
-               // Add new aggregate event
-               if ( groupEvent ) {
-                       // Make future items aggregate event
-                       this.aggregateItemEvents[itemEvent] = groupEvent;
-                       // Add event aggregation to existing items
-                       for ( i = 0, len = this.items.length; i < len; i++ ) {
-                               item = this.items[i];
-                               add = {};
-                               add[itemEvent] = [ 'emit', groupEvent, item ];
-                               item.connect( this, add );
-                       }
-               }
-       }
-};
-
 /**
  * Add items.
  *
@@ -2287,10 +2238,10 @@ OO.ui.GroupElement.prototype.addItems = function ( items, index ) {
                        }
                }
                // Add the item
-               if ( !$.isEmptyObject( this.aggregateItemEvents ) ) {
+               if ( this.aggregate ) {
                        events = {};
-                       for ( event in this.aggregateItemEvents ) {
-                               events[event] = [ 'emit', this.aggregateItemEvents[event], item ];
+                       for ( event in this.aggregations ) {
+                               events[event] = [ 'emit', this.aggregations[event], item ];
                        }
                        item.connect( this, events );
                }
@@ -2330,7 +2281,7 @@ OO.ui.GroupElement.prototype.removeItems = function ( items ) {
                item = items[i];
                index = $.inArray( item, this.items );
                if ( index !== -1 ) {
-                       if ( !$.isEmptyObject( this.aggregateItemEvents ) ) {
+                       if ( this.aggregate ) {
                                item.disconnect( this );
                        }
                        item.setElementGroup( null );
@@ -2356,7 +2307,7 @@ OO.ui.GroupElement.prototype.clearItems = function () {
        // Remove all items
        for ( i = 0, len = this.items.length; i < len; i++ ) {
                item = this.items[i];
-               if ( !$.isEmptyObject( this.aggregateItemEvents ) ) {
+               if ( this.aggregate ) {
                        item.disconnect( this );
                }
                item.setElementGroup( null );
index a79c4a1..ed564be 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (989950a4db)
+ * OOjs UI v0.1.0-pre (d4baf57069)
  * 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: Fri Apr 18 2014 13:02:46 GMT-0700 (PDT)
+ * Date: Mon Apr 21 2014 12:42:04 GMT-0700 (PDT)
  */
 
 /* Textures */