Merge "resources: Bump moment.js from 2.15.0 to 2.19.3"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 29 Nov 2017 20:13:19 +0000 (20:13 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 29 Nov 2017 20:13:19 +0000 (20:13 +0000)
resources/Resources.php
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
resources/src/mediawiki.special/mediawiki.special.apisandbox.js
resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js
resources/src/mediawiki/mediawiki.debug.js

index 9af1c05..559aca8 100644 (file)
@@ -957,6 +957,7 @@ return [
                ],
                'dependencies' => [
                        'jquery.footHovzer',
+                       'oojs-ui-core',
                ],
        ],
        'mediawiki.diff.styles' => [
index ef358e0..74b81fa 100644 (file)
        }
 
        .mw-recentchanges-toplinks {
-               margin-bottom: 0.5em;
-               padding: 0 0.5em 0.5em 0.5em;
-               border: 1px solid transparent;
+               padding-left: 0.5em;
 
                &:not( .mw-recentchanges-toplinks-collapsed ) {
-                       // Same as the legend
-                       border: 1px solid @colorGray12;
+                       margin-bottom: 0.5em;
+                       border: 1px solid @colorGray12; // Same as the legend
+                       padding: 0 0.5em 0.5em 0.5em;
                }
+
+               /* stylelint-disable declaration-no-important */
+               .oo-ui-buttonElement > .oo-ui-buttonElement-button {
+                       padding-right: 1.2em !important;
+
+                       > .oo-ui-indicatorElement-indicator {
+                               right: 0 !important;
+                               width: 0.9375em !important;
+                       }
+               }
+               /* stylelint-enable declaration-no-important */
        }
 
        body:not( .mw-rcfilters-ui-initialized ) {
index ed51c34..ff4335a 100644 (file)
                                .empty()
                                .append( $( '<p>' ).append( Util.parseMsg( 'apisandbox-intro' ) ) )
                                .append(
-                                       $( '<div>', { id: 'mw-apisandbox-ui' } )
+                                       $( '<div>' ).attr( 'id', 'mw-apisandbox-ui' )
                                                .append( $toolbar )
                                                .append( panel.$element )
                                );
                                                        width: 'auto',
                                                        padded: true,
                                                        $content: $( '<ul>' ).append( $.map( pi.helpurls, function ( link ) {
-                                                               return $( '<li>' ).append( $( '<a>', {
-                                                                       href: link,
-                                                                       target: '_blank',
-                                                                       text: link
-                                                               } ) );
+                                                               return $( '<li>' ).append( $( '<a>' )
+                                                                       .attr( { href: link, target: '_blank' } )
+                                                                       .text( link )
+                                                               );
                                                        } ) )
                                                }
                                        } ) );
                                                        width: 'auto',
                                                        padded: true,
                                                        $content: $( '<ul>' ).append( $.map( pi.examples, function ( example ) {
-                                                               var a = $( '<a>', {
-                                                                       href: '#' + example.query,
-                                                                       html: example.description
-                                                               } );
+                                                               var a = $( '<a>' )
+                                                                       .attr( 'href', '#' + example.query )
+                                                                       .html( example.description );
                                                                a.find( 'a' ).contents().unwrap(); // Can't nest links
                                                                return $( '<li>' ).append( a );
                                                        } ) )
                                                        var $this = $( this );
                                                        $this.parent().prev( 'p' ).append( $this );
                                                } );
-                                               descriptionContainer.append( $( '<div>', { addClass: 'description', append: tmp } ) );
+                                               descriptionContainer.append( $( '<div>' ).addClass( 'description' ).append( tmp ) );
 
                                                if ( pi.parameters[ i ].info && pi.parameters[ i ].info.length ) {
                                                        for ( j = 0; j < pi.parameters[ i ].info.length; j++ ) {
-                                                               descriptionContainer.append( $( '<div>', {
-                                                                       addClass: 'info',
-                                                                       append: Util.parseHTML( pi.parameters[ i ].info[ j ] )
-                                                               } ) );
+                                                               descriptionContainer.append( $( '<div>' )
+                                                                       .addClass( 'info' )
+                                                                       .append( Util.parseHTML( pi.parameters[ i ].info[ j ] ) )
+                                                               );
                                                        }
                                                }
                                                flag = true;
 
                                                        case 'limit':
                                                                if ( pi.parameters[ i ].highmax !== undefined ) {
-                                                                       descriptionContainer.append( $( '<div>', {
-                                                                               addClass: 'info',
-                                                                               append: [
+                                                                       descriptionContainer.append( $( '<div>' )
+                                                                               .addClass( 'info' )
+                                                                               .append(
                                                                                        Util.parseMsg(
                                                                                                'api-help-param-limit2', pi.parameters[ i ].max, pi.parameters[ i ].highmax
                                                                                        ),
                                                                                        ' ',
                                                                                        Util.parseMsg( 'apisandbox-param-limit' )
-                                                                               ]
-                                                                       } ) );
+                                                                               )
+                                                                       );
                                                                } else {
-                                                                       descriptionContainer.append( $( '<div>', {
-                                                                               addClass: 'info',
-                                                                               append: [
+                                                                       descriptionContainer.append( $( '<div>' )
+                                                                               .addClass( 'info' )
+                                                                               .append(
                                                                                        Util.parseMsg( 'api-help-param-limit', pi.parameters[ i ].max ),
                                                                                        ' ',
                                                                                        Util.parseMsg( 'apisandbox-param-limit' )
-                                                                               ]
-                                                                       } ) );
+                                                                               )
+                                                                       );
                                                                }
                                                                break;
 
                                                                        tmp += 'max';
                                                                }
                                                                if ( tmp !== '' ) {
-                                                                       descriptionContainer.append( $( '<div>', {
-                                                                               addClass: 'info',
-                                                                               append: Util.parseMsg(
+                                                                       descriptionContainer.append( $( '<div>' )
+                                                                               .addClass( 'info' )
+                                                                               .append( Util.parseMsg(
                                                                                        'api-help-param-integer-' + tmp,
                                                                                        Util.apiBool( pi.parameters[ i ].multi ) ? 2 : 1,
                                                                                        pi.parameters[ i ].min, pi.parameters[ i ].max
-                                                                               )
-                                                                       } ) );
+                                                                               ) )
+                                                                       );
                                                                }
                                                                break;
 
                                                                );
                                                        }
                                                        if ( tmp.length ) {
-                                                               descriptionContainer.append( $( '<div>', {
-                                                                       addClass: 'info',
-                                                                       append: Util.parseHTML( tmp.join( ' ' ) )
-                                                               } ) );
+                                                               descriptionContainer.append( $( '<div>' )
+                                                                       .addClass( 'info' )
+                                                                       .append( Util.parseHTML( tmp.join( ' ' ) ) )
+                                                               );
                                                        }
                                                }
                                                if ( 'maxbytes' in pi.parameters[ i ] ) {
-                                                       descriptionContainer.append( $( '<div>', {
-                                                               addClass: 'info',
-                                                               append: Util.parseMsg( 'api-help-param-maxbytes', pi.parameters[ i ].maxbytes )
-                                                       } ) );
+                                                       descriptionContainer.append( $( '<div>' )
+                                                               .addClass( 'info' )
+                                                               .append( Util.parseMsg( 'api-help-param-maxbytes', pi.parameters[ i ].maxbytes ) )
+                                                       );
                                                }
                                                if ( 'maxchars' in pi.parameters[ i ] ) {
-                                                       descriptionContainer.append( $( '<div>', {
-                                                               addClass: 'info',
-                                                               append: Util.parseMsg( 'api-help-param-maxchars', pi.parameters[ i ].maxchars )
-                                                       } ) );
+                                                       descriptionContainer.append( $( '<div>' )
+                                                               .addClass( 'info' )
+                                                               .append( Util.parseMsg( 'api-help-param-maxchars', pi.parameters[ i ].maxchars ) )
+                                                       );
                                                }
                                                helpField = new OO.ui.FieldLayout(
                                                        new OO.ui.Widget( {
index 83a2612..5670ce4 100644 (file)
@@ -23,6 +23,7 @@
         * @cfg {boolean} [showImages] Show page images
         * @cfg {boolean} [showDescriptions] Show page descriptions
         * @cfg {boolean} [showMissing=true] Show missing pages
+        * @cfg {boolean} [addQueryInput=true] Add exact user's input query to results
         * @cfg {boolean} [excludeCurrentPage] Exclude the current page from suggestions
         * @cfg {boolean} [validateTitle=true] Whether the input must be a valid title (if set to true,
         *  the widget will marks itself red for invalid inputs, including an empty query).
@@ -46,6 +47,7 @@
                this.showImages = !!config.showImages;
                this.showDescriptions = !!config.showDescriptions;
                this.showMissing = config.showMissing !== false;
+               this.addQueryInput = config.addQueryInput !== false;
                this.excludeCurrentPage = !!config.excludeCurrentPage;
                this.validateTitle = config.validateTitle !== undefined ? config.validateTitle : true;
                this.cache = config.cache;
                }
 
                // Offer the exact text as a suggestion if the page exists
-               if ( pageExists && !pageExistsExact ) {
+               if ( this.addQueryInput && pageExists && !pageExistsExact ) {
                        titles.unshift( this.getQueryValue() );
                }
 
index 939b841..830ff33 100644 (file)
@@ -4,6 +4,15 @@
        var debug,
                hovzer = $.getFootHovzer();
 
+       OO.ui.getViewportSpacing = function () {
+               return {
+                       top: 0,
+                       right: 0,
+                       bottom: hovzer.$.outerHeight(),
+                       left: 0
+               };
+       };
+
        /**
         * Debug toolbar.
         *