Merge "Update OOjs UI to v0.24.2"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 7 Nov 2017 23:29:16 +0000 (23:29 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 7 Nov 2017 23:29:17 +0000 (23:29 +0000)
languages/i18n/qqq.json
resources/src/mediawiki.special/mediawiki.special.apisandbox.css
resources/src/mediawiki.special/mediawiki.special.apisandbox.js
tests/phan/config.php

index 08038ed..0f7f086 100644 (file)
        "apisandbox-dynamic-parameters-add-placeholder": "JavaScript text field placeholder for the widget to add a new arbitrary parameter.",
        "apisandbox-dynamic-error-exists": "Displayed as an error message from JavaScript when trying to add a new arbitrary parameter with a name that already exists. Parameters:\n* $1 - Parameter name that failed.",
        "apisandbox-deprecated-parameters": "JavaScript button label and fieldset legend for separating deprecated parameters in the UI.",
-       "apisandbox-fetch-token": "Tooltop for the button that fetches a CSRF token.",
+       "apisandbox-fetch-token": "Label for the button that fetches a CSRF token.",
        "apisandbox-submit-invalid-fields-title": "Title for a JavaScript error message when fields are invalid.",
        "apisandbox-submit-invalid-fields-message": "Content for a JavaScript error message when fields are invalid.",
        "apisandbox-results": "JavaScript tab label for the tab displaying the API query results.\n{{Identical|Result}}",
index 750a567..5f6c6dc 100644 (file)
        padding-left: 0.5em;
 }
 
-.oo-ui-textInputWidget.oo-ui-widget-enabled > .oo-ui-indicatorElement-indicator.mw-apisandbox-clickable-indicator {
-       cursor: pointer;
-}
-
 .mw-apisandbox-textInputCode .oo-ui-inputWidget-input {
        font-family: monospace, monospace;
        font-size: 0.8125em;
index 7029116..c62685a 100644 (file)
 
                                case 'string':
                                case 'user':
-                                       if ( pi.tokentype ) {
-                                               widget = new TextInputWithIndicatorWidget( {
-                                                       input: {
-                                                               indicator: 'previous',
-                                                               indicatorTitle: mw.message( 'apisandbox-fetch-token' ).text(),
-                                                               required: Util.apiBool( pi.required )
-                                                       }
-                                               } );
-                                       } else if ( Util.apiBool( pi.multi ) ) {
+                                       if ( Util.apiBool( pi.multi ) ) {
                                                widget = new OO.ui.CapsuleMultiselectWidget( {
                                                        allowArbitrary: true,
                                                        allowDuplicates: Util.apiBool( pi.allowsduplicates ),
                                                widget.setValidation( Validators.generic );
                                        }
                                        if ( pi.tokentype ) {
+                                               widget.paramInfo = pi;
+                                               $.extend( widget, WidgetMethods.textInputWidget );
                                                $.extend( widget, WidgetMethods.tokenWidget );
-                                               widget.input.paramInfo = pi;
-                                               $.extend( widget.input, WidgetMethods.textInputWidget );
-                                               $.extend( widget.input, WidgetMethods.tokenWidget );
-                                               widget.on( 'indicator', widget.fetchToken, [], widget );
                                        }
                                        break;
 
 
                Util.fetchModuleInfo( this.apiModule )
                        .done( function ( pi ) {
-                               var prefix, i, j, descriptionContainer, widget, widgetField, helpField, tmp, flag, count,
+                               var prefix, i, j, descriptionContainer, widget, layoutConfig, button, widgetField, helpField, tmp, flag, count,
                                        items = [],
                                        deprecatedItems = [],
                                        buttons = [],
                                                        }
                                                );
 
-                                               widgetField = new OO.ui.FieldLayout(
-                                                       widget,
-                                                       {
-                                                               align: 'left',
-                                                               classes: [ 'mw-apisandbox-widget-field' ],
-                                                               label: prefix + pi.parameters[ i ].name
-                                                       }
-                                               );
+                                               layoutConfig = {
+                                                       align: 'left',
+                                                       classes: [ 'mw-apisandbox-widget-field' ],
+                                                       label: prefix + pi.parameters[ i ].name
+                                               };
+
+                                               if ( pi.parameters[ i ].tokentype ) {
+                                                       button = new OO.ui.ButtonWidget( {
+                                                               label: mw.message( 'apisandbox-fetch-token' ).text()
+                                                       } );
+                                                       button.on( 'click', widget.fetchToken, [], widget );
+
+                                                       widgetField = new OO.ui.ActionFieldLayout( widget, button, layoutConfig );
+                                               } else {
+                                                       widgetField = new OO.ui.FieldLayout( widget, layoutConfig );
+                                               }
 
                                                // We need our own click handler on the widget label to
                                                // turn off the disablement.
                return ret;
        };
 
-       /**
-        * A text input with a clickable indicator
-        *
-        * @class
-        * @private
-        * @constructor
-        * @param {Object} [config] Configuration options
-        */
-       function TextInputWithIndicatorWidget( config ) {
-               var k;
-
-               config = config || {};
-               TextInputWithIndicatorWidget[ 'super' ].call( this, config );
-
-               this.$indicator = $( '<span>' ).addClass( 'mw-apisandbox-clickable-indicator' );
-               OO.ui.mixin.TabIndexedElement.call(
-                       this, $.extend( {}, config, { $tabIndexed: this.$indicator } )
-               );
-
-               this.input = new OO.ui.TextInputWidget( $.extend( {
-                       $indicator: this.$indicator,
-                       disabled: this.isDisabled()
-               }, config.input ) );
-
-               // Forward most methods for convenience
-               for ( k in this.input ) {
-                       if ( $.isFunction( this.input[ k ] ) && !this[ k ] ) {
-                               this[ k ] = this.input[ k ].bind( this.input );
-                       }
-               }
-
-               this.$indicator.on( {
-                       click: this.onIndicatorClick.bind( this ),
-                       keypress: this.onIndicatorKeyPress.bind( this )
-               } );
-
-               this.$element.append( this.input.$element );
-       }
-       OO.inheritClass( TextInputWithIndicatorWidget, OO.ui.Widget );
-       OO.mixinClass( TextInputWithIndicatorWidget, OO.ui.mixin.TabIndexedElement );
-       TextInputWithIndicatorWidget.prototype.onIndicatorClick = function ( e ) {
-               if ( !this.isDisabled() && e.which === 1 ) {
-                       this.emit( 'indicator' );
-               }
-               return false;
-       };
-       TextInputWithIndicatorWidget.prototype.onIndicatorKeyPress = function ( e ) {
-               if ( !this.isDisabled() && ( e.which === OO.ui.Keys.SPACE || e.which === OO.ui.Keys.ENTER ) ) {
-                       this.emit( 'indicator' );
-                       return false;
-               }
-       };
-       TextInputWithIndicatorWidget.prototype.setDisabled = function ( disabled ) {
-               TextInputWithIndicatorWidget[ 'super' ].prototype.setDisabled.call( this, disabled );
-               if ( this.input ) {
-                       this.input.setDisabled( this.isDisabled() );
-               }
-               return this;
-       };
-
        /**
         * A wrapper for a widget that provides an enable/disable button
         *
index ccc0177..0df8357 100644 (file)
@@ -295,20 +295,32 @@ return [
         * to this black-list to inhibit them from being reported.
         */
        'suppress_issue_types' => [
+               // approximate error count: 1
+               "PhanAccessMethodProtected",
+               // approximate error count: 29
+               "PhanCommentParamOnEmptyParamList",
+               // approximate error count: 33
+               "PhanCommentParamWithoutRealParam",
                // approximate error count: 8
                "PhanDeprecatedClass",
                // approximate error count: 415
                "PhanDeprecatedFunction",
                // approximate error count: 25
                "PhanDeprecatedProperty",
+               // approximate error count: 17
+               "PhanNonClassMethodCall",
                // approximate error count: 11
                "PhanParamReqAfterOpt",
                // approximate error count: 888
                "PhanParamSignatureMismatch",
                // approximate error count: 7
                "PhanParamSignatureMismatchInternal",
+               // approximate error count: 1
+               "PhanParamSignatureRealMismatchTooFewParameters",
                // approximate error count: 125
                "PhanParamTooMany",
+               // approximate error count: 1
+               "PhanParamTooManyCallable",
                // approximate error count: 3
                "PhanParamTooManyInternal",
                // approximate error count: 1
@@ -317,12 +329,28 @@ return [
                "PhanTraitParentReference",
                // approximate error count: 3
                "PhanTypeComparisonFromArray",
+               // approximate error count: 2
+               "PhanTypeComparisonToArray",
                // approximate error count: 3
                "PhanTypeInvalidRightOperand",
+               // approximate error count: 1
+               "PhanTypeMagicVoidWithReturn",
                // approximate error count: 218
                "PhanTypeMismatchArgument",
                // approximate error count: 13
                "PhanTypeMismatchArgumentInternal",
+               // approximate error count: 6
+               "PhanTypeMismatchDeclaredParam",
+               // approximate error count: 111
+               "PhanTypeMismatchDeclaredParamNullable",
+               // approximate error count: 1
+               "PhanTypeMismatchDefault",
+               // approximate error count: 5
+               "PhanTypeMismatchDimAssignment",
+               // approximate error count: 2
+               "PhanTypeMismatchDimEmpty",
+               // approximate error count: 1
+               "PhanTypeMismatchDimFetch",
                // approximate error count: 14
                "PhanTypeMismatchForeach",
                // approximate error count: 56
@@ -333,6 +361,8 @@ return [
                "PhanTypeMissingReturn",
                // approximate error count: 5
                "PhanTypeNonVarPassByRef",
+               // approximate error count: 1
+               "PhanUndeclaredClassInCallable",
                // approximate error count: 32
                "PhanUndeclaredConstant",
                // approximate error count: 233
@@ -341,6 +371,12 @@ return [
                "PhanUndeclaredProperty",
                // approximate error count: 3
                "PhanUndeclaredStaticMethod",
+               // approximate error count: 11
+               "PhanUndeclaredTypeReturnType",
+               // approximate error count: 27
+               "PhanUndeclaredVariable",
+               // approximate error count: 58
+               "PhanUndeclaredVariableDim",
        ],
 
        /**