VolkerE has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/383762 )
Change subject: Update OOjs UI to v0.23.4 ...................................................................... Update OOjs UI to v0.23.4 Release notes: https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v0.23.4 Change-Id: I990b14982ffb72fe981040d02c7023d13f721ee6 --- M composer.json M composer.lock M composer/autoload_classmap.php M composer/autoload_static.php M composer/installed.json M oojs/oojs-ui/History.md M oojs/oojs-ui/bin/testsuitegenerator.rb M oojs/oojs-ui/demos/classes/IndexedDialog.js M oojs/oojs-ui/demos/index.html M oojs/oojs-ui/demos/pages/icons.js M oojs/oojs-ui/demos/pages/widgets.js M oojs/oojs-ui/demos/pages/widgets.php M oojs/oojs-ui/demos/styles/demo.css M oojs/oojs-ui/package.json M oojs/oojs-ui/php/Element.php A oojs/oojs-ui/php/widgets/MultilineTextInputWidget.php A oojs/oojs-ui/php/widgets/SearchInputWidget.php M oojs/oojs-ui/php/widgets/TextInputWidget.php 18 files changed, 188 insertions(+), 27 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vendor refs/changes/62/383762/1 diff --git a/composer.json b/composer.json index bbd968a..bfad05e 100644 --- a/composer.json +++ b/composer.json @@ -70,7 +70,7 @@ "monolog/monolog": "1.22.1", "mustangostang/spyc": "0.6.2", "nmred/kafka-php": "0.1.5", - "oojs/oojs-ui": "0.23.3", + "oojs/oojs-ui": "0.23.4", "oyejorge/less.php": "1.7.0.14", "pear/console_getopt": "1.4.1", "pear/mail": "1.4.1", diff --git a/composer.lock b/composer.lock index c2d2989..81aeb98 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "0c594f60d3795a4d41a93290ac37015c", + "content-hash": "c854b7668ffdb2ee0bd852473ce6a13c", "packages": [ { "name": "composer/semver", @@ -540,16 +540,16 @@ }, { "name": "oojs/oojs-ui", - "version": "v0.23.3", + "version": "v0.23.4", "source": { "type": "git", "url": "https://github.com/wikimedia/oojs-ui.git", - "reference": "072606c2676ba903b8b2439a03d4dae3e5fa2e01" + "reference": "28706ae4ac54aa5f79713a9363880318a306d4fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/oojs-ui/zipball/072606c2676ba903b8b2439a03d4dae3e5fa2e01", - "reference": "072606c2676ba903b8b2439a03d4dae3e5fa2e01", + "url": "https://api.github.com/repos/wikimedia/oojs-ui/zipball/28706ae4ac54aa5f79713a9363880318a306d4fd", + "reference": "28706ae4ac54aa5f79713a9363880318a306d4fd", "shasum": "" }, "require": { @@ -615,7 +615,7 @@ ], "description": "Provides library of common widgets, layouts, and windows.", "homepage": "https://www.mediawiki.org/wiki/OOjs_UI", - "time": "2017-10-04T01:07:16+00:00" + "time": "2017-10-12T01:09:32+00:00" }, { "name": "oyejorge/less.php", diff --git a/composer/autoload_classmap.php b/composer/autoload_classmap.php index d98c4e3..16a67c7 100644 --- a/composer/autoload_classmap.php +++ b/composer/autoload_classmap.php @@ -751,10 +751,12 @@ 'OOUI\\LabelWidget' => $vendorDir . '/oojs/oojs-ui/php/widgets/LabelWidget.php', 'OOUI\\Layout' => $vendorDir . '/oojs/oojs-ui/php/Layout.php', 'OOUI\\MediaWikiTheme' => $vendorDir . '/oojs/oojs-ui/php/themes/MediaWikiTheme.php', + 'OOUI\\MultilineTextInputWidget' => $vendorDir . '/oojs/oojs-ui/php/widgets/MultilineTextInputWidget.php', 'OOUI\\PanelLayout' => $vendorDir . '/oojs/oojs-ui/php/layouts/PanelLayout.php', 'OOUI\\ProgressBarWidget' => $vendorDir . '/oojs/oojs-ui/php/widgets/ProgressBarWidget.php', 'OOUI\\RadioInputWidget' => $vendorDir . '/oojs/oojs-ui/php/widgets/RadioInputWidget.php', 'OOUI\\RadioSelectInputWidget' => $vendorDir . '/oojs/oojs-ui/php/widgets/RadioSelectInputWidget.php', + 'OOUI\\SearchInputWidget' => $vendorDir . '/oojs/oojs-ui/php/widgets/SearchInputWidget.php', 'OOUI\\TabIndexedElement' => $vendorDir . '/oojs/oojs-ui/php/mixins/TabIndexedElement.php', 'OOUI\\Tag' => $vendorDir . '/oojs/oojs-ui/php/Tag.php', 'OOUI\\TextInputWidget' => $vendorDir . '/oojs/oojs-ui/php/widgets/TextInputWidget.php', diff --git a/composer/autoload_static.php b/composer/autoload_static.php index 0d3e8f2..7e2c63e 100644 --- a/composer/autoload_static.php +++ b/composer/autoload_static.php @@ -952,10 +952,12 @@ 'OOUI\\LabelWidget' => __DIR__ . '/..' . '/oojs/oojs-ui/php/widgets/LabelWidget.php', 'OOUI\\Layout' => __DIR__ . '/..' . '/oojs/oojs-ui/php/Layout.php', 'OOUI\\MediaWikiTheme' => __DIR__ . '/..' . '/oojs/oojs-ui/php/themes/MediaWikiTheme.php', + 'OOUI\\MultilineTextInputWidget' => __DIR__ . '/..' . '/oojs/oojs-ui/php/widgets/MultilineTextInputWidget.php', 'OOUI\\PanelLayout' => __DIR__ . '/..' . '/oojs/oojs-ui/php/layouts/PanelLayout.php', 'OOUI\\ProgressBarWidget' => __DIR__ . '/..' . '/oojs/oojs-ui/php/widgets/ProgressBarWidget.php', 'OOUI\\RadioInputWidget' => __DIR__ . '/..' . '/oojs/oojs-ui/php/widgets/RadioInputWidget.php', 'OOUI\\RadioSelectInputWidget' => __DIR__ . '/..' . '/oojs/oojs-ui/php/widgets/RadioSelectInputWidget.php', + 'OOUI\\SearchInputWidget' => __DIR__ . '/..' . '/oojs/oojs-ui/php/widgets/SearchInputWidget.php', 'OOUI\\TabIndexedElement' => __DIR__ . '/..' . '/oojs/oojs-ui/php/mixins/TabIndexedElement.php', 'OOUI\\Tag' => __DIR__ . '/..' . '/oojs/oojs-ui/php/Tag.php', 'OOUI\\TextInputWidget' => __DIR__ . '/..' . '/oojs/oojs-ui/php/widgets/TextInputWidget.php', diff --git a/composer/installed.json b/composer/installed.json index 7352bbd..3a02270 100644 --- a/composer/installed.json +++ b/composer/installed.json @@ -2320,17 +2320,17 @@ }, { "name": "oojs/oojs-ui", - "version": "v0.23.3", - "version_normalized": "0.23.3.0", + "version": "v0.23.4", + "version_normalized": "0.23.4.0", "source": { "type": "git", "url": "https://github.com/wikimedia/oojs-ui.git", - "reference": "072606c2676ba903b8b2439a03d4dae3e5fa2e01" + "reference": "28706ae4ac54aa5f79713a9363880318a306d4fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/oojs-ui/zipball/072606c2676ba903b8b2439a03d4dae3e5fa2e01", - "reference": "072606c2676ba903b8b2439a03d4dae3e5fa2e01", + "url": "https://api.github.com/repos/wikimedia/oojs-ui/zipball/28706ae4ac54aa5f79713a9363880318a306d4fd", + "reference": "28706ae4ac54aa5f79713a9363880318a306d4fd", "shasum": "" }, "require": { @@ -2342,7 +2342,7 @@ "mediawiki/mediawiki-codesniffer": "0.12.0", "phpunit/phpunit": "4.8.21" }, - "time": "2017-10-04T01:07:16+00:00", + "time": "2017-10-12T01:09:32+00:00", "type": "library", "installation-source": "dist", "autoload": { diff --git a/oojs/oojs-ui/History.md b/oojs/oojs-ui/History.md index b573add..3053557 100644 --- a/oojs/oojs-ui/History.md +++ b/oojs/oojs-ui/History.md @@ -1,4 +1,26 @@ # OOjs UI Release History +## v0.23.4 / 2017-10-11 +### Styles +* IndexLayout: Handle long lists of tabs (Bartosz Dziewoński) +* icons: Provide a 'reload' icon in the 'interactions' pack (Ed Sanders) +* Apex theme: Fix PopupToolGroup active box size (Volker E.) +* Apex theme: Fix SelectFileWidget (no browser support) `padding` (Volker E.) +* Generalize icon and indicator positioning & visibility (Volker E.) +* WikimediaUI theme: Reduce Checkbox*- & RadioSelectInputWidget vertical space (Volker E.) +* WikimediaUI theme: Reduce FieldLayout `margin-top` slightly (Volker E.) +* WikimediaUI theme: Streamlining icon/indicator visibility (Volker E.) + +### Code +* Only store initialConfig in demo mode (Ed Sanders) +* SearchInputWidget: Prevent extra `oo-ui-textInputWidget-type-text` class (Bartosz Dziewoński) +* TextInputWidget: Use child selector for icons/indicators/labels (Ed Sanders) +* Do not call `.offset()` on `$( 'html' )` (Bartosz Dziewoński) +* PHP: Implement MultilineTextInputWidget, deprecate multiline option (Prateek Saxena) +* PHP: Implement SearchInputWidget, deprecate search option (Bartosz Dziewoński) +* build: Downgrade 'grunt-exec' to 1.0.1 (Bartosz Dziewoński) +* demos: Adding missing `:hover` (Volker E.) + + ## v0.23.3 / 2017-10-03 ### Styles * PopupToolGroup: Move accelerator keys `padding` to themes (Volker E.) @@ -20,6 +42,7 @@ * WikimediaUI theme: Simplify action toolbar buttons selectors (Volker E.) * demos: Remove unnecessary button demo widgets (Volker E.) + ## v0.23.2 / 2017-09-26 ### Deprecations * [DEPRECATING CHANGE]: Apex theme: Begin killing `constructive` flag (James D. Forrester) diff --git a/oojs/oojs-ui/bin/testsuitegenerator.rb b/oojs/oojs-ui/bin/testsuitegenerator.rb index 711059f..3770661 100644 --- a/oojs/oojs-ui/bin/testsuitegenerator.rb +++ b/oojs/oojs-ui/bin/testsuitegenerator.rb @@ -81,6 +81,11 @@ ['FieldLayout', 'help'] => [], ['ActionFieldLayout', 'help'] => [], ['FieldsetLayout', 'help'] => [], + # the dynamic 'clear' indicator in JS messes everything up + ['SearchInputWidget', 'value'] => [], + ['SearchInputWidget', 'indicator'] => [], + ['SearchInputWidget', 'required'] => [], + ['SearchInputWidget', 'disabled'] => [], # these are defined by Element and would bloat the tests 'classes' => [], 'id' => [], diff --git a/oojs/oojs-ui/demos/classes/IndexedDialog.js b/oojs/oojs-ui/demos/classes/IndexedDialog.js index b29998e..c2d437f 100644 --- a/oojs/oojs-ui/demos/classes/IndexedDialog.js +++ b/oojs/oojs-ui/demos/classes/IndexedDialog.js @@ -11,13 +11,23 @@ return 250; }; Demo.IndexedDialog.prototype.initialize = function () { + var loremIpsum = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, ' + + 'sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\u200E'; Demo.IndexedDialog.parent.prototype.initialize.apply( this, arguments ); this.indexLayout = new OO.ui.IndexLayout(); this.tabPanels = [ - new Demo.SampleTabPanel( 'first', { label: 'One' } ), - new Demo.SampleTabPanel( 'second', { label: 'Two' } ), - new Demo.SampleTabPanel( 'third', { label: 'Three' } ), - new Demo.SampleTabPanel( 'fourth', { label: 'Four' } ) + new Demo.SampleTabPanel( 'first', { label: 'One tab' } ), + new Demo.SampleTabPanel( 'second', { label: 'Two tab' } ), + new Demo.SampleTabPanel( 'third', { label: 'Three tab' } ), + new Demo.SampleTabPanel( 'fourth', { label: 'Four tab' } ), + new Demo.SampleTabPanel( 'long', { + label: 'Long tab', + content: [ + $( '<p>' ).text( loremIpsum ), + $( '<p>' ).text( loremIpsum ), + $( '<p>' ).text( loremIpsum ) + ] + } ) ]; this.indexLayout.addTabPanels( this.tabPanels ); diff --git a/oojs/oojs-ui/demos/index.html b/oojs/oojs-ui/demos/index.html index aa05516..d3ef499 100644 --- a/oojs/oojs-ui/demos/index.html +++ b/oojs/oojs-ui/demos/index.html @@ -58,6 +58,8 @@ $( function () { var demo, lastQuery = location.search; + OO.ui.isDemo = true; + function setup() { var prevPage = demo ? demo.mode.page : null, diff --git a/oojs/oojs-ui/demos/pages/icons.js b/oojs/oojs-ui/demos/pages/icons.js index 75a9f85..7c459c9 100644 --- a/oojs/oojs-ui/demos/pages/icons.js +++ b/oojs/oojs-ui/demos/pages/icons.js @@ -65,6 +65,7 @@ 'logOut', 'newWindow', 'printer', + 'reload', 'search', 'settings', 'subtract' diff --git a/oojs/oojs-ui/demos/pages/widgets.js b/oojs/oojs-ui/demos/pages/widgets.js index 4681830..31678e3 100644 --- a/oojs/oojs-ui/demos/pages/widgets.js +++ b/oojs/oojs-ui/demos/pages/widgets.js @@ -2720,23 +2720,23 @@ } ).addTabPanels( [ new Demo.SampleTabPanel( 'first', { expanded: false, - label: 'One' + label: 'One tab' } ), new Demo.SampleTabPanel( 'second', { expanded: false, - label: 'Two' + label: 'Two tab' } ), new Demo.SampleTabPanel( 'third', { expanded: false, - label: 'Three' + label: 'Three tab' } ), new Demo.SampleTabPanel( 'fourth', { expanded: false, - label: 'Four' + label: 'Four tab' } ), new Demo.SampleTabPanel( 'long', { expanded: false, - label: 'Long', + label: 'Long tab', content: [ $( '<p>' ).text( loremIpsum ), $( '<p>' ).text( loremIpsum ), diff --git a/oojs/oojs-ui/demos/pages/widgets.php b/oojs/oojs-ui/demos/pages/widgets.php index 68a6456..fa48e7d 100644 --- a/oojs/oojs-ui/demos/pages/widgets.php +++ b/oojs/oojs-ui/demos/pages/widgets.php @@ -368,6 +368,13 @@ ] ), new OOUI\FieldLayout( + new OOUI\SearchInputWidget(), + [ + 'label' => "SearchInputWidget", + 'align' => 'top' + ] + ), + new OOUI\FieldLayout( new OOUI\TextInputWidget( [ 'value' => 'Access key: S', 'accessKey' => 's' @@ -401,12 +408,21 @@ ] ), new OOUI\FieldLayout( + new OOUI\MultilineTextInputWidget( [ + 'value' => "Multiline\nMultiline" + ] ), + [ + 'label' => "MultilineTextInputWidget \xE2\x80\x8E", + 'align' => 'top' + ] + ), + new OOUI\FieldLayout( new OOUI\TextInputWidget( [ 'multiline' => true, 'value' => "Multiline\nMultiline" ] ), [ - 'label' => "TextInputWidget (multiline)\xE2\x80\x8E", + 'label' => "TextInputWidget (multiline; deprecated)\xE2\x80\x8E", 'align' => 'top' ] ), diff --git a/oojs/oojs-ui/demos/styles/demo.css b/oojs/oojs-ui/demos/styles/demo.css index 733f980..cc8d70e 100644 --- a/oojs/oojs-ui/demos/styles/demo.css +++ b/oojs/oojs-ui/demos/styles/demo.css @@ -108,7 +108,7 @@ transition: color 100ms; } -.demo-link-example::after, +.demo-link-example:hover::after, .demo-console-toggle:hover::after { color: #447ff5; } diff --git a/oojs/oojs-ui/package.json b/oojs/oojs-ui/package.json index ecf2413..f205ad9 100644 --- a/oojs/oojs-ui/package.json +++ b/oojs/oojs-ui/package.json @@ -1,6 +1,6 @@ { "name": "oojs-ui", - "version": "0.23.3", + "version": "0.23.4", "description": "User interface classes built on the OOjs framework.", "keywords": [ "oojs-plugin", @@ -40,7 +40,7 @@ "grunt-contrib-watch": "1.0.0", "grunt-cssjanus": "0.4.0", "grunt-eslint": "20.0.0", - "grunt-exec": "3.0.0", + "grunt-exec": "1.0.1", "grunt-file-exists": "0.1.4", "grunt-image": "1.5.2", "grunt-jsonlint": "1.1.0", diff --git a/oojs/oojs-ui/php/Element.php b/oojs/oojs-ui/php/Element.php index 04c81e0..2c0a871 100644 --- a/oojs/oojs-ui/php/Element.php +++ b/oojs/oojs-ui/php/Element.php @@ -51,6 +51,17 @@ */ protected $configCallbacks = []; + /* Static methods */ + + /** + * Emits a deprecation warning with provided message. + * + * @param string $message Message about the deprecation + */ + public static function warnDeprecation( $message = '' ) { + trigger_error( $message, E_USER_DEPRECATED ); + } + /* Methods */ /** diff --git a/oojs/oojs-ui/php/widgets/MultilineTextInputWidget.php b/oojs/oojs-ui/php/widgets/MultilineTextInputWidget.php new file mode 100644 index 0000000..9dd3716 --- /dev/null +++ b/oojs/oojs-ui/php/widgets/MultilineTextInputWidget.php @@ -0,0 +1,51 @@ +<?php + +namespace OOUI; + +/** + * Input widget with a text field. + */ +class MultilineTextInputWidget extends TextInputWidget { + use IconElement; + use IndicatorElement; + + /** + * Allow multiple lines of text. + * + * @var boolean + */ + protected $multiline = true; + + /** + * @param array $config Configuration options + * @param string $config['placeholder'] Placeholder text + * @param bool $config['autofocus'] Ask the browser to focus this widget, using the 'autofocus' + * HTML attribute (default: false) + * @param bool $config['readOnly'] Prevent changes (default: false) + * @param number $config['maxLength'] Maximum allowed number of characters to input + * @param int $config['rows'] If multiline, number of visible lines in textarea + * @param bool $config['required'] Mark the field as required. + * Implies `indicator: 'required'`. (default: false) + */ + public function __construct( array $config = [] ) { + // Config initialization + $config = array_merge( [ + 'readOnly' => false, + 'autofocus' => false, + 'required' => false, + 'multiline' => true, + ], $config ); + + // Parent constructor + parent::__construct( $config ); + } + + /** + * Check if input supports multiple lines. + * + * @return bool + */ + public function isMultiline() { + return true; + } +} diff --git a/oojs/oojs-ui/php/widgets/SearchInputWidget.php b/oojs/oojs-ui/php/widgets/SearchInputWidget.php new file mode 100644 index 0000000..6349479 --- /dev/null +++ b/oojs/oojs-ui/php/widgets/SearchInputWidget.php @@ -0,0 +1,25 @@ +<?php + +namespace OOUI; + +/** + * Input widget with a text field. + */ +class SearchInputWidget extends TextInputWidget { + use IconElement; + use IndicatorElement; + + public function __construct( array $config = [] ) { + // Config initialization + $config = array_merge( [ + 'icon' => 'search', + ], $config ); + + // Parent constructor + parent::__construct( $config ); + } + + protected function getSaneType( $config ) { + return 'search'; + } +} diff --git a/oojs/oojs-ui/php/widgets/TextInputWidget.php b/oojs/oojs-ui/php/widgets/TextInputWidget.php index 37ed3e1..72abc16 100644 --- a/oojs/oojs-ui/php/widgets/TextInputWidget.php +++ b/oojs/oojs-ui/php/widgets/TextInputWidget.php @@ -81,6 +81,19 @@ $this->type = $this->getSaneType( $config ); $this->multiline = isset( $config['multiline'] ) ? (bool)$config['multiline'] : false; + if ( $this->multiline && !( $this instanceof MultilineTextInputWidget ) ) { + Element::warnDeprecation( + 'The TextInputWidget "multiline" option is deprecated as of OOjs UI v0.22.2. ' . + 'Use MultilineTextInputWidget instead.' + ); + } + if ( $config['type'] === 'search' && !( $this instanceof SearchInputWidget ) ) { + Element::warnDeprecation( + 'The TextInputWidget "type" => "search" is deprecated as of OOjs UI v0.22.2. ' . + 'Use SearchInputWidget instead.' + ); + } + // Traits $this->initializeIconElement( $config ); $this->initializeIndicatorElement( $config ); @@ -182,7 +195,7 @@ } } - private function getSaneType( $config ) { + protected function getSaneType( $config ) { $allowedTypes = [ 'text', 'password', -- To view, visit https://gerrit.wikimedia.org/r/383762 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I990b14982ffb72fe981040d02c7023d13f721ee6 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/vendor Gerrit-Branch: master Gerrit-Owner: VolkerE <volke...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits