From: James D. Forrester Date: Tue, 9 Feb 2016 21:34:30 +0000 (-0800) Subject: Update OOjs UI to v0.15.3 X-Git-Tag: 1.31.0-rc.0~8039 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=2ea954babd907b85199639d7c0f47c032edeb557;p=lhc%2Fweb%2Fwiklou.git Update OOjs UI to v0.15.3 Release notes: https://git.wikimedia.org/blob/oojs%2Fui.git/v0.15.3/History.md Change-Id: Ic93f6620999bf10fcfdf4ef2d2a42cc9c7dfd98a --- diff --git a/composer.json b/composer.json index f326dcb4d5..d319171720 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "ext-iconv": "*", "liuggio/statsd-php-client": "1.0.18", "mediawiki/at-ease": "1.1.0", - "oojs/oojs-ui": "0.15.2", + "oojs/oojs-ui": "0.15.3", "oyejorge/less.php": "1.7.0.10", "php": ">=5.3.3", "psr/log": "1.0.0", diff --git a/resources/lib/oojs-ui/i18n/eo.json b/resources/lib/oojs-ui/i18n/eo.json index e78956506f..ff2a2b3189 100644 --- a/resources/lib/oojs-ui/i18n/eo.json +++ b/resources/lib/oojs-ui/i18n/eo.json @@ -5,7 +5,8 @@ "KuboF", "Shirayuki", "Yekrats", - "Kvardek du" + "Kvardek du", + "Psychoslave" ] }, "ooui-outline-control-move-down": "Movi eron suben", @@ -22,5 +23,6 @@ "ooui-dialog-process-continue": "Daŭrigi", "ooui-selectfile-button-select": "Elekti dosieron", "ooui-selectfile-not-supported": "Dosieroselekto ne estas subtenata.", - "ooui-selectfile-placeholder": "Vi ne selektis dosieron" + "ooui-selectfile-placeholder": "Vi ne selektis dosieron", + "ooui-selectfile-dragdrop-placeholder": "Ĵetu dosieron ĉi tie." } diff --git a/resources/lib/oojs-ui/i18n/om.json b/resources/lib/oojs-ui/i18n/om.json index a61083b323..31344be74d 100644 --- a/resources/lib/oojs-ui/i18n/om.json +++ b/resources/lib/oojs-ui/i18n/om.json @@ -17,6 +17,8 @@ "ooui-dialog-process-dismiss": "Didi", "ooui-dialog-process-retry": "Itti deebi'ii yaali", "ooui-dialog-process-continue": "Itti fufi", + "ooui-selectfile-button-select": "Faayilii filadhu", "ooui-selectfile-not-supported": "Faayilii filachuun hin danda'amu.", - "ooui-selectfile-placeholder": "Faayiliin wayiiyyuu hin filatamne" + "ooui-selectfile-placeholder": "Faayiliin wayiiyyuu hin filatamne", + "ooui-selectfile-dragdrop-placeholder": "Faayilii as kaa'i" } diff --git a/resources/lib/oojs-ui/i18n/sd.json b/resources/lib/oojs-ui/i18n/sd.json index 12c77e0310..dc14339c38 100644 --- a/resources/lib/oojs-ui/i18n/sd.json +++ b/resources/lib/oojs-ui/i18n/sd.json @@ -17,6 +17,7 @@ "ooui-dialog-process-retry": "ٻيهر ڪوشش ڪريو", "ooui-dialog-process-continue": "جاري رکو", "ooui-selectfile-button-select": "ڪو فائيل چونڊِو", + "ooui-selectfile-not-supported": "فائيل جي چونڊ سپورٽ نٿي ڪئي وڃي", "ooui-selectfile-placeholder": "ڪوبه فائيل چونڊيو نه ويو آهي", "ooui-selectfile-dragdrop-placeholder": "فائيل کي هتي ڪيرايو" } diff --git a/resources/lib/oojs-ui/i18n/sr-el.json b/resources/lib/oojs-ui/i18n/sr-el.json index 704a1860ce..bdf6a64a72 100644 --- a/resources/lib/oojs-ui/i18n/sr-el.json +++ b/resources/lib/oojs-ui/i18n/sr-el.json @@ -15,5 +15,7 @@ "ooui-dialog-process-error": "Nešto je pošlo naopako", "ooui-dialog-process-dismiss": "Odbaci", "ooui-dialog-process-retry": "Pokušaj ponovo", - "ooui-dialog-process-continue": "Nastavi" + "ooui-dialog-process-continue": "Nastavi", + "ooui-selectfile-button-select": "Izaberi datoteku", + "ooui-selectfile-placeholder": "Nije izabrana nijedna datoteka" } diff --git a/resources/lib/oojs-ui/oojs-ui-apex.js b/resources/lib/oojs-ui/oojs-ui-apex.js index 83ffbd7538..36378186e4 100644 --- a/resources/lib/oojs-ui/oojs-ui-apex.js +++ b/resources/lib/oojs-ui/oojs-ui-apex.js @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:00Z + * Date: 2016-02-09T21:21:16Z */ ( function ( OO ) { diff --git a/resources/lib/oojs-ui/oojs-ui-core-apex.css b/resources/lib/oojs-ui/oojs-ui-core-apex.css index 168ab71e3f..734ff71497 100644 --- a/resources/lib/oojs-ui/oojs-ui-core-apex.css +++ b/resources/lib/oojs-ui/oojs-ui-core-apex.css @@ -1,53 +1,13 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:06Z + * Date: 2016-02-09T21:21:21Z */ -@-webkit-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-moz-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-ms-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-o-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} .oo-ui-element-hidden { display: none !important; } diff --git a/resources/lib/oojs-ui/oojs-ui-core-mediawiki.css b/resources/lib/oojs-ui/oojs-ui-core-mediawiki.css index fe0d45b1c7..51abc2d88a 100644 --- a/resources/lib/oojs-ui/oojs-ui-core-mediawiki.css +++ b/resources/lib/oojs-ui/oojs-ui-core-mediawiki.css @@ -1,37 +1,13 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:06Z + * Date: 2016-02-09T21:21:21Z */ -@-webkit-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-moz-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} .oo-ui-element-hidden { display: none !important; } @@ -213,7 +189,7 @@ left: 0.2em; } .oo-ui-buttonElement-framed.oo-ui-widget-disabled > .oo-ui-buttonElement-button { - background: #dddddd; + background-color: #dddddd; color: #ffffff; border: 1px solid #dddddd; } diff --git a/resources/lib/oojs-ui/oojs-ui-core.js b/resources/lib/oojs-ui/oojs-ui-core.js index 2d5ed3ad09..5a4322806a 100644 --- a/resources/lib/oojs-ui/oojs-ui-core.js +++ b/resources/lib/oojs-ui/oojs-ui-core.js @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:00Z + * Date: 2016-02-09T21:21:16Z */ ( function ( OO ) { @@ -586,7 +586,7 @@ OO.ui.Element.static.infuse = function ( idOrNode ) { */ OO.ui.Element.static.unsafeInfuse = function ( idOrNode, domPromise ) { // look for a cached result of a previous infusion. - var id, $elem, data, cls, parts, parent, obj, top, state; + var id, $elem, data, cls, parts, parent, obj, top, state, infusedChildren; if ( typeof idOrNode === 'string' ) { id = idOrNode; $elem = $( document.getElementById( id ) ); @@ -597,12 +597,28 @@ OO.ui.Element.static.unsafeInfuse = function ( idOrNode, domPromise ) { if ( !$elem.length ) { throw new Error( 'Widget not found: ' + id ); } - data = $elem.data( 'ooui-infused' ) || $elem[ 0 ].oouiInfused; + if ( $elem[ 0 ].oouiInfused ) { + $elem = $elem[ 0 ].oouiInfused; + } + data = $elem.data( 'ooui-infused' ); if ( data ) { // cached! if ( data === true ) { throw new Error( 'Circular dependency! ' + id ); } + if ( domPromise ) { + // pick up dynamic state, like focus, value of form inputs, scroll position, etc. + state = data.gatherPreInfuseState( $elem ); + // restore dynamic state after the new element is re-inserted into DOM under infused parent + domPromise.done( data.restorePreInfuseState.bind( data, state ) ); + infusedChildren = $elem.data( 'ooui-infused-children' ); + if ( infusedChildren && infusedChildren.length ) { + infusedChildren.forEach( function ( data ) { + var state = data.gatherPreInfuseState( $elem ); + domPromise.done( data.restorePreInfuseState.bind( data, state ) ); + } ); + } + } return data; } data = $elem.attr( 'data-ooui' ); @@ -654,10 +670,17 @@ OO.ui.Element.static.unsafeInfuse = function ( idOrNode, domPromise ) { } $elem.data( 'ooui-infused', true ); // prevent loops data.id = id; // implicit + infusedChildren = []; data = OO.copy( data, null, function deserialize( value ) { + var infused; if ( OO.isPlainObject( value ) ) { if ( value.tag ) { - return OO.ui.Element.static.unsafeInfuse( value.tag, domPromise ); + infused = OO.ui.Element.static.unsafeInfuse( value.tag, domPromise ); + infusedChildren.push( infused ); + // Flatten the structure + infusedChildren.push.apply( infusedChildren, infused.$element.data( 'ooui-infused-children' ) || [] ); + infused.$element.removeData( 'ooui-infused-children' ); + return infused; } if ( value.html ) { return new OO.ui.HtmlSnippet( value.html ); @@ -681,11 +704,12 @@ OO.ui.Element.static.unsafeInfuse = function ( idOrNode, domPromise ) { // This element is now gone from the DOM, but if anyone is holding a reference to it, // let's allow them to OO.ui.infuse() it and do what they expect (T105828). // Do not use jQuery.data(), as using it on detached nodes leaks memory in 1.x line by design. - $elem[ 0 ].oouiInfused = obj; + $elem[ 0 ].oouiInfused = obj.$element; } top.resolve(); } obj.$element.data( 'ooui-infused', obj ); + obj.$element.data( 'ooui-infused-children', infusedChildren ); // set the 'data-ooui' attribute so we can identify infused widgets obj.$element.attr( 'data-ooui', '' ); // restore dynamic state after the new element is inserted into DOM @@ -1084,7 +1108,7 @@ OO.ui.Element.static.scrollIntoView = function ( el, config ) { } } if ( !$.isEmptyObject( anim ) ) { - $sc.stop( true ).animate( anim, config.duration || 'fast' ); + $sc.stop( true ).animate( anim, config.duration === undefined ? 'fast' : config.duration ); if ( callback ) { $sc.queue( function ( next ) { callback(); @@ -1808,7 +1832,7 @@ OO.ui.mixin.ButtonElement.prototype.onMouseDown = function ( e ) { * Handles mouse up events. * * @protected - * @param {jQuery.Event} e Mouse up event + * @param {MouseEvent} e Mouse up event */ OO.ui.mixin.ButtonElement.prototype.onMouseUp = function ( e ) { if ( this.isDisabled() || e.which !== OO.ui.MouseButtons.LEFT ) { @@ -1854,7 +1878,7 @@ OO.ui.mixin.ButtonElement.prototype.onKeyDown = function ( e ) { * Handles key up events. * * @protected - * @param {jQuery.Event} e Key up event + * @param {KeyboardEvent} e Key up event */ OO.ui.mixin.ButtonElement.prototype.onKeyUp = function ( e ) { if ( this.isDisabled() || ( e.which !== OO.ui.Keys.SPACE && e.which !== OO.ui.Keys.ENTER ) ) { @@ -4967,7 +4991,7 @@ OO.ui.SelectWidget.prototype.onMouseDown = function ( e ) { * Handle mouse up events. * * @private - * @param {jQuery.Event} e Mouse up event + * @param {MouseEvent} e Mouse up event */ OO.ui.SelectWidget.prototype.onMouseUp = function ( e ) { var item; @@ -4995,7 +5019,7 @@ OO.ui.SelectWidget.prototype.onMouseUp = function ( e ) { * Handle mouse move events. * * @private - * @param {jQuery.Event} e Mouse move event + * @param {MouseEvent} e Mouse move event */ OO.ui.SelectWidget.prototype.onMouseMove = function ( e ) { var item; @@ -5007,7 +5031,6 @@ OO.ui.SelectWidget.prototype.onMouseMove = function ( e ) { this.selecting = item; } } - return false; }; /** @@ -5043,7 +5066,7 @@ OO.ui.SelectWidget.prototype.onMouseLeave = function () { * Handle key down events. * * @protected - * @param {jQuery.Event} e Key down event + * @param {KeyboardEvent} e Key down event */ OO.ui.SelectWidget.prototype.onKeyDown = function ( e ) { var nextItem, @@ -5093,7 +5116,6 @@ OO.ui.SelectWidget.prototype.onKeyDown = function ( e ) { } if ( handled ) { - // Can't just return false, because e is not always a jQuery event e.preventDefault(); e.stopPropagation(); } @@ -5135,7 +5157,7 @@ OO.ui.SelectWidget.prototype.clearKeyPressBuffer = function () { * Handle key press events. * * @protected - * @param {jQuery.Event} e Key press event + * @param {KeyboardEvent} e Key press event */ OO.ui.SelectWidget.prototype.onKeyPress = function ( e ) { var c, filter, item; @@ -5183,7 +5205,8 @@ OO.ui.SelectWidget.prototype.onKeyPress = function ( e ) { item.scrollElementIntoView(); } - return false; + e.preventDefault(); + e.stopPropagation(); }; /** @@ -5846,7 +5869,7 @@ OO.mixinClass( OO.ui.MenuSelectWidget, OO.ui.mixin.ClippableElement ); * Handles document mouse down events. * * @protected - * @param {jQuery.Event} e Key down event + * @param {MouseEvent} e Mouse down event */ OO.ui.MenuSelectWidget.prototype.onDocumentMouseDown = function ( e ) { if ( @@ -6058,6 +6081,10 @@ OO.ui.MenuSelectWidget.prototype.toggle = function ( visible ) { } this.toggleClipping( true ); + if ( this.getSelectedItem() ) { + this.getSelectedItem().scrollElementIntoView( { duration: 0 } ); + } + // Auto-hide if ( this.autoHide ) { this.getElementDocument().addEventListener( 'mousedown', this.onDocumentMouseDownHandler, true ); @@ -6155,7 +6182,7 @@ OO.ui.DropdownWidget = function OoUiDropdownWidget( config ) { // Events this.$handle.on( { click: this.onClick.bind( this ), - keypress: this.onKeyPress.bind( this ) + keydown: this.onKeyDown.bind( this ) } ); this.menu.connect( this, { select: 'onMenuSelect' } ); @@ -6227,14 +6254,25 @@ OO.ui.DropdownWidget.prototype.onClick = function ( e ) { }; /** - * Handle key press events. + * Handle key down events. * * @private - * @param {jQuery.Event} e Key press event + * @param {jQuery.Event} e Key down event */ -OO.ui.DropdownWidget.prototype.onKeyPress = function ( e ) { - if ( !this.isDisabled() && - ( ( e.which === OO.ui.Keys.SPACE && !this.menu.isVisible() ) || e.which === OO.ui.Keys.ENTER ) +OO.ui.DropdownWidget.prototype.onKeyDown = function ( e ) { + if ( + !this.isDisabled() && + ( + e.which === OO.ui.Keys.ENTER || + ( + !this.menu.isVisible() && + ( + e.which === OO.ui.Keys.SPACE || + e.which === OO.ui.Keys.UP || + e.which === OO.ui.Keys.DOWN + ) + ) + ) ) { this.menu.toggle(); return false; @@ -6684,7 +6722,6 @@ OO.ui.InputWidget = function OoUiInputWidget( config ) { .addClass( 'oo-ui-inputWidget' ) .append( this.$input ); this.setValue( config.value ); - this.setAccessKey( config.accessKey ); if ( config.dir ) { this.setDir( config.dir ); } @@ -6827,30 +6864,6 @@ OO.ui.InputWidget.prototype.setValue = function ( value ) { return this; }; -/** - * Set the input's access key. - * FIXME: This is the same code as in OO.ui.mixin.ButtonElement, maybe find a better place for it? - * - * @param {string} accessKey Input's access key, use empty string to remove - * @chainable - */ -OO.ui.InputWidget.prototype.setAccessKey = function ( accessKey ) { - accessKey = typeof accessKey === 'string' && accessKey.length ? accessKey : null; - - if ( this.accessKey !== accessKey ) { - if ( this.$input ) { - if ( accessKey !== null ) { - this.$input.attr( 'accesskey', accessKey ); - } else { - this.$input.removeAttr( 'accesskey' ); - } - } - this.accessKey = accessKey; - } - - return this; -}; - /** * Clean up incoming value. * diff --git a/resources/lib/oojs-ui/oojs-ui-mediawiki.js b/resources/lib/oojs-ui/oojs-ui-mediawiki.js index e20b956fae..27a4657563 100644 --- a/resources/lib/oojs-ui/oojs-ui-mediawiki.js +++ b/resources/lib/oojs-ui/oojs-ui-mediawiki.js @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:00Z + * Date: 2016-02-09T21:21:16Z */ ( function ( OO ) { diff --git a/resources/lib/oojs-ui/oojs-ui-toolbars-apex.css b/resources/lib/oojs-ui/oojs-ui-toolbars-apex.css index f433b15926..0021721bdd 100644 --- a/resources/lib/oojs-ui/oojs-ui-toolbars-apex.css +++ b/resources/lib/oojs-ui/oojs-ui-toolbars-apex.css @@ -1,53 +1,13 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:06Z + * Date: 2016-02-09T21:21:21Z */ -@-webkit-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-moz-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-ms-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-o-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} .oo-ui-popupTool .oo-ui-popupWidget-popup, .oo-ui-popupTool .oo-ui-popupWidget-anchor { z-index: 4; diff --git a/resources/lib/oojs-ui/oojs-ui-toolbars-mediawiki.css b/resources/lib/oojs-ui/oojs-ui-toolbars-mediawiki.css index 1f4262c601..7b1e5b75c2 100644 --- a/resources/lib/oojs-ui/oojs-ui-toolbars-mediawiki.css +++ b/resources/lib/oojs-ui/oojs-ui-toolbars-mediawiki.css @@ -1,37 +1,13 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:06Z + * Date: 2016-02-09T21:21:21Z */ -@-webkit-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-moz-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} .oo-ui-popupTool .oo-ui-popupWidget-popup, .oo-ui-popupTool .oo-ui-popupWidget-anchor { z-index: 4; diff --git a/resources/lib/oojs-ui/oojs-ui-toolbars.js b/resources/lib/oojs-ui/oojs-ui-toolbars.js index a88984a5c9..1d1ed87abd 100644 --- a/resources/lib/oojs-ui/oojs-ui-toolbars.js +++ b/resources/lib/oojs-ui/oojs-ui-toolbars.js @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:00Z + * Date: 2016-02-09T21:21:16Z */ ( function ( OO ) { @@ -1030,7 +1030,7 @@ OO.ui.ToolGroup.prototype.onMouseKeyDown = function ( e ) { * Handle captured mouse up and key up events. * * @protected - * @param {Event} e Mouse up or key up event + * @param {MouseEvent|KeyboardEvent} e Mouse up or key up event */ OO.ui.ToolGroup.prototype.onCapturedMouseKeyUp = function ( e ) { this.getElementDocument().removeEventListener( 'mouseup', this.onCapturedMouseKeyUpHandler, true ); @@ -1044,7 +1044,7 @@ OO.ui.ToolGroup.prototype.onCapturedMouseKeyUp = function ( e ) { * Handle mouse up and key up events. * * @protected - * @param {jQuery.Event} e Mouse up or key up event + * @param {MouseEvent|KeyboardEvent} e Mouse up or key up event */ OO.ui.ToolGroup.prototype.onMouseKeyUp = function ( e ) { var tool = this.getTargetTool( e ); @@ -1055,7 +1055,8 @@ OO.ui.ToolGroup.prototype.onMouseKeyUp = function ( e ) { ) { this.pressed.onSelect(); this.pressed = null; - return false; + e.preventDefault(); + e.stopPropagation(); } this.pressed = null; @@ -1831,7 +1832,7 @@ OO.ui.PopupToolGroup.prototype.setDisabled = function () { * The event is actually generated from a mouseup/keyup, so it is not a normal blur event object. * * @protected - * @param {jQuery.Event} e Mouse up or key up event + * @param {MouseEvent|KeyboardEvent} e Mouse up or key up event */ OO.ui.PopupToolGroup.prototype.onBlur = function ( e ) { // Only deactivate when clicking outside the dropdown element diff --git a/resources/lib/oojs-ui/oojs-ui-widgets-apex.css b/resources/lib/oojs-ui/oojs-ui-widgets-apex.css index 252e402d4e..071e33bbba 100644 --- a/resources/lib/oojs-ui/oojs-ui-widgets-apex.css +++ b/resources/lib/oojs-ui/oojs-ui-widgets-apex.css @@ -1,53 +1,13 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:06Z + * Date: 2016-02-09T21:21:21Z */ -@-webkit-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-moz-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-ms-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-o-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} .oo-ui-draggableElement { cursor: -webkit-grab -moz-grab, url(images/grab.cur), move; } @@ -391,6 +351,30 @@ .oo-ui-progressBarWidget.oo-ui-widget-disabled { opacity: 0.6; } +@-webkit-keyframes oo-ui-progressBarWidget-slide { + from { + margin-left: -40%; + } + to { + margin-left: 100%; + } +} +@-moz-keyframes oo-ui-progressBarWidget-slide { + from { + margin-left: -40%; + } + to { + margin-left: 100%; + } +} +@keyframes oo-ui-progressBarWidget-slide { + from { + margin-left: -40%; + } + to { + margin-left: 100%; + } +} .oo-ui-selectFileWidget { display: inline-block; vertical-align: middle; @@ -457,9 +441,74 @@ } .oo-ui-selectFileWidget-dropTarget { cursor: default; + height: 5.5em; + text-align: left; + padding: 0; } -.oo-ui-selectFileWidget-supported.oo-ui-widget-enabled .oo-ui-selectFileWidget-dropTarget { - cursor: pointer; +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-dropLabel, +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-selectButton { + display: none; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-thumbnail { + height: 5.5em; + width: 5.5em; + position: absolute; + background-size: cover; + background-position: center center; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-thumbnail.oo-ui-pendingElement-pending { + background-size: auto; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-thumbnail > .oo-ui-selectFileWidget-noThumbnail-icon { + opacity: 0.4; + background-color: #cccccc; + height: 5.5em; + width: 5.5em; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info { + border: none; + background: none; + display: block; + height: 100%; + width: auto; + margin-left: 5.5em; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info > .oo-ui-selectFileWidget-label { + position: relative; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info > .oo-ui-selectFileWidget-label > .oo-ui-selectFileWidget-fileName { + display: block; + float: none; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info > .oo-ui-selectFileWidget-label > .oo-ui-selectFileWidget-fileType { + display: block; + float: none; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info > .oo-ui-selectFileWidget-clearButton { + position: absolute; + right: 0.5em; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget { + text-align: center; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-dropLabel { + display: block; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-thumbnail, +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info { + display: none; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-selectButton { + display: block; + margin: 0.7em; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget, +.oo-ui-selectFileWidget-notsupported .oo-ui-selectFileWidget-dropTarget { + text-align: center; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info, +.oo-ui-selectFileWidget-notsupported .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info { + margin: 0; } .oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-clearButton, .oo-ui-selectFileWidget-notsupported .oo-ui-selectFileWidget-clearButton { @@ -554,26 +603,26 @@ .oo-ui-selectFileWidget-notsupported.oo-ui-indicatorElement .oo-ui-selectFileWidget-info .oo-ui-selectFileWidget-label { right: 2em; } -.oo-ui-selectFileWidget-dropTarget { - line-height: 3.5em; - background-color: #ffffff; - border: 1px dashed #aaaaaa; - padding: 0.5em 1em; - margin-bottom: 0.5em; - text-align: center; - vertical-align: middle; -} -.oo-ui-selectFileWidget-supported.oo-ui-widget-enabled .oo-ui-selectFileWidget-dropTarget:hover, -.oo-ui-selectFileWidget-supported.oo-ui-widget-enabled.oo-ui-selectFileWidget-canDrop oo-ui-selectfilewidget-droptarget { +.oo-ui-selectFileWidget-supported.oo-ui-widget-enabled.oo-ui-selectFileWidget-canDrop .oo-ui-selectFileWidget-dropTarget { background-color: #e1f3ff; } -.oo-ui-selectFileWidget.oo-ui-widget-disabled .oo-ui-selectFileWidget-dropTarget, +.oo-ui-selectFileWidget-empty.oo-ui-widget-disabled .oo-ui-selectFileWidget-dropTarget, .oo-ui-selectFileWidget-notsupported .oo-ui-selectFileWidget-dropTarget { color: #cccccc; text-shadow: 0 1px 1px #ffffff; border-color: #dddddd; background-color: #f3f3f3; } +.oo-ui-selectFileWidget-dropTarget { + background-color: #ffffff; + border: 1px solid #aaaaaa; + margin-bottom: 0.5em; + vertical-align: middle; + border-radius: 0.25em; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget { + border-style: dashed; +} .oo-ui-outlineOptionWidget { position: relative; cursor: pointer; @@ -826,17 +875,19 @@ color: #555555; border-radius: 0.25em; } -.oo-ui-capsuleItemWidget > .oo-ui-iconElement-icon { - cursor: pointer; -} -.oo-ui-capsuleItemWidget.oo-ui-widget-disabled > .oo-ui-iconElement-icon { - cursor: default; -} .oo-ui-capsuleItemWidget.oo-ui-labelElement .oo-ui-labelElement-label { - display: block; + display: inline-block; text-overflow: ellipsis; overflow: hidden; } +.oo-ui-capsuleItemWidget .oo-ui-buttonElement { + margin-top: -1.6em; + padding-left: 0.3em; +} +.oo-ui-capsuleItemWidget:focus { + outline: none; + border-color: #087ecc; +} .oo-ui-capsuleItemWidget.oo-ui-indicatorElement > .oo-ui-labelElement-label { padding-right: 1.3375em; } diff --git a/resources/lib/oojs-ui/oojs-ui-widgets-mediawiki.css b/resources/lib/oojs-ui/oojs-ui-widgets-mediawiki.css index d5f829872b..8475dd18a9 100644 --- a/resources/lib/oojs-ui/oojs-ui-widgets-mediawiki.css +++ b/resources/lib/oojs-ui/oojs-ui-widgets-mediawiki.css @@ -1,37 +1,13 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:06Z + * Date: 2016-02-09T21:21:21Z */ -@-webkit-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-moz-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} .oo-ui-draggableElement { cursor: -webkit-grab -moz-grab, url(images/grab.cur), move; } @@ -395,6 +371,30 @@ .oo-ui-progressBarWidget.oo-ui-widget-disabled { opacity: 0.6; } +@-webkit-keyframes oo-ui-progressBarWidget-slide { + from { + margin-left: -40%; + } + to { + margin-left: 100%; + } +} +@-moz-keyframes oo-ui-progressBarWidget-slide { + from { + margin-left: -40%; + } + to { + margin-left: 100%; + } +} +@keyframes oo-ui-progressBarWidget-slide { + from { + margin-left: -40%; + } + to { + margin-left: 100%; + } +} .oo-ui-selectFileWidget { display: inline-block; vertical-align: middle; @@ -461,9 +461,74 @@ } .oo-ui-selectFileWidget-dropTarget { cursor: default; + height: 5.5em; + text-align: left; + padding: 0; } -.oo-ui-selectFileWidget-supported.oo-ui-widget-enabled .oo-ui-selectFileWidget-dropTarget { - cursor: pointer; +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-dropLabel, +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-selectButton { + display: none; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-thumbnail { + height: 5.5em; + width: 5.5em; + position: absolute; + background-size: cover; + background-position: center center; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-thumbnail.oo-ui-pendingElement-pending { + background-size: auto; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-thumbnail > .oo-ui-selectFileWidget-noThumbnail-icon { + opacity: 0.4; + background-color: #cccccc; + height: 5.5em; + width: 5.5em; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info { + border: none; + background: none; + display: block; + height: 100%; + width: auto; + margin-left: 5.5em; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info > .oo-ui-selectFileWidget-label { + position: relative; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info > .oo-ui-selectFileWidget-label > .oo-ui-selectFileWidget-fileName { + display: block; + float: none; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info > .oo-ui-selectFileWidget-label > .oo-ui-selectFileWidget-fileType { + display: block; + float: none; +} +.oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info > .oo-ui-selectFileWidget-clearButton { + position: absolute; + right: 0.5em; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget { + text-align: center; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-dropLabel { + display: block; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-thumbnail, +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info { + display: none; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-selectButton { + display: block; + margin: 0.7em; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget, +.oo-ui-selectFileWidget-notsupported .oo-ui-selectFileWidget-dropTarget { + text-align: center; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info, +.oo-ui-selectFileWidget-notsupported .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info { + margin: 0; } .oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-clearButton, .oo-ui-selectFileWidget-notsupported .oo-ui-selectFileWidget-clearButton { @@ -558,28 +623,33 @@ .oo-ui-selectFileWidget-notsupported.oo-ui-indicatorElement .oo-ui-selectFileWidget-info .oo-ui-selectFileWidget-label { right: 2em; } -.oo-ui-selectFileWidget-dropTarget { - line-height: 3.5em; - background-color: #ffffff; - border: 1px dashed #cccccc; - padding: 0.5em 1em; - margin-bottom: 0.5em; - text-align: center; - vertical-align: middle; -} -.oo-ui-selectFileWidget-supported.oo-ui-widget-enabled .oo-ui-selectFileWidget-dropTarget:hover { - background-color: #eeeeee; -} .oo-ui-selectFileWidget-supported.oo-ui-widget-enabled.oo-ui-selectFileWidget-canDrop .oo-ui-selectFileWidget-dropTarget { background: rgba(52, 123, 255, 0.1); } -.oo-ui-selectFileWidget.oo-ui-widget-disabled .oo-ui-selectFileWidget-dropTarget, +.oo-ui-selectFileWidget-empty.oo-ui-widget-disabled .oo-ui-selectFileWidget-dropTarget, .oo-ui-selectFileWidget-notsupported .oo-ui-selectFileWidget-dropTarget { - color: #cccccc; - text-shadow: 0 1px 1px #ffffff; border-color: #dddddd; background-color: #f3f3f3; } +.oo-ui-selectFileWidget-empty.oo-ui-widget-disabled .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info, +.oo-ui-selectFileWidget-notsupported .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-info, +.oo-ui-selectFileWidget-empty.oo-ui-widget-disabled .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-dropLabel, +.oo-ui-selectFileWidget-notsupported .oo-ui-selectFileWidget-dropTarget .oo-ui-selectFileWidget-dropLabel { + color: #cccccc; + text-shadow: 0 1px 1px #ffffff; +} +.oo-ui-selectFileWidget-dropTarget { + background-color: #ffffff; + border: 1px solid #cccccc; + margin-bottom: 0.5em; + vertical-align: middle; + overflow: hidden; + border-radius: 2px; +} +.oo-ui-selectFileWidget-empty .oo-ui-selectFileWidget-dropTarget { + background-color: #eeeeee; + border-style: dashed; +} .oo-ui-outlineOptionWidget { position: relative; cursor: pointer; @@ -822,17 +892,19 @@ color: #555555; border-radius: 2px; } -.oo-ui-capsuleItemWidget > .oo-ui-iconElement-icon { - cursor: pointer; -} -.oo-ui-capsuleItemWidget.oo-ui-widget-disabled > .oo-ui-iconElement-icon { - cursor: default; -} .oo-ui-capsuleItemWidget.oo-ui-labelElement .oo-ui-labelElement-label { - display: block; + display: inline-block; text-overflow: ellipsis; overflow: hidden; } +.oo-ui-capsuleItemWidget .oo-ui-buttonElement { + margin-top: -1.6em; + padding-left: 0.3em; +} +.oo-ui-capsuleItemWidget:focus { + outline: none; + border-color: #347bff; +} .oo-ui-capsuleItemWidget.oo-ui-indicatorElement > .oo-ui-labelElement-label { padding-right: 1.3375em; } diff --git a/resources/lib/oojs-ui/oojs-ui-widgets.js b/resources/lib/oojs-ui/oojs-ui-widgets.js index 5dbca20e32..521dfbb91d 100644 --- a/resources/lib/oojs-ui/oojs-ui-widgets.js +++ b/resources/lib/oojs-ui/oojs-ui-widgets.js @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:00Z + * Date: 2016-02-09T21:21:16Z */ ( function ( OO ) { @@ -3393,7 +3393,6 @@ OO.mixinClass( OO.ui.TabSelectWidget, OO.ui.mixin.TabIndexedElement ); * @class * @extends OO.ui.Widget * @mixins OO.ui.mixin.ItemWidget - * @mixins OO.ui.mixin.IndicatorElement * @mixins OO.ui.mixin.LabelElement * @mixins OO.ui.mixin.FlaggedElement * @mixins OO.ui.mixin.TabIndexedElement @@ -3408,33 +3407,37 @@ OO.ui.CapsuleItemWidget = function OoUiCapsuleItemWidget( config ) { // Parent constructor OO.ui.CapsuleItemWidget.parent.call( this, config ); - // Properties (must be set before mixin constructor calls) - this.$indicator = $( '' ); - // Mixin constructors OO.ui.mixin.ItemWidget.call( this ); - OO.ui.mixin.IndicatorElement.call( this, $.extend( {}, config, { $indicator: this.$indicator, indicator: 'clear' } ) ); OO.ui.mixin.LabelElement.call( this, config ); OO.ui.mixin.FlaggedElement.call( this, config ); - OO.ui.mixin.TabIndexedElement.call( this, $.extend( {}, config, { $tabIndexed: this.$indicator } ) ); + OO.ui.mixin.TabIndexedElement.call( this, config ); // Events - this.$indicator.on( { - keydown: this.onCloseKeyDown.bind( this ), - click: this.onCloseClick.bind( this ) - } ); + this.closeButton = new OO.ui.ButtonWidget( { + framed: false, + indicator: 'clear', + tabIndex: -1 + } ).on( 'click', this.onCloseClick.bind( this ) ); + + this.on( 'disable', function ( disabled ) { + this.closeButton.setDisabled( disabled ); + }.bind( this ) ); // Initialization this.$element + .on( { + click: this.onClick.bind( this ), + keydown: this.onKeyDown.bind( this ) + } ) .addClass( 'oo-ui-capsuleItemWidget' ) - .append( this.$indicator, this.$label ); + .append( this.$label, this.closeButton.$element ); }; /* Setup */ OO.inheritClass( OO.ui.CapsuleItemWidget, OO.ui.Widget ); OO.mixinClass( OO.ui.CapsuleItemWidget, OO.ui.mixin.ItemWidget ); -OO.mixinClass( OO.ui.CapsuleItemWidget, OO.ui.mixin.IndicatorElement ); OO.mixinClass( OO.ui.CapsuleItemWidget, OO.ui.mixin.LabelElement ); OO.mixinClass( OO.ui.CapsuleItemWidget, OO.ui.mixin.FlaggedElement ); OO.mixinClass( OO.ui.CapsuleItemWidget, OO.ui.mixin.TabIndexedElement ); @@ -3443,33 +3446,54 @@ OO.mixinClass( OO.ui.CapsuleItemWidget, OO.ui.mixin.TabIndexedElement ); /** * Handle close icon clicks - * @param {jQuery.Event} event */ OO.ui.CapsuleItemWidget.prototype.onCloseClick = function () { var element = this.getElementGroup(); - if ( !this.isDisabled() && element && $.isFunction( element.removeItems ) ) { + if ( element && $.isFunction( element.removeItems ) ) { element.removeItems( [ this ] ); element.focus(); } }; /** - * Handle close keyboard events - * @param {jQuery.Event} event Key down event + * Handle click event for the entire capsule */ -OO.ui.CapsuleItemWidget.prototype.onCloseKeyDown = function ( e ) { - if ( !this.isDisabled() && $.isFunction( this.getElementGroup().removeItems ) ) { - switch ( e.which ) { - case OO.ui.Keys.ENTER: - case OO.ui.Keys.BACKSPACE: - case OO.ui.Keys.SPACE: - this.getElementGroup().removeItems( [ this ] ); - return false; - } +OO.ui.CapsuleItemWidget.prototype.onClick = function () { + var element = this.getElementGroup(); + + if ( !this.isDisabled() && element && $.isFunction( element.editItem ) ) { + element.editItem( this ); } }; +/** + * Handle keyDown event for the entire capsule + */ +OO.ui.CapsuleItemWidget.prototype.onKeyDown = function ( e ) { + var element = this.getElementGroup(); + + if ( e.keyCode === OO.ui.Keys.BACKSPACE || e.keyCode === OO.ui.Keys.DELETE ) { + element.removeItems( [ this ] ); + element.focus(); + return false; + } else if ( e.keyCode === OO.ui.Keys.ENTER ) { + element.editItem( this ); + return false; + } else if ( e.keyCode === OO.ui.Keys.LEFT ) { + element.getPreviousItem( this ).focus(); + } else if ( e.keyCode === OO.ui.Keys.RIGHT ) { + element.getNextItem( this ).focus(); + } +}; + +/** + * Focuses the capsule + */ +OO.ui.CapsuleItemWidget.prototype.focus = function () { + this.$element.focus(); +}; + /** * CapsuleMultiSelectWidgets are something like a {@link OO.ui.ComboBoxInputWidget combo box widget} * that allows for selecting multiple values. @@ -3514,16 +3538,19 @@ OO.ui.CapsuleItemWidget.prototype.onCloseKeyDown = function ( e ) { * @extends OO.ui.Widget * @mixins OO.ui.mixin.TabIndexedElement * @mixins OO.ui.mixin.GroupElement + * @uses OO.ui.CapsuleItemWidget + * @uses OO.ui.FloatingMenuSelectWidget * * @constructor * @param {Object} [config] Configuration options * @cfg {boolean} [allowArbitrary=false] Allow data items to be added even if not present in the menu. - * @cfg {Object} [menu] Configuration options to pass to the {@link OO.ui.MenuSelectWidget menu select widget}. + * @cfg {Object} [menu] (required) Configuration options to pass to the + * {@link OO.ui.MenuSelectWidget menu select widget}. * @cfg {Object} [popup] Configuration options to pass to the {@link OO.ui.PopupWidget popup widget}. * If specified, this popup will be shown instead of the menu (but the menu * will still be used for item labels and allowArbitrary=false). The widgets - * in the popup should use this.addItemsFromData() or this.addItems() as necessary. - * @cfg {jQuery} [$overlay] Render the menu or popup into a separate layer. + * in the popup should use {@link #addItemsFromData} or {@link #addItems} as necessary. + * @cfg {jQuery} [$overlay=this.$element] Render the menu or popup into a separate layer. * This configuration is useful in cases where the expanded menu is larger than * its containing `
`. The specified overlay layer is usually on top of * the containing `
` and has a larger area. By default, the menu uses @@ -3532,12 +3559,15 @@ OO.ui.CapsuleItemWidget.prototype.onCloseKeyDown = function ( e ) { OO.ui.CapsuleMultiSelectWidget = function OoUiCapsuleMultiSelectWidget( config ) { var $tabFocus; - // Configuration initialization - config = config || {}; - // Parent constructor OO.ui.CapsuleMultiSelectWidget.parent.call( this, config ); + // Configuration initialization + config = $.extend( { + allowArbitrary: false, + $overlay: this.$element + }, config ); + // Properties (must be set before mixin constructor calls) this.$input = config.popup ? null : $( '' ); this.$handle = $( '
' ); @@ -3562,8 +3592,8 @@ OO.ui.CapsuleMultiSelectWidget = function OoUiCapsuleMultiSelectWidget( config ) // Properties this.$content = $( '
' ); - this.allowArbitrary = !!config.allowArbitrary; - this.$overlay = config.$overlay || this.$element; + this.allowArbitrary = config.allowArbitrary; + this.$overlay = config.$overlay; this.menu = new OO.ui.FloatingMenuSelectWidget( $.extend( { widget: this, @@ -3753,6 +3783,23 @@ OO.ui.CapsuleMultiSelectWidget.prototype.addItemsFromData = function ( datas ) { return this; }; +/** + * Add items to the capsule by providing a label + * @param {string} label + * @return {boolean} Whether the item was added or not + */ +OO.ui.CapsuleMultiSelectWidget.prototype.addItemFromLabel = function ( label ) { + var item = this.menu.getItemFromLabel( label, true ); + if ( item ) { + this.addItemsFromData( [ item.data ] ); + return true; + } else if ( this.allowArbitrary && this.$input.val().trim() !== '' ) { + this.addItemsFromData( [ label ] ); + return true; + } + return false; +}; + /** * Remove items by data * @chainable @@ -3802,6 +3849,18 @@ OO.ui.CapsuleMultiSelectWidget.prototype.addItems = function ( items ) { return this; }; +/** + * Removes the item from the list and copies its label to `this.$input`. + * + * @param {Object} item + */ +OO.ui.CapsuleMultiSelectWidget.prototype.editItem = function ( item ) { + this.$input.val( item.label ); + this.updateInputSize(); + this.focus(); + this.removeItems( [ item ] ); +}; + /** * @inheritdoc */ @@ -3839,6 +3898,56 @@ OO.ui.CapsuleMultiSelectWidget.prototype.clearItems = function () { return this; }; +/** + * Given an item, returns the item after it. If its the last item, + * returns `this.$input`. If no item is passed, returns the very first + * item. + * + * @param {OO.ui.CapsuleItemWidget} [item] + * @return {OO.ui.CapsuleItemWidget|jQuery|boolean} + */ +OO.ui.CapsuleMultiSelectWidget.prototype.getNextItem = function ( item ) { + var itemIndex; + + if ( item === undefined ) { + return this.items[ 0 ]; + } + + itemIndex = this.items.indexOf( item ); + if ( itemIndex < 0 ) { // Item not in list + return false; + } else if ( itemIndex === this.items.length - 1 ) { // Last item + return this.$input; + } else { + return this.items[ itemIndex + 1 ]; + } +}; + +/** + * Given an item, returns the item before it. If its the first item, + * returns `this.$input`. If no item is passed, returns the very last + * item. + * + * @param {OO.ui.CapsuleItemWidget} [item] + * @return {OO.ui.CapsuleItemWidget|jQuery|boolean} + */ +OO.ui.CapsuleMultiSelectWidget.prototype.getPreviousItem = function ( item ) { + var itemIndex; + + if ( item === undefined ) { + return this.items[ this.items.length - 1 ]; + } + + itemIndex = this.items.indexOf( item ); + if ( itemIndex < 0 ) { // Item not in list + return false; + } else if ( itemIndex === 0 ) { // First item + return this.$input; + } else { + return this.items[ itemIndex - 1 ]; + } +}; + /** * Get the capsule widget's menu. * @return {OO.ui.MenuSelectWidget} Menu widget @@ -3866,9 +3975,7 @@ OO.ui.CapsuleMultiSelectWidget.prototype.onInputFocus = function () { * @param {jQuery.Event} event */ OO.ui.CapsuleMultiSelectWidget.prototype.onInputBlur = function () { - if ( this.allowArbitrary && this.$input.val().trim() !== '' ) { - this.addItemsFromData( [ this.$input.val() ] ); - } + this.addItemFromLabel( this.$input.val() ); this.clearInput(); }; @@ -3893,7 +4000,7 @@ OO.ui.CapsuleMultiSelectWidget.prototype.onFocusForPopup = function () { * Handles popup focus out events. * * @private - * @param {Event} e Focus out event + * @param {jQuery.Event} e Focus out event */ OO.ui.CapsuleMultiSelectWidget.prototype.onPopupFocusOut = function () { var widget = this.popup; @@ -3931,8 +4038,6 @@ OO.ui.CapsuleMultiSelectWidget.prototype.onMouseDown = function ( e ) { * @param {jQuery.Event} e Key press event */ OO.ui.CapsuleMultiSelectWidget.prototype.onKeyPress = function ( e ) { - var item; - if ( !this.isDisabled() ) { if ( e.which === OO.ui.Keys.ESCAPE ) { this.clearInput(); @@ -3942,12 +4047,7 @@ OO.ui.CapsuleMultiSelectWidget.prototype.onKeyPress = function ( e ) { if ( !this.popup ) { this.menu.toggle( true ); if ( e.which === OO.ui.Keys.ENTER ) { - item = this.menu.getItemFromLabel( this.$input.val(), true ); - if ( item ) { - this.addItemsFromData( [ item.data ] ); - this.clearInput(); - } else if ( this.allowArbitrary && this.$input.val().trim() !== '' ) { - this.addItemsFromData( [ this.$input.val() ] ); + if ( this.addItemFromLabel( this.$input.val() ) ) { this.clearInput(); } return false; @@ -3966,13 +4066,23 @@ OO.ui.CapsuleMultiSelectWidget.prototype.onKeyPress = function ( e ) { * @param {jQuery.Event} e Key down event */ OO.ui.CapsuleMultiSelectWidget.prototype.onKeyDown = function ( e ) { - if ( !this.isDisabled() ) { + if ( + !this.isDisabled() && + this.$input.val() === '' && + this.items.length + ) { // 'keypress' event is not triggered for Backspace - if ( e.keyCode === OO.ui.Keys.BACKSPACE && this.$input.val() === '' ) { - if ( this.items.length ) { + if ( e.keyCode === OO.ui.Keys.BACKSPACE ) { + if ( e.metaKey || e.ctrlKey ) { this.removeItems( this.items.slice( -1 ) ); + } else { + this.editItem( this.items[ this.items.length - 1 ] ); } return false; + } else if ( e.keyCode === OO.ui.Keys.LEFT ) { + this.getPreviousItem().focus(); + } else if ( e.keyCode === OO.ui.Keys.RIGHT ) { + this.getNextItem().focus(); } } }; @@ -4136,6 +4246,8 @@ OO.ui.CapsuleMultiSelectWidget.prototype.focus = function () { * @cfg {boolean} [droppable=true] Whether to accept files by drag and drop. * @cfg {boolean} [showDropTarget=false] Whether to show a drop target. Requires droppable to be true. * @cfg {boolean} [dragDropUI=false] Deprecated alias for showDropTarget + * @cfg {Number} [thumbnailSizeLimit=20] File size limit in MiB above which to not try and show a + * preview (for performance) */ OO.ui.SelectFileWidget = function OoUiSelectFileWidget( config ) { var dragHandler; @@ -4151,7 +4263,8 @@ OO.ui.SelectFileWidget = function OoUiSelectFileWidget( config ) { placeholder: OO.ui.msg( 'ooui-selectfile-placeholder' ), notsupported: OO.ui.msg( 'ooui-selectfile-not-supported' ), droppable: true, - showDropTarget: false + showDropTarget: false, + thumbnailSizeLimit: 20 }, config ); // Parent constructor @@ -4165,9 +4278,8 @@ OO.ui.SelectFileWidget = function OoUiSelectFileWidget( config ) { // Properties this.$info = $( '' ); - - // Properties this.showDropTarget = config.showDropTarget; + this.thumbnailSizeLimit = config.thumbnailSizeLimit; this.isSupported = this.constructor.static.isSupported(); this.currentFile = null; if ( Array.isArray( config.accept ) ) { @@ -4188,7 +4300,7 @@ OO.ui.SelectFileWidget = function OoUiSelectFileWidget( config ) { this.clearButton = new OO.ui.ButtonWidget( { classes: [ 'oo-ui-selectFileWidget-clearButton' ], framed: false, - icon: 'remove', + icon: 'close', disabled: this.disabled } ); @@ -4211,23 +4323,35 @@ OO.ui.SelectFileWidget = function OoUiSelectFileWidget( config ) { // Initialization this.addInput(); - this.updateUI(); this.$label.addClass( 'oo-ui-selectFileWidget-label' ); this.$info .addClass( 'oo-ui-selectFileWidget-info' ) .append( this.$icon, this.$label, this.clearButton.$element, this.$indicator ); - this.$element - .addClass( 'oo-ui-selectFileWidget' ) - .append( this.$info, this.selectButton.$element ); + if ( config.droppable && config.showDropTarget ) { + this.selectButton.setIcon( 'upload' ); + this.$thumbnail = $( '
' ).addClass( 'oo-ui-selectFileWidget-thumbnail' ); + this.setPendingElement( this.$thumbnail ); this.$dropTarget = $( '
' ) .addClass( 'oo-ui-selectFileWidget-dropTarget' ) - .text( OO.ui.msg( 'ooui-selectfile-dragdrop-placeholder' ) ) .on( { click: this.onDropTargetClick.bind( this ) - } ); - this.$element.prepend( this.$dropTarget ); + } ) + .append( + this.$thumbnail, + this.$info, + this.selectButton.$element, + $( '' ) + .addClass( 'oo-ui-selectFileWidget-dropLabel' ) + .text( OO.ui.msg( 'ooui-selectfile-dragdrop-placeholder' ) ) + ); + this.$element.append( this.$dropTarget ); + } else { + this.$element + .addClass( 'oo-ui-selectFileWidget' ) + .append( this.$info, this.selectButton.$element ); } + this.updateUI(); }; /* Setup */ @@ -4332,13 +4456,77 @@ OO.ui.SelectFileWidget.prototype.updateUI = function () { ); } this.setLabel( $label ); + + if ( this.showDropTarget ) { + this.pushPending(); + this.loadAndGetImageUrl().done( function ( url ) { + this.$thumbnail.css( 'background-image', 'url( ' + url + ' )' ); + }.bind( this ) ).fail( function () { + this.$thumbnail.append( + new OO.ui.IconWidget( { + icon: 'attachment', + classes: [ 'oo-ui-selectFileWidget-noThumbnail-icon' ] + } ).$element + ); + }.bind( this ) ).always( function () { + this.popPending(); + }.bind( this ) ); + this.$dropTarget.off( 'click' ); + } } else { + if ( this.showDropTarget ) { + this.$dropTarget.off( 'click' ); + this.$dropTarget.on( { + click: this.onDropTargetClick.bind( this ) + } ); + this.$thumbnail + .empty() + .css( 'background-image', '' ); + } this.$element.addClass( 'oo-ui-selectFileWidget-empty' ); this.setLabel( this.placeholder ); } } }; +/** + * If the selected file is an image, get its URL and load it. + * + * @return {jQuery.Promise} Promise resolves with the image URL after it has loaded + */ +OO.ui.SelectFileWidget.prototype.loadAndGetImageUrl = function () { + var deferred = $.Deferred(), + file = this.currentFile, + reader = new FileReader(); + + if ( + file && + ( OO.getProp( file, 'type' ) || '' ).indexOf( 'image/' ) === 0 && + file.size < this.thumbnailSizeLimit * 1024 * 1024 + ) { + reader.onload = function ( event ) { + var img = document.createElement( 'img' ); + img.addEventListener( 'load', function () { + if ( + img.naturalWidth === 0 || + img.naturalHeight === 0 || + img.complete === false + ) { + deferred.reject(); + } else { + deferred.resolve( event.target.result ); + } + } ); + img.src = event.target.result; + }; + reader.readAsDataURL( file ); + } else { + deferred.reject(); + } + + return deferred.promise(); +}; + /** * Add the input to the widget * @@ -4356,6 +4544,11 @@ OO.ui.SelectFileWidget.prototype.addInput = function () { this.$input = $( '' ); this.$input.on( 'change', this.onFileSelectedHandler ); + this.$input.on( 'click', function ( e ) { + // Prevents dropTarget to get clicked which calls + // a click on this input + e.stopPropagation(); + } ); this.$input.attr( { tabindex: -1 } ); diff --git a/resources/lib/oojs-ui/oojs-ui-windows-apex.css b/resources/lib/oojs-ui/oojs-ui-windows-apex.css index 788b70d764..adf3bfda17 100644 --- a/resources/lib/oojs-ui/oojs-ui-windows-apex.css +++ b/resources/lib/oojs-ui/oojs-ui-windows-apex.css @@ -1,53 +1,13 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:06Z + * Date: 2016-02-09T21:21:21Z */ -@-webkit-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-moz-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-ms-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-o-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} .oo-ui-actionWidget.oo-ui-pendingElement-pending { background-image: /* @embed */ url(themes/apex/images/textures/pending.gif); } diff --git a/resources/lib/oojs-ui/oojs-ui-windows-mediawiki.css b/resources/lib/oojs-ui/oojs-ui-windows-mediawiki.css index ead41ca4c7..101673cc87 100644 --- a/resources/lib/oojs-ui/oojs-ui-windows-mediawiki.css +++ b/resources/lib/oojs-ui/oojs-ui-windows-mediawiki.css @@ -1,37 +1,13 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:06Z + * Date: 2016-02-09T21:21:21Z */ -@-webkit-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@-moz-keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} -@keyframes oo-ui-progressBarWidget-slide { - from { - margin-left: -40%; - } - to { - margin-left: 100%; - } -} .oo-ui-window { background: transparent; } diff --git a/resources/lib/oojs-ui/oojs-ui-windows.js b/resources/lib/oojs-ui/oojs-ui-windows.js index 1ccd4331e5..1a569452eb 100644 --- a/resources/lib/oojs-ui/oojs-ui-windows.js +++ b/resources/lib/oojs-ui/oojs-ui-windows.js @@ -1,12 +1,12 @@ /*! - * OOjs UI v0.15.2 + * OOjs UI v0.15.3 * https://www.mediawiki.org/wiki/OOjs_UI * * Copyright 2011–2016 OOjs UI Team and other contributors. * Released under the MIT license * http://oojs.mit-license.org * - * Date: 2016-02-02T22:07:00Z + * Date: 2016-02-09T21:21:16Z */ ( function ( OO ) { diff --git a/resources/lib/oojs-ui/themes/apex/icons-content.json b/resources/lib/oojs-ui/themes/apex/icons-content.json index 0886fa61d3..c5652565cc 100644 --- a/resources/lib/oojs-ui/themes/apex/icons-content.json +++ b/resources/lib/oojs-ui/themes/apex/icons-content.json @@ -5,6 +5,10 @@ "articleRedirect": { "file": { "ltr": "images/icons/articleRedirect-ltr.svg", "rtl": "images/icons/articleRedirect-rtl.svg" + } }, + "upload": { "file": { + "ltr": "images/icons/upload-ltr.svg", + "rtl": "images/icons/upload-rtl.svg" } } } } diff --git a/resources/lib/oojs-ui/themes/apex/icons-editing-advanced.json b/resources/lib/oojs-ui/themes/apex/icons-editing-advanced.json index ab04d365b1..aae5201535 100644 --- a/resources/lib/oojs-ui/themes/apex/icons-editing-advanced.json +++ b/resources/lib/oojs-ui/themes/apex/icons-editing-advanced.json @@ -5,6 +5,10 @@ "alignCentre": { "file": "images/icons/align-center.svg" }, "alignLeft": { "file": "images/icons/align-float-left.svg" }, "alignRight": { "file": "images/icons/align-float-right.svg" }, + "attachment": { "file": { + "ltr": "images/icons/attachment-ltr.svg", + "rtl": "images/icons/attachment-rtl.svg" + } }, "calendar": { "file": { "ltr": "images/icons/calendar-ltr.svg", "rtl": "images/icons/calendar-rtl.svg" diff --git a/resources/lib/oojs-ui/themes/apex/images/icons/attachment-ltr.png b/resources/lib/oojs-ui/themes/apex/images/icons/attachment-ltr.png new file mode 100644 index 0000000000..cbcd675a67 Binary files /dev/null and b/resources/lib/oojs-ui/themes/apex/images/icons/attachment-ltr.png differ diff --git a/resources/lib/oojs-ui/themes/apex/images/icons/attachment-ltr.svg b/resources/lib/oojs-ui/themes/apex/images/icons/attachment-ltr.svg new file mode 100644 index 0000000000..74a4d646cd --- /dev/null +++ b/resources/lib/oojs-ui/themes/apex/images/icons/attachment-ltr.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/lib/oojs-ui/themes/apex/images/icons/attachment-rtl.png b/resources/lib/oojs-ui/themes/apex/images/icons/attachment-rtl.png new file mode 100644 index 0000000000..43a0161571 Binary files /dev/null and b/resources/lib/oojs-ui/themes/apex/images/icons/attachment-rtl.png differ diff --git a/resources/lib/oojs-ui/themes/apex/images/icons/attachment-rtl.svg b/resources/lib/oojs-ui/themes/apex/images/icons/attachment-rtl.svg new file mode 100644 index 0000000000..f53f5a4723 --- /dev/null +++ b/resources/lib/oojs-ui/themes/apex/images/icons/attachment-rtl.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/lib/oojs-ui/themes/apex/images/icons/language-ltr.png b/resources/lib/oojs-ui/themes/apex/images/icons/language-ltr.png index bdd9abe810..e27be3c505 100644 Binary files a/resources/lib/oojs-ui/themes/apex/images/icons/language-ltr.png and b/resources/lib/oojs-ui/themes/apex/images/icons/language-ltr.png differ diff --git a/resources/lib/oojs-ui/themes/apex/images/icons/language-ltr.svg b/resources/lib/oojs-ui/themes/apex/images/icons/language-ltr.svg index 4f1fc10876..d64b734389 100644 --- a/resources/lib/oojs-ui/themes/apex/images/icons/language-ltr.svg +++ b/resources/lib/oojs-ui/themes/apex/images/icons/language-ltr.svg @@ -1,7 +1,10 @@ - - - + + + + + + diff --git a/resources/lib/oojs-ui/themes/apex/images/icons/language-rtl.png b/resources/lib/oojs-ui/themes/apex/images/icons/language-rtl.png index ed64644aca..a7fd0cd746 100644 Binary files a/resources/lib/oojs-ui/themes/apex/images/icons/language-rtl.png and b/resources/lib/oojs-ui/themes/apex/images/icons/language-rtl.png differ diff --git a/resources/lib/oojs-ui/themes/apex/images/icons/language-rtl.svg b/resources/lib/oojs-ui/themes/apex/images/icons/language-rtl.svg index 081252e670..cf6c1d51c6 100644 --- a/resources/lib/oojs-ui/themes/apex/images/icons/language-rtl.svg +++ b/resources/lib/oojs-ui/themes/apex/images/icons/language-rtl.svg @@ -1,7 +1,10 @@ - - - + + + + + + diff --git a/resources/lib/oojs-ui/themes/apex/images/icons/upload-ltr.png b/resources/lib/oojs-ui/themes/apex/images/icons/upload-ltr.png new file mode 100644 index 0000000000..fa2da24e69 Binary files /dev/null and b/resources/lib/oojs-ui/themes/apex/images/icons/upload-ltr.png differ diff --git a/resources/lib/oojs-ui/themes/apex/images/icons/upload-ltr.svg b/resources/lib/oojs-ui/themes/apex/images/icons/upload-ltr.svg new file mode 100644 index 0000000000..dc4676fb3b --- /dev/null +++ b/resources/lib/oojs-ui/themes/apex/images/icons/upload-ltr.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/lib/oojs-ui/themes/apex/images/icons/upload-rtl.png b/resources/lib/oojs-ui/themes/apex/images/icons/upload-rtl.png new file mode 100644 index 0000000000..1ac6106a02 Binary files /dev/null and b/resources/lib/oojs-ui/themes/apex/images/icons/upload-rtl.png differ diff --git a/resources/lib/oojs-ui/themes/apex/images/icons/upload-rtl.svg b/resources/lib/oojs-ui/themes/apex/images/icons/upload-rtl.svg new file mode 100644 index 0000000000..ed3fe77280 --- /dev/null +++ b/resources/lib/oojs-ui/themes/apex/images/icons/upload-rtl.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/lib/oojs-ui/themes/mediawiki/icons-editing-advanced.json b/resources/lib/oojs-ui/themes/mediawiki/icons-editing-advanced.json index 54f8aefa68..b03950c305 100644 --- a/resources/lib/oojs-ui/themes/mediawiki/icons-editing-advanced.json +++ b/resources/lib/oojs-ui/themes/mediawiki/icons-editing-advanced.json @@ -12,6 +12,10 @@ "alignCentre": { "file": "images/icons/align-center.svg" }, "alignLeft": { "file": "images/icons/align-float-left.svg" }, "alignRight": { "file": "images/icons/align-float-right.svg" }, + "attachment": { "file": { + "ltr": "images/icons/attachment-ltr.svg", + "rtl": "images/icons/attachment-rtl.svg" + } }, "calendar": { "file": { "ltr": "images/icons/calendar-ltr.svg", "rtl": "images/icons/calendar-rtl.svg" diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-ltr-invert.png b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-ltr-invert.png new file mode 100644 index 0000000000..a77a23e0a8 Binary files /dev/null and b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-ltr-invert.png differ diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-ltr-invert.svg b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-ltr-invert.svg new file mode 100644 index 0000000000..67c3ae91b5 --- /dev/null +++ b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-ltr-invert.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-ltr.png b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-ltr.png new file mode 100644 index 0000000000..cbcd675a67 Binary files /dev/null and b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-ltr.png differ diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-ltr.svg b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-ltr.svg new file mode 100644 index 0000000000..74a4d646cd --- /dev/null +++ b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-ltr.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-rtl-invert.png b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-rtl-invert.png new file mode 100644 index 0000000000..e2e2e02a2d Binary files /dev/null and b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-rtl-invert.png differ diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-rtl-invert.svg b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-rtl-invert.svg new file mode 100644 index 0000000000..61e11d0917 --- /dev/null +++ b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-rtl-invert.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-rtl.png b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-rtl.png new file mode 100644 index 0000000000..43a0161571 Binary files /dev/null and b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-rtl.png differ diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-rtl.svg b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-rtl.svg new file mode 100644 index 0000000000..f53f5a4723 --- /dev/null +++ b/resources/lib/oojs-ui/themes/mediawiki/images/icons/attachment-rtl.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr-invert.png b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr-invert.png index c75d14bdd9..9de74f2260 100644 Binary files a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr-invert.png and b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr-invert.png differ diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr-invert.svg b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr-invert.svg index 19e1e9f4e2..429ee29447 100644 --- a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr-invert.svg +++ b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr-invert.svg @@ -1,7 +1,10 @@ - - - + + + + + + diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr.png b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr.png index bdd9abe810..e27be3c505 100644 Binary files a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr.png and b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr.png differ diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr.svg b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr.svg index 4f1fc10876..d64b734389 100644 --- a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr.svg +++ b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-ltr.svg @@ -1,7 +1,10 @@ - - - + + + + + + diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl-invert.png b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl-invert.png index 680d7265ff..97c0c0941e 100644 Binary files a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl-invert.png and b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl-invert.png differ diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl-invert.svg b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl-invert.svg index 123053cc40..f3c32ebf90 100644 --- a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl-invert.svg +++ b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl-invert.svg @@ -1,7 +1,10 @@ - - - + + + + + + diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl.png b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl.png index ed64644aca..a7fd0cd746 100644 Binary files a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl.png and b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl.png differ diff --git a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl.svg b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl.svg index 081252e670..cf6c1d51c6 100644 --- a/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl.svg +++ b/resources/lib/oojs-ui/themes/mediawiki/images/icons/language-rtl.svg @@ -1,7 +1,10 @@ - - - + + + + + +