Update OOjs UI to v0.1.0-pre (49b64bdba7)
authorRoan Kattouw <roan.kattouw@gmail.com>
Mon, 15 Sep 2014 22:18:40 +0000 (15:18 -0700)
committerRoan Kattouw <roan.kattouw@gmail.com>
Mon, 15 Sep 2014 22:18:40 +0000 (15:18 -0700)
New changes:
c82b429 Work around position: fixed; bug in Safari
9e1432e Split out isPending, pushPending, popPending, etc. into PendingElement

Change-Id: Ifd213123adfc9c96de2f16379c8ed3d706c210f8

resources/lib/oojs-ui/images/icons/help-rtl.png [deleted file]
resources/lib/oojs-ui/oojs-ui-apex.css
resources/lib/oojs-ui/oojs-ui-minerva.css
resources/lib/oojs-ui/oojs-ui.js
resources/lib/oojs-ui/oojs-ui.svg.css

diff --git a/resources/lib/oojs-ui/images/icons/help-rtl.png b/resources/lib/oojs-ui/images/icons/help-rtl.png
deleted file mode 100644 (file)
index a5a0a66..0000000
Binary files a/resources/lib/oojs-ui/images/icons/help-rtl.png and /dev/null differ
index c4fbb47..53e46d6 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (073f37e258)
+ * OOjs UI v0.1.0-pre (49b64bdba7)
  * 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-09-15T15:00:24Z
+ * Date: 2014-09-15T22:18:37Z
  */
 /*
  * Blank theme mixins.
   left: 0.25em;
   margin-left: 0;
 }
+.oo-ui-actionWidget.oo-ui-pendingElement-pending {
+  background-image: /* @embed */ url(images/textures/pending.gif);
+}
 .oo-ui-popupWidget-popup {
   position: absolute;
   overflow: hidden;
   -moz-box-sizing: border-box;
   box-sizing: border-box;
 }
+.oo-ui-textInputWidget.oo-ui-pendingElement-pending input,
+.oo-ui-textInputWidget.oo-ui-pendingElement-pending textarea {
+  background-image: /* @embed */ url(images/textures/pending.gif);
+}
 .oo-ui-textInputWidget > .oo-ui-iconElement-icon,
 .oo-ui-textInputWidget > .oo-ui-indicatorElement-indicator {
   position: absolute;
   color: #777;
   text-shadow: 0 1px 1px #fff;
 }
-.oo-ui-textInputWidget-pending input,
-.oo-ui-textInputWidget-pending textarea {
+.oo-ui-textInputWidget.oo-ui-pendingElement-pending input,
+.oo-ui-textInputWidget.oo-ui-pendingElement-pending textarea {
   background-color: transparent;
 }
 .oo-ui-textInputWidget.oo-ui-widget-disabled input,
   z-index: 1;
   top: 0;
 }
+.oo-ui-dialog-content > .oo-ui-window-head.oo-ui-pendingElement-pending {
+  background-image: /* @embed */ url(images/textures/pending.gif);
+}
 .oo-ui-dialog-content > .oo-ui-window-body {
   z-index: 2;
   top: 0;
   padding: 1em;
 }
 .oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-setup > .oo-ui-window-frame {
-  position: fixed;
+  position: absolute;
   right: 0;
   left: 0;
   margin: auto;
index fa8efee..e817142 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (073f37e258)
+ * OOjs UI v0.1.0-pre (49b64bdba7)
  * 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-09-15T15:00:24Z
+ * Date: 2014-09-15T22:18:37Z
  */
 /*
  * Blank theme mixins.
   left: 0.25em;
   margin-left: 0;
 }
+.oo-ui-actionWidget.oo-ui-pendingElement-pending {
+  background-image: /* @embed */ url(images/textures/pending.gif);
+}
 .oo-ui-popupWidget-popup {
   position: absolute;
   overflow: hidden;
   -moz-box-sizing: border-box;
   box-sizing: border-box;
 }
+.oo-ui-textInputWidget.oo-ui-pendingElement-pending input,
+.oo-ui-textInputWidget.oo-ui-pendingElement-pending textarea {
+  background-image: /* @embed */ url(images/textures/pending.gif);
+}
 .oo-ui-textInputWidget > .oo-ui-iconElement-icon,
 .oo-ui-textInputWidget > .oo-ui-indicatorElement-indicator {
   position: absolute;
   z-index: 1;
   top: 0;
 }
+.oo-ui-dialog-content > .oo-ui-window-head.oo-ui-pendingElement-pending {
+  background-image: /* @embed */ url(images/textures/pending.gif);
+}
 .oo-ui-dialog-content > .oo-ui-window-body {
   z-index: 2;
   top: 0;
   padding: 1em;
 }
 .oo-ui-windowManager-modal > .oo-ui-dialog.oo-ui-window-setup > .oo-ui-window-frame {
-  position: fixed;
+  position: absolute;
   right: 0;
   left: 0;
   margin: auto;
index 1583fec..a3e2375 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (073f37e258)
+ * OOjs UI v0.1.0-pre (49b64bdba7)
  * 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-09-15T15:00:24Z
+ * Date: 2014-09-15T22:18:37Z
  */
 ( function ( OO ) {
 
@@ -188,6 +188,88 @@ OO.ui.getLocalValue = function ( obj, lang, fallback ) {
 
 } )();
 
+/**
+ * Element that can be marked as pending.
+ *
+ * @abstract
+ * @class
+ *
+ * @constructor
+ * @param {Object} [config] Configuration options
+ */
+OO.ui.PendingElement = function OoUiPendingElement( config ) {
+       // Config initialisation
+       config = config || {};
+
+       // Properties
+       this.pending = 0;
+       this.$pending = null;
+
+       // Initialisation
+       this.setPendingElement( config.$pending || this.$element );
+};
+
+/* Setup */
+
+OO.initClass( OO.ui.PendingElement );
+
+/* Methods */
+
+/**
+ * Set the pending element (and clean up any existing one).
+ *
+ * @param {jQuery} $pending The element to set to pending.
+ */
+OO.ui.PendingElement.prototype.setPendingElement = function ( $pending ) {
+       if ( this.$pending ) {
+               this.$pending.removeClass( 'oo-ui-pendingElement-pending' );
+       }
+
+       this.$pending = $pending;
+       if ( this.pending > 0 ) {
+               this.$pending.addClass( 'oo-ui-pendingElement-pending' );
+       }
+};
+
+/**
+ * Check if input is pending.
+ *
+ * @return {boolean}
+ */
+OO.ui.PendingElement.prototype.isPending = function () {
+       return !!this.pending;
+};
+
+/**
+ * Increase the pending stack.
+ *
+ * @chainable
+ */
+OO.ui.PendingElement.prototype.pushPending = function () {
+       if ( this.pending === 0 ) {
+               this.$pending.addClass( 'oo-ui-pendingElement-pending' );
+       }
+       this.pending++;
+
+       return this;
+};
+
+/**
+ * Reduce the pending stack.
+ *
+ * Clamped at zero.
+ *
+ * @chainable
+ */
+OO.ui.PendingElement.prototype.popPending = function () {
+       if ( this.pending === 1 ) {
+               this.$pending.removeClass( 'oo-ui-pendingElement-pending' );
+       }
+       this.pending = Math.max( 0, this.pending - 1 );
+
+       return this;
+};
+
 /**
  * List of actions.
  *
@@ -2056,6 +2138,7 @@ OO.ui.Window.prototype.load = function () {
  * @abstract
  * @class
  * @extends OO.ui.Window
+ * @mixins OO.ui.PendingElement
  *
  * @constructor
  * @param {Object} [config] Configuration options
@@ -2064,11 +2147,13 @@ OO.ui.Dialog = function OoUiDialog( config ) {
        // Parent constructor
        OO.ui.Dialog.super.call( this, config );
 
+       // Mixin constructors
+       OO.ui.PendingElement.call( this );
+
        // Properties
        this.actions = new OO.ui.ActionSet();
        this.attachedActions = [];
        this.currentAction = null;
-       this.pending = 0;
 
        // Events
        this.actions.connect( this, {
@@ -2086,6 +2171,7 @@ OO.ui.Dialog = function OoUiDialog( config ) {
 /* Setup */
 
 OO.inheritClass( OO.ui.Dialog, OO.ui.Window );
+OO.mixinClass( OO.ui.Dialog, OO.ui.PendingElement );
 
 /* Static Properties */
 
@@ -2173,15 +2259,6 @@ OO.ui.Dialog.prototype.onActionsChange = function () {
        }
 };
 
-/**
- * Check if input is pending.
- *
- * @return {boolean}
- */
-OO.ui.Dialog.prototype.isPending = function () {
-       return !!this.pending;
-};
-
 /**
  * Get set of actions.
  *
@@ -2272,6 +2349,7 @@ OO.ui.Dialog.prototype.initialize = function () {
 
        // Initialization
        this.$content.addClass( 'oo-ui-dialog-content' );
+       this.setPendingElement( this.$head );
 };
 
 /**
@@ -2309,38 +2387,6 @@ OO.ui.Dialog.prototype.executeAction = function ( action ) {
                .always( OO.ui.bind( this.popPending, this ) );
 };
 
-/**
- * Increase the pending stack.
- *
- * @chainable
- */
-OO.ui.Dialog.prototype.pushPending = function () {
-       if ( this.pending === 0 ) {
-               this.$content.addClass( 'oo-ui-actionDialog-content-pending' );
-               this.$head.addClass( 'oo-ui-texture-pending' );
-       }
-       this.pending++;
-
-       return this;
-};
-
-/**
- * Reduce the pending stack.
- *
- * Clamped at zero.
- *
- * @chainable
- */
-OO.ui.Dialog.prototype.popPending = function () {
-       if ( this.pending === 1 ) {
-               this.$content.removeClass( 'oo-ui-actionDialog-content-pending' );
-               this.$head.removeClass( 'oo-ui-texture-pending' );
-       }
-       this.pending = Math.max( 0, this.pending - 1 );
-
-       return this;
-};
-
 /**
  * Collection of windows.
  *
@@ -8152,6 +8198,7 @@ OO.ui.ButtonWidget.prototype.setTarget = function ( target ) {
  *
  * @class
  * @extends OO.ui.ButtonWidget
+ * @mixins OO.ui.PendingElement
  *
  * @constructor
  * @param {Object} [config] Configuration options
@@ -8165,6 +8212,9 @@ OO.ui.ActionWidget = function OoUiActionWidget( config ) {
        // Parent constructor
        OO.ui.ActionWidget.super.call( this, config );
 
+       // Mixin constructors
+       OO.ui.PendingElement.call( this, config );
+
        // Properties
        this.action = config.action || '';
        this.modes = config.modes || [];
@@ -8178,6 +8228,7 @@ OO.ui.ActionWidget = function OoUiActionWidget( config ) {
 /* Setup */
 
 OO.inheritClass( OO.ui.ActionWidget, OO.ui.ButtonWidget );
+OO.mixinClass( OO.ui.ActionWidget, OO.ui.PendingElement );
 
 /* Events */
 
@@ -8872,6 +8923,7 @@ OO.ui.CheckboxInputWidget.prototype.onEdit = function () {
  * @extends OO.ui.InputWidget
  * @mixins OO.ui.IconElement
  * @mixins OO.ui.IndicatorElement
+ * @mixins OO.ui.PendingElement
  *
  * @constructor
  * @param {Object} [config] Configuration options
@@ -8890,9 +8942,9 @@ OO.ui.TextInputWidget = function OoUiTextInputWidget( config ) {
        // Mixin constructors
        OO.ui.IconElement.call( this, config );
        OO.ui.IndicatorElement.call( this, config );
+       OO.ui.PendingElement.call( this, config );
 
        // Properties
-       this.pending = 0;
        this.multiline = !!config.multiline;
        this.autosize = !!config.autosize;
        this.maxRows = config.maxRows !== undefined ? config.maxRows : 10;
@@ -8918,6 +8970,7 @@ OO.ui.TextInputWidget = function OoUiTextInputWidget( config ) {
 OO.inheritClass( OO.ui.TextInputWidget, OO.ui.InputWidget );
 OO.mixinClass( OO.ui.TextInputWidget, OO.ui.IconElement );
 OO.mixinClass( OO.ui.TextInputWidget, OO.ui.IndicatorElement );
+OO.mixinClass( OO.ui.TextInputWidget, OO.ui.PendingElement );
 
 /* Events */
 
@@ -9080,47 +9133,6 @@ OO.ui.TextInputWidget.prototype.isAutosizing = function () {
        return !!this.autosize;
 };
 
-/**
- * Check if input is pending.
- *
- * @return {boolean}
- */
-OO.ui.TextInputWidget.prototype.isPending = function () {
-       return !!this.pending;
-};
-
-/**
- * Increase the pending stack.
- *
- * @chainable
- */
-OO.ui.TextInputWidget.prototype.pushPending = function () {
-       if ( this.pending === 0 ) {
-               this.$element.addClass( 'oo-ui-textInputWidget-pending' );
-               this.$input.addClass( 'oo-ui-texture-pending' );
-       }
-       this.pending++;
-
-       return this;
-};
-
-/**
- * Reduce the pending stack.
- *
- * Clamped at zero.
- *
- * @chainable
- */
-OO.ui.TextInputWidget.prototype.popPending = function () {
-       if ( this.pending === 1 ) {
-               this.$element.removeClass( 'oo-ui-textInputWidget-pending' );
-               this.$input.removeClass( 'oo-ui-texture-pending' );
-       }
-       this.pending = Math.max( 0, this.pending - 1 );
-
-       return this;
-};
-
 /**
  * Select the contents of the input.
  *
index aca127a..913d5fd 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (073f37e258)
+ * OOjs UI v0.1.0-pre (49b64bdba7)
  * 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-09-15T15:00:24Z
+ * Date: 2014-09-15T22:18:37Z
  */
 /*
  * Blank theme mixins.