jenkins-bot has submitted this change and it was merged. Change subject: Update OOjs UI to v0.16.2 ......................................................................
Update OOjs UI to v0.16.2 Release notes: https://git.wikimedia.org/blob/oojs%2Fui.git/v0.16.2/History.md Change-Id: I5c7402606bbc5ea1c20548b7eae657338b4ae151 --- M composer.json M composer.lock M composer/installed.json M oojs/oojs-ui/History.md M oojs/oojs-ui/demos/pages/icons.js M oojs/oojs-ui/demos/pages/widgets.js M oojs/oojs-ui/demos/widgets.php A oojs/oojs-ui/i18n/mn.json M oojs/oojs-ui/i18n/ug-arab.json M oojs/oojs-ui/package.json M oojs/oojs-ui/php/Element.php M oojs/oojs-ui/php/widgets/TextInputWidget.php 12 files changed, 177 insertions(+), 51 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/composer.json b/composer.json index 04788db..54c213a 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "mediawiki/at-ease": "1.1.0", "monolog/monolog": "1.17.2", "nmred/kafka-php": "0.1.5", - "oojs/oojs-ui": "0.16.1", + "oojs/oojs-ui": "0.16.2", "oyejorge/less.php": "1.7.0.10", "pear/console_getopt": "1.4.1", "pear/mail": "1.2.0", diff --git a/composer.lock b/composer.lock index d0e1fcb..9d185b1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "9a8f398dfb75b789c6bcba9cdab0223c", - "content-hash": "4a5f606dc0ed48c6718be09bbfc833fa", + "hash": "70ae80223adb027ce76bce07b808ae98", + "content-hash": "012038eecf6d49364c86a26069941e66", "packages": [ { "name": "composer/semver", @@ -363,16 +363,16 @@ }, { "name": "oojs/oojs-ui", - "version": "v0.16.1", + "version": "v0.16.2", "source": { "type": "git", "url": "https://github.com/wikimedia/oojs-ui.git", - "reference": "3e4fe6e736eb5332eb1e104cbb61fe73a63c87ba" + "reference": "2d09879110c6cd4b88fc5aaf8e5b4d4d39836870" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/oojs-ui/zipball/3e4fe6e736eb5332eb1e104cbb61fe73a63c87ba", - "reference": "3e4fe6e736eb5332eb1e104cbb61fe73a63c87ba", + "url": "https://api.github.com/repos/wikimedia/oojs-ui/zipball/2d09879110c6cd4b88fc5aaf8e5b4d4d39836870", + "reference": "2d09879110c6cd4b88fc5aaf8e5b4d4d39836870", "shasum": "" }, "require": { @@ -438,7 +438,7 @@ ], "description": "Provides library of common widgets, layouts, and windows.", "homepage": "https://www.mediawiki.org/wiki/OOjs_UI", - "time": "2016-03-01 21:35:45" + "time": "2016-03-08 19:50:22" }, { "name": "oyejorge/less.php", diff --git a/composer/installed.json b/composer/installed.json index d522698..0d7fbec 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -1685,17 +1685,17 @@ }, { "name": "oojs/oojs-ui", - "version": "v0.16.1", - "version_normalized": "0.16.1.0", + "version": "v0.16.2", + "version_normalized": "0.16.2.0", "source": { "type": "git", "url": "https://github.com/wikimedia/oojs-ui.git", - "reference": "3e4fe6e736eb5332eb1e104cbb61fe73a63c87ba" + "reference": "2d09879110c6cd4b88fc5aaf8e5b4d4d39836870" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/oojs-ui/zipball/3e4fe6e736eb5332eb1e104cbb61fe73a63c87ba", - "reference": "3e4fe6e736eb5332eb1e104cbb61fe73a63c87ba", + "url": "https://api.github.com/repos/wikimedia/oojs-ui/zipball/2d09879110c6cd4b88fc5aaf8e5b4d4d39836870", + "reference": "2d09879110c6cd4b88fc5aaf8e5b4d4d39836870", "shasum": "" }, "require": { @@ -1707,7 +1707,7 @@ "mediawiki/mediawiki-codesniffer": "0.6.0", "phpunit/phpunit": "4.8.21" }, - "time": "2016-03-01 21:35:45", + "time": "2016-03-08 19:50:22", "type": "library", "installation-source": "dist", "autoload": { diff --git a/oojs/oojs-ui/History.md b/oojs/oojs-ui/History.md index 5a89c66..5df6f55 100644 --- a/oojs/oojs-ui/History.md +++ b/oojs/oojs-ui/History.md @@ -1,8 +1,30 @@ # OOjs UI Release History -## v0.16.1 / 2016-03-01 -### Features +## v0.16.2 / 2016-03-08 +### Deprecations +* [DEPRECATING CHANGE] MediaWiki theme: Scrap `constructive` flag (Volker E) +* [DEPRECATING CHANGE] Move some editing icons from core to editing-* (James D. Forrester) +### Features +* Dialog: trigger the primary action with ctrl-enter (David Lynch) +* TextInputWidget: Allow type="date" (Geoffrey Mon) + +### Styles +* Apex, MediaWiki themes: Add markup '<>' icon in editing-advanced (Ed Sanders) +* Apex, MediaWiki themes: Drop padding from buttons in MessageDialogs (James D. Forrester) +* editing-styling pack: Have uk fallback to use ru bold and italic icons (Paladox) +* styles: Remove superflous pseudo-class and unitize comments (Volker E) + +### Code +* CapsuleMultiSelectWidget: Emit 'resize' when widget height changes (Bartosz Dziewoński) +* TextInputWidget: Prevent uncaught errors when using #selectRange in IE (Ed Sanders) +* TextInputWidget: Update comment about Blink height miscalculation (Bartosz Dziewoński) +* Follow-up I0667fbc: Fix draggable element CSS (Ed Sanders) +* Add Element::configFromHtmlAttributes() helper method (Bartosz Dziewoński) +* Clean-up duplicate properties across widgets (Volker E) +* docs: Clarify the lack of `.oo-ui-box-shadow()` mixin (Volker E) + +## v0.16.1 / 2016-03-01 ### Styles * CapsuleItemWidget: Revert regression on "remove" button in Firefox (Volker E) diff --git a/oojs/oojs-ui/demos/pages/icons.js b/oojs/oojs-ui/demos/pages/icons.js index b4a17e3..246c5ac 100644 --- a/oojs/oojs-ui/demos/pages/icons.js +++ b/oojs/oojs-ui/demos/pages/icons.js @@ -9,7 +9,6 @@ 'check', 'circle', 'close', - 'code', 'collapse', 'comment', 'ellipsis', @@ -21,11 +20,9 @@ 'next', 'notice', 'previous', - 'redo', 'search', 'settings', 'tag', - 'undo', 'window' ], movement: [ @@ -101,7 +98,9 @@ 'editUndo', 'link', 'linkExternal', - 'linkSecure' + 'linkSecure', + 'redo', + 'undo' ], 'editing-styling': [ 'bigger', @@ -128,9 +127,11 @@ 'alignRight', 'attachment', 'calendar', + 'code', 'find', 'language', 'layout', + 'markup', 'newline', 'noWikiText', 'outline', diff --git a/oojs/oojs-ui/demos/pages/widgets.js b/oojs/oojs-ui/demos/pages/widgets.js index b13108a..4ffd1af 100644 --- a/oojs/oojs-ui/demos/pages/widgets.js +++ b/oojs/oojs-ui/demos/pages/widgets.js @@ -3,6 +3,7 @@ capsuleWithPopup, capsulePopupWidget, horizontalDragItems = [], verticalDragItems = [], + verticalHandledDragItems = [], $demo = demo.$element; /** @@ -45,6 +46,26 @@ OO.inheritClass( DraggableItemWidget, OO.ui.DecoratedOptionWidget ); OO.mixinClass( DraggableItemWidget, OO.ui.mixin.DraggableElement ); + /** + * Drag/drop items with custom handle + * + * @param {Object} [config] Configuration options + */ + function DraggableHandledItemWidget( config ) { + // Configuration initialization + config = config || {}; + + // Parent constructor + DraggableHandledItemWidget.parent.call( this, config ); + + // Mixin constructors + OO.ui.mixin.DraggableElement.call( this, $.extend( { $handle: this.$icon }, config ) ); + } + + /* Setup */ + OO.inheritClass( DraggableHandledItemWidget, OO.ui.DecoratedOptionWidget ); + OO.mixinClass( DraggableHandledItemWidget, OO.ui.mixin.DraggableElement ); + for ( i = 0; i <= 12; i++ ) { horizontalDragItems.push( new DraggableItemWidget( { @@ -58,6 +79,13 @@ new DraggableItemWidget( { data: 'item' + i, icon: 'tag', + label: 'Item ' + i + } ) + ); + verticalHandledDragItems.push( + new DraggableHandledItemWidget( { + data: 'item' + i, + icon: 'menu', label: 'Item ' + i } ) ); @@ -161,16 +189,10 @@ flags: [ 'progressive' ] }, { - flags: [ 'constructive' ] - }, - { flags: [ 'destructive' ] }, { flags: [ 'primary', 'progressive' ] - }, - { - flags: [ 'primary', 'constructive' ] }, { flags: [ 'primary', 'destructive' ] @@ -256,7 +278,7 @@ flags: [ 'constructive' ] } ), { - label: 'ButtonWidget (constructive)\u200E', + label: 'ButtonWidget (constructive, deprecated)\u200E', align: 'top' } ), @@ -286,7 +308,7 @@ flags: [ 'primary', 'constructive' ] } ), { - label: 'ButtonWidget (primary, constructive)\u200E', + label: 'ButtonWidget (primary, constructive, deprecated)\u200E', align: 'top' } ), @@ -312,24 +334,24 @@ ), new OO.ui.FieldLayout( new OO.ui.ButtonWidget( { - label: 'Constructive', - flags: [ 'constructive' ], + label: 'Progressive', + flags: [ 'progressive' ], disabled: true } ), { - label: 'ButtonWidget (constructive, disabled)\u200E', + label: 'ButtonWidget (progressive, disabled)\u200E', align: 'top' } ), new OO.ui.FieldLayout( new OO.ui.ButtonWidget( { - label: 'Constructive', + label: 'Progressive', icon: 'tag', - flags: [ 'constructive' ], + flags: [ 'progressive' ], disabled: true } ), { - label: 'ButtonWidget (constructive, icon, disabled)\u200E', + label: 'ButtonWidget (progressive, icon, disabled)\u200E', align: 'top' } ), @@ -368,10 +390,10 @@ new OO.ui.ButtonWidget( { label: 'Indicator', indicator: 'down', - flags: [ 'constructive' ] + flags: [ 'progressive' ] } ), { - label: 'ButtonWidget (indicator, constructive)\u200E', + label: 'ButtonWidget (indicator, progressive)\u200E', align: 'top' } ), @@ -1448,6 +1470,15 @@ label: 'DraggableGroupWidget (vertical)\u200E', align: 'top' } + ), + new OO.ui.FieldLayout( + new DraggableGroupWidget( { + items: verticalHandledDragItems + } ), + { + label: 'DraggableGroupWidget with handles (vertical)\u200E', + align: 'top' + } ) ] } ), diff --git a/oojs/oojs-ui/demos/widgets.php b/oojs/oojs-ui/demos/widgets.php index c98cb7d..5b91d7f 100644 --- a/oojs/oojs-ui/demos/widgets.php +++ b/oojs/oojs-ui/demos/widgets.php @@ -192,7 +192,7 @@ 'flags' => [ 'constructive' ] ] ), [ - 'label' => "ButtonWidget (constructive)\xE2\x80\x8E", + 'label' => "ButtonWidget (constructive, deprecated)\xE2\x80\x8E", 'align' => 'top' ] ), @@ -222,7 +222,7 @@ 'flags' => [ 'primary', 'constructive' ] ] ), [ - 'label' => "ButtonWidget (primary, constructive)\xE2\x80\x8E", + 'label' => "ButtonWidget (primary, constructive, deprecated)\xE2\x80\x8E", 'align' => 'top' ] ), @@ -248,24 +248,24 @@ ), new OOUI\FieldLayout( new OOUI\ButtonWidget( [ - 'label' => 'Constructive', - 'flags' => [ 'constructive' ], + 'label' => 'Progressive', + 'flags' => [ 'progressive' ], 'disabled' => true ] ), [ - 'label' => "ButtonWidget (constructive, disabled)\xE2\x80\x8E", + 'label' => "ButtonWidget (progressive, disabled)\xE2\x80\x8E", 'align' => 'top' ] ), new OOUI\FieldLayout( new OOUI\ButtonWidget( [ - 'label' => 'Constructive', + 'label' => 'Progressive', 'icon' => 'tag', - 'flags' => [ 'constructive' ], + 'flags' => [ 'progressive' ], 'disabled' => true ] ), [ - 'label' => "ButtonWidget (constructive, icon, disabled)\xE2\x80\x8E", + 'label' => "ButtonWidget (progressive, icon, disabled)\xE2\x80\x8E", 'align' => 'top' ] ), @@ -304,10 +304,10 @@ new OOUI\ButtonWidget( [ 'label' => 'Indicator', 'indicator' => 'down', - 'flags' => [ 'constructive' ] + 'flags' => [ 'progressive' ] ] ), [ - 'label' => "ButtonWidget (indicator, constructive)\xE2\x80\x8E", + 'label' => "ButtonWidget (indicator, progressive)\xE2\x80\x8E", 'align' => 'top' ] ), diff --git a/oojs/oojs-ui/i18n/mn.json b/oojs/oojs-ui/i18n/mn.json new file mode 100644 index 0000000..500aca7 --- /dev/null +++ b/oojs/oojs-ui/i18n/mn.json @@ -0,0 +1,20 @@ +{ + "@metadata": { + "authors": [ + "Munkhzaya.E" + ] + }, + "ooui-toolbar-more": "Илүү", + "ooui-toolgroup-expand": "Илүү", + "ooui-toolgroup-collapse": "Цөөн", + "ooui-dialog-message-accept": "За", + "ooui-dialog-message-reject": "Цуцлах", + "ooui-dialog-process-error": "Ямар нэг алдаа гарсан", + "ooui-dialog-process-dismiss": "Нуух", + "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/oojs/oojs-ui/i18n/ug-arab.json b/oojs/oojs-ui/i18n/ug-arab.json index 19725cc..00d1961 100644 --- a/oojs/oojs-ui/i18n/ug-arab.json +++ b/oojs/oojs-ui/i18n/ug-arab.json @@ -5,5 +5,21 @@ "Tel'et", "Tifinaghes" ] - } + }, + "ooui-outline-control-move-down": "تۆۋەنگە يۆتكە", + "ooui-outline-control-move-up": "يۇقۇرىغا يۆتكە", + "ooui-outline-control-remove": "ئۆچۈر", + "ooui-toolbar-more": "تېخىمۇ كۆپ", + "ooui-toolgroup-expand": "تېخىمۇ كۆپ", + "ooui-toolgroup-collapse": "ئاز", + "ooui-dialog-message-accept": "تامام", + "ooui-dialog-message-reject": "ۋاز كەچ", + "ooui-dialog-process-error": "نامەلۇم خاتالىق كۆرۈلدى", + "ooui-dialog-process-dismiss": "چىقىرىۋەت", + "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/oojs/oojs-ui/package.json b/oojs/oojs-ui/package.json index 91032c5..65881f0 100644 --- a/oojs/oojs-ui/package.json +++ b/oojs/oojs-ui/package.json @@ -1,6 +1,6 @@ { "name": "oojs-ui", - "version": "0.16.1", + "version": "0.16.2", "description": "User interface classes built on the OOjs framework.", "keywords": [ "oojs-plugin", diff --git a/oojs/oojs-ui/php/Element.php b/oojs/oojs-ui/php/Element.php index 9e2355e..8b786f6 100644 --- a/oojs/oojs-ui/php/Element.php +++ b/oojs/oojs-ui/php/Element.php @@ -330,4 +330,40 @@ public static function setDefaultDir( $dir ) { self::$defaultDir = $dir === 'rtl' ? 'rtl' : 'ltr'; } + + /** + * A helper method to massage an array of HTML attributes into a format that is more likely to + * work with an OOjs UI PHP element, camel-casing attribute names and setting values of boolean + * ones to true. Intended as a convenience to be used when refactoring legacy systems using HTML + * to use OOjs UI. + * + * @param array $attrs HTML attributes, e.g. `[ 'disabled' => '', 'accesskey' => 'k' ]` + * @return array OOjs UI PHP element config, e.g. `[ 'disabled' => true, 'accessKey' => 'k' ]` + */ + public static function configFromHtmlAttributes( array $attrs ) { + $booleanAttrs = [ + 'disabled' => true, + 'required' => true, + 'autofocus' => true, + 'multiple' => true, + 'readonly' => true, + ]; + $attributeToConfig = [ + 'maxlength' => 'maxLength', + 'readonly' => 'readOnly', + 'tabindex' => 'tabIndex', + 'accesskey' => 'accessKey', + ]; + $config = []; + foreach ( $attrs as $key => $value ) { + if ( isset( $booleanAttrs[$key] ) && $value !== false && $value !== null ) { + $value = true; + } + if ( isset( $attributeToConfig[$key] ) ) { + $key = $attributeToConfig[$key]; + } + $config[$key] = $value; + } + return $config; + } } diff --git a/oojs/oojs-ui/php/widgets/TextInputWidget.php b/oojs/oojs-ui/php/widgets/TextInputWidget.php index 6b4b078..f76697d 100644 --- a/oojs/oojs-ui/php/widgets/TextInputWidget.php +++ b/oojs/oojs-ui/php/widgets/TextInputWidget.php @@ -32,8 +32,8 @@ /** * @param array $config Configuration options - * @param string $config['type'] HTML tag `type` attribute: 'text', 'password', 'search', 'email' - * or 'url'. Ignored if `multiline` is true. (default: 'text') + * @param string $config['type'] HTML tag `type` attribute: 'text', 'password', 'search', 'email', + * 'url' or 'date'. Ignored if `multiline` is true. (default: 'text') * * Some values of `type` result in additional behaviors: * - `search`: implies `icon: 'search'` and `indicator: 'clear'`; when clicked, the indicator @@ -144,7 +144,7 @@ if ( isset( $config['multiline'] ) && $config['multiline'] ) { return 'multiline'; } else { - $type = in_array( $config['type'], [ 'text', 'password', 'search', 'email', 'url' ] ) ? + $type = in_array( $config['type'], [ 'text', 'password', 'search', 'email', 'url', 'date' ] ) ? $config['type'] : 'text'; return $type; -- To view, visit https://gerrit.wikimedia.org/r/276002 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5c7402606bbc5ea1c20548b7eae657338b4ae151 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vendor Gerrit-Branch: master Gerrit-Owner: Jforrester <[email protected]> Gerrit-Reviewer: Bartosz Dziewoński <[email protected]> Gerrit-Reviewer: Legoktm <[email protected]> Gerrit-Reviewer: Siebrand <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
