/*!
- * 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;
/*!
- * 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;
/*!
- * 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 ) {
} )();
+/**
+ * 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.
*
* @abstract
* @class
* @extends OO.ui.Window
+ * @mixins OO.ui.PendingElement
*
* @constructor
* @param {Object} [config] Configuration options
// 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, {
/* Setup */
OO.inheritClass( OO.ui.Dialog, OO.ui.Window );
+OO.mixinClass( OO.ui.Dialog, OO.ui.PendingElement );
/* Static Properties */
}
};
-/**
- * Check if input is pending.
- *
- * @return {boolean}
- */
-OO.ui.Dialog.prototype.isPending = function () {
- return !!this.pending;
-};
-
/**
* Get set of actions.
*
// Initialization
this.$content.addClass( 'oo-ui-dialog-content' );
+ this.setPendingElement( this.$head );
};
/**
.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.
*
*
* @class
* @extends OO.ui.ButtonWidget
+ * @mixins OO.ui.PendingElement
*
* @constructor
* @param {Object} [config] Configuration options
// 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 || [];
/* Setup */
OO.inheritClass( OO.ui.ActionWidget, OO.ui.ButtonWidget );
+OO.mixinClass( OO.ui.ActionWidget, OO.ui.PendingElement );
/* Events */
* @extends OO.ui.InputWidget
* @mixins OO.ui.IconElement
* @mixins OO.ui.IndicatorElement
+ * @mixins OO.ui.PendingElement
*
* @constructor
* @param {Object} [config] Configuration options
// 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;
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 */
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.
*