Merge "Add ability to proxy thumbnail requests to a service"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 1 Feb 2018 17:43:10 +0000 (17:43 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 1 Feb 2018 17:43:11 +0000 (17:43 +0000)
17 files changed:
RELEASE-NOTES-1.31
composer.json
docs/extension.schema.v2.json
includes/diff/DifferenceEngine.php
includes/htmlform/HTMLFormElement.php
includes/htmlform/HTMLFormField.php
includes/http/MWHttpRequest.php
maintenance/resources/update-oojs-ui.sh
resources/src/mediawiki.rcfilters/styles/mw.rcfilters.less
resources/src/mediawiki.special/mediawiki.special.userlogin.login.css
resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js
resources/src/mediawiki.widgets.datetime/mediawiki.widgets.datetime.definitions.less
resources/src/mediawiki/htmlform/autoinfuse.js
resources/src/mediawiki/htmlform/htmlform.Element.js
resources/src/oojs-ui-local.css
resources/src/oojs-ui-local.js
tests/integration/includes/http/MWHttpRequestTestCase.php

index f4e81b9..5314925 100644 (file)
@@ -50,7 +50,7 @@ production.
 ==== Upgraded external libraries ====
 * Updated jquery.chosen from v0.9.14 to v1.8.2.
 * Updated composer/spdx-licenses from 1.1.4 to
-  1.2.0 (development dependency).
+  1.3.0 (development dependency).
 * Updated nikic/php-parser from 2.1.0 to 3.1.3
   (development dependency).
 * Updated wikimedia/ip-set from 1.1.0 to 1.2.0.
index 4596c4c..1730942 100644 (file)
@@ -49,7 +49,7 @@
                "zordius/lightncandy": "0.23"
        },
        "require-dev": {
-               "composer/spdx-licenses": "1.2.0",
+               "composer/spdx-licenses": "1.3.0",
                "hamcrest/hamcrest-php": "^2.0",
                "jakub-onderka/php-parallel-lint": "0.9.2",
                "jetbrains/phpstorm-stubs": "dev-master#1b9906084d6635456fcf3f3a01f0d7d5b99a578a",
index 51f9417..e13129b 100644 (file)
                },
                "SkinOOUIThemes": {
                        "type": "object",
-                       "description": "Map of skin names to OOjs UI themes to use. Same format as ResourceLoaderOOUIModule::$builtinSkinThemeMap."
+                       "description": "Map of skin names to OOUI themes to use. Same format as ResourceLoaderOOUIModule::$builtinSkinThemeMap."
                },
                "PasswordPolicy": {
                        "type": "object",
index 7e05be6..e76bffc 100644 (file)
@@ -650,6 +650,12 @@ class DifferenceEngine extends ContextSource {
                }
        }
 
+       /**
+        * @param WikiPage $page
+        * @param Revision $rev
+        *
+        * @return ParserOutput|bool False if the revision was not found
+        */
        protected function getParserOutput( WikiPage $page, Revision $rev ) {
                $parserOptions = $page->makeParserOptions( $this->getContext() );
 
index 66d6143..2830b9c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
 /**
- * Allows custom data specific to HTMLFormField to be set for OOjs UI forms. A matching JS widget
+ * Allows custom data specific to HTMLFormField to be set for OOUI forms. A matching JS widget
  * (defined in htmlform.Element.js) picks up the extra config when constructed using OO.ui.infuse().
  *
  * Currently only supports passing 'hide-if' data.
@@ -21,7 +21,7 @@ trait HTMLFormElement {
                        $this->addClasses( [ 'mw-htmlform-hide-if' ] );
                }
                if ( $this->modules ) {
-                       // JS code must be able to read this before infusing (before OOjs UI is even loaded),
+                       // JS code must be able to read this before infusing (before OOUI is even loaded),
                        // so we put this in a separate attribute (not with the rest of the config).
                        // And it's not needed anymore after infusing, so we don't put it in JS config at all.
                        $this->setAttributes( [ 'data-mw-modules' => implode( ',', $this->modules ) ] );
index 9c301e6..aab8811 100644 (file)
@@ -673,7 +673,7 @@ abstract class HTMLFormField {
        }
 
        /**
-        * Whether the field should be automatically infused. Note that all OOjs UI HTMLForm fields are
+        * Whether the field should be automatically infused. Note that all OOUI HTMLForm fields are
         * infusable (you can call OO.ui.infuse() on them), but not all are infused by default, since
         * there is no benefit in doing it e.g. for buttons and it's a small performance hit on page load.
         *
@@ -686,7 +686,7 @@ abstract class HTMLFormField {
 
        /**
         * Get the list of extra ResourceLoader modules which must be loaded client-side before it's
-        * possible to infuse this field's OOjs UI widget.
+        * possible to infuse this field's OOUI widget.
         *
         * @return string[]
         */
index fff72ec..ac16032 100644 (file)
@@ -181,7 +181,7 @@ abstract class MWHttpRequest implements LoggerAwareInterface {
         * @return MWHttpRequest
         * @see MWHttpRequest::__construct
         */
-       public static function factory( $url, $options = null, $caller = __METHOD__ ) {
+       public static function factory( $url, array $options = [], $caller = __METHOD__ ) {
                return \MediaWiki\MediaWikiServices::getInstance()
                        ->getHttpRequestFactory()
                        ->create( $url, $options, $caller );
index 799af4c..d1e6496 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash -eu
 
-# This script generates a commit that updates our copy of OOjs UI
+# This script generates a commit that updates our copy of OOUI
 
 if [ -n "${2:-}" ]
 then
@@ -20,7 +20,7 @@ git checkout composer.json
 git reset -- $TARGET_DIR
 git checkout -- $TARGET_DIR
 git fetch origin
-git checkout -B upstream-oojs-ui origin/master
+git checkout -B upstream-ooui origin/master
 
 # Fetch upstream version
 cd $NPM_DIR
@@ -31,10 +31,10 @@ else
        npm install oojs-ui
 fi
 
-OOJSUI_VERSION=$(node -e 'console.log(require("./node_modules/oojs-ui/package.json").version);')
-if [ "$OOJSUI_VERSION" == "" ]
+OOUI_VERSION=$(node -e 'console.log(require("./node_modules/oojs-ui/package.json").version);')
+if [ "$OOUI_VERSION" == "" ]
 then
-       echo 'Could not find OOjs UI version'
+       echo 'Could not find OOUI version'
        exit 1
 fi
 
@@ -68,15 +68,15 @@ rm -rf "$NPM_DIR"
 cd $REPO_DIR
 
 COMMITMSG=$(cat <<END
-Update OOjs UI to v$OOJSUI_VERSION
+Update OOUI to v$OOUI_VERSION
 
 Release notes:
- https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v$OOJSUI_VERSION
+ https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v$OOUI_VERSION
 END
 )
 
 # Update composer.json as well
-composer require oojs/oojs-ui $OOJSUI_VERSION --no-update
+composer require oojs/oojs-ui $OOUI_VERSION --no-update
 
 # Stage deletion, modification and creation of files. Then commit.
 git add --update $TARGET_DIR
index db439e3..413d45b 100644 (file)
                display: none;
        }
 
+       #jump-to-nav {
+               margin-top: -0.5em;
+               margin-bottom: 0.5em;
+       }
+
        // Make the watchlist-details message display while loading, but make it not take up any
        // space. This makes the min-height trick work better.
        .watchlistDetails {
index cf77a96..fe013bc 100644 (file)
@@ -8,7 +8,7 @@
        font-weight: bold;
 }
 
-/* Login Button, following `ButtonWidget (progressive)‎` from OOjs UI */
+/* Login Button, following 'ButtonWidget (progressive)' from OOUI */
 #mw-createaccount-join {
        background-color: #f8f9fa;
        color: #36c;
index 9233eef..05180fd 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * DateTimeInputWidgets can be used to input a date, a time, or a date and
         * time, in either UTC or the user's local timezone.
-        * Please see the [OOjs UI documentation on MediaWiki] [1] for more information and examples.
+        * Please see the [OOUI documentation on MediaWiki] [1] for more information and examples.
         *
         * This widget can be used inside a HTML form, such as a OO.ui.FormLayout.
         *
@@ -12,7 +12,7 @@
         *     var dateTimeInput = new mw.widgets.datetime.DateTimeInputWidget( {} )
         *     $( 'body' ).append( dateTimeInput.$element );
         *
-        * [1]: https://www.mediawiki.org/wiki/OOjs_UI/Widgets/Inputs
+        * [1]: https://www.mediawiki.org/wiki/OOUI/Widgets/Inputs
         *
         * @class
         * @extends OO.ui.InputWidget
index fa45d5a..a9c2dd2 100644 (file)
@@ -1,6 +1,6 @@
 /*!
- * OOJS-UI defines used by the existing CSS (will make it easier to put this
- * widget in OOJS-UI once OOJS-UI is capable of handling it)
+ * OOUI defines used by the existing CSS (will make it easier to put this
+ * widget in OOUI once OOUI is capable of handling it)
  */
 
 .oo-ui-box-sizing( @type: border-box ) {
index f2e0f4d..c39e43a 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * HTMLForm enhancements:
- * Infuse some OOjs UI HTMLForm fields (those which benefit from always being infused).
+ * Infuse some OOUI HTMLForm fields (those which benefit from always being infused).
  */
 ( function ( mw, $ ) {
 
index 4f672fc..01108e6 100644 (file)
@@ -3,7 +3,7 @@
        mw.htmlform = {};
 
        /**
-        * Allows custom data specific to HTMLFormField to be set for OOjs UI forms. This picks up the
+        * Allows custom data specific to HTMLFormField to be set for OOUI forms. This picks up the
         * extra config from a matching PHP widget (defined in HTMLFormElement.php) when constructed using
         * OO.ui.infuse().
         *
index 148c4c7..b98ba13 100644 (file)
@@ -1,4 +1,4 @@
-/* HACK: Set sane font-size for OOjs UI dialogs (and menus/popups inside the default overlay), in
+/* HACK: Set sane font-size for OOUI dialogs (and menus/popups inside the default overlay), in
    the most common case. This should be skin's responsibility, but alas our skins tend to have the
    weirdest font-sizes on body. This shall be removed when we make the MediaWiki skins bundled with
    tarball sane. (T91152) */
index dffa863..0c65512 100644 (file)
@@ -1,9 +1,9 @@
 ( function ( mw ) {
        var isMobile;
-       // Connect OOjs UI to MediaWiki's localisation system
+       // Connect OOUI to MediaWiki's localisation system
        OO.ui.getUserLanguages = mw.language.getFallbackLanguageChain;
        OO.ui.msg = mw.msg;
-       // Connect OOjs UI's deprecation warnings to MediaWiki's logging system
+       // Connect OOUI's deprecation warnings to MediaWiki's logging system
        OO.ui.warnDeprecation = function ( message ) {
                mw.track( 'mw.deprecate', 'oojs-ui' );
                mw.log.warn( message );
index 3b02e28..cc769d7 100644 (file)
@@ -195,6 +195,11 @@ abstract class MWHttpRequestTestCase extends PHPUnit_Framework_TestCase {
                $this->assertSame( 401, $request->getStatus() );
        }
 
+       public function testFactoryDefaults() {
+               $request = MWHttpRequest::factory( 'http://acme.test' );
+               $this->assertInstanceOf( MWHttpRequest::class, $request );
+       }
+
        // --------------------
 
        /**
@@ -242,4 +247,5 @@ abstract class MWHttpRequestTestCase extends PHPUnit_Framework_TestCase {
                $this->assertArrayNotHasKey( strtolower( $name ),
                        array_change_key_case( $cookieJar->cookie, CASE_LOWER ) );
        }
+
 }