Merge "EditPage: Remove legacy non-OOUI render mode"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 22 Aug 2017 22:54:26 +0000 (22:54 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 22 Aug 2017 22:54:26 +0000 (22:54 +0000)
includes/registration/ExtensionProcessor.php
maintenance/resources/update-oojs-ui.sh
resources/Resources.php
resources/lib/oojs-ui/wikimedia-ui-base.less [new file with mode: 0644]
resources/src/jquery/jquery.badge.css
resources/src/mediawiki.legacy/shared.css
resources/src/mediawiki.less/mediawiki.ui/variables.less
resources/src/mediawiki.special/mediawiki.special.apisandbox.css
resources/src/mediawiki/htmlform/styles.css
resources/src/mediawiki/mediawiki.apihelp.css
tests/phpunit/includes/registration/ExtensionProcessorTest.php

index 14d8222..ce262bd 100644 (file)
@@ -450,7 +450,7 @@ class ExtensionProcessor implements Processor {
                        }
                        foreach ( $info['config'] as $key => $val ) {
                                if ( $key[0] !== '@' ) {
-                                       $this->addConfigGlobal( "$prefix$key", $val );
+                                       $this->globals["$prefix$key"] = $val;
                                }
                        }
                }
@@ -478,26 +478,11 @@ class ExtensionProcessor implements Processor {
                                if ( isset( $data['path'] ) && $data['path'] ) {
                                        $value = "$dir/$value";
                                }
-                               $this->addConfigGlobal( "$prefix$key", $value );
+                               $this->globals["$prefix$key"] = $value;
                        }
                }
        }
 
-       /**
-        * Helper function to set a value to a specific global, if it isn't set already.
-        *
-        * @param string $key The config key with the prefix and anything
-        * @param mixed $value The value of the config
-        */
-       private function addConfigGlobal( $key, $value ) {
-               if ( array_key_exists( $key, $this->globals ) ) {
-                       throw new RuntimeException(
-                               "The configuration setting '$key' was already set by another extension,"
-                               . " and cannot be set again." );
-               }
-               $this->globals[$key] = $value;
-       }
-
        protected function extractServiceWiringFiles( $dir, array $info ) {
                if ( isset( $info['ServiceWiringFiles'] ) ) {
                        foreach ( $info['ServiceWiringFiles'] as $path ) {
index bfa359f..799af4c 100755 (executable)
@@ -59,6 +59,7 @@ cp -R ./node_modules/oojs-ui/dist/themes/wikimediaui/images "$REPO_DIR/$TARGET_D
 cp ./node_modules/oojs-ui/src/themes/wikimediaui/*.json "$REPO_DIR/$TARGET_DIR/themes/wikimediaui"
 cp -R ./node_modules/oojs-ui/dist/themes/apex/images "$REPO_DIR/$TARGET_DIR/themes/apex"
 cp ./node_modules/oojs-ui/src/themes/apex/*.json "$REPO_DIR/$TARGET_DIR/themes/apex"
+cp ./node_modules/oojs-ui/dist/wikimedia-ui-base.less "$REPO_DIR/$TARGET_DIR"
 
 # Clean up temporary area
 rm -rf "$NPM_DIR"
index 0e98c86..4a7f3e4 100644 (file)
@@ -2695,7 +2695,10 @@ return [
        // This contains only the styles required by core widgets.
        'oojs-ui-core.styles' => [
                'class' => 'ResourceLoaderOOUIFileModule',
-               'styles' => 'resources/src/oojs-ui-local.css', // HACK, see inside the file
+               'styles' => [
+                       'resources/lib/oojs-ui/wikimedia-ui-base.less', // Providing Wikimedia UI LESS variables to all
+                       'resources/src/oojs-ui-local.css', // HACK, see inside the file
+               ],
                'themeStyles' => 'core',
                'targets' => [ 'desktop', 'mobile' ],
        ],
diff --git a/resources/lib/oojs-ui/wikimedia-ui-base.less b/resources/lib/oojs-ui/wikimedia-ui-base.less
new file mode 100644 (file)
index 0000000..d450dbc
--- /dev/null
@@ -0,0 +1,153 @@
+/**
+ * WikimediaUI Base v0.9.2
+ * Wikimedia Foundation user interface base variables
+ */
+
+/* Colors */
+// WikimediaUI (WMUI) color palette
+@wmui-color-base0:    #000;    // = HSB 0°, 0%, 0%
+@wmui-color-base10:   #222;    // = HSB 0°, 0%, 13%
+@wmui-color-base20:   #54595d; // = HSB 207°, 10%, 36%; WCAG 2.0 level AAA 7.09:1 contrast ratio on `#fff`
+@wmui-color-base30:   #72777d; // = HSB 210°, 9%, 49%; WCAG 2.0 level AA at 4.52:1 contrast ratio on `#fff`
+@wmui-color-base50:   #a2a9b1; // = HSB 212°, 8%, 69%
+@wmui-color-base70:   #c8ccd1; // = HSB 213°, 4%, 82%
+@wmui-color-base80:   #eaecf0; // = HSB 220°, 3%, 94%
+@wmui-color-base90:   #f8f9fa; // = HSB 210°, 1%, 98%
+@wmui-color-base100:  #fff;    // = HSB 0°, 0%, 100%
+
+@wmui-color-accent30: #2a4b8d; // = HSB 220°, 70%, 55%
+@wmui-color-accent50: #36c;    // = HSB 220°, 75%, 80%
+@wmui-color-accent90: #eaf3ff; // = HSB 214°, 8%, 100%
+
+@wmui-color-red30:    #b32424; // = HSB 360°, 80%, 70%
+@wmui-color-red50:    #d33;    // = HSB 360°, 77%, 87%
+@wmui-color-red90:    #fee7e6; // = HSB 3°, 9%, 100%
+
+@wmui-color-yellow30: #ac6600; // = HSB 36°, 100%, 67%
+@wmui-color-yellow50: #fc3;    // = HSB 45°, 80%, 100%
+@wmui-color-yellow90: #fef6e7; // = HSB 39°, 9%, 100%
+
+@wmui-color-green30:  #14866d; // = HSB 167°, 85%, 53%
+@wmui-color-green50:  #00af89; // = HSB 167°, 100%, 69%
+@wmui-color-green90:  #d5fdf4; // = HSB 166°, 16%, 99%
+
+// Background Colors
+@background-color-base:       @wmui-color-base100;
+@background-color-code:       @wmui-color-base90;
+// 'Framed' UI elements (Framed Buttons, Dropdowns, ToggleSwitches...)
+@background-color-framed:     @wmui-color-base90;
+@background-color-framed--hover: @wmui-color-base100;
+@background-color-framed--active: @wmui-color-base70;
+// Tabs Navigation Background Color
+@background-color-tabs:       @wmui-color-base80;
+// Highlight Colors, RGBA Colors include hex fallback on `#fff` for IE 6/7/8
+@background-color-highlight:  rgba( 255, 182, 13, 0.4 );
+@background-color-highlight--fallback: #ffe29e;
+
+// Foreground Colors
+@color-base:                  @wmui-color-base10;
+@color-base--hover:           #444;
+@color-base--active:          @wmui-color-base0;
+@color-base--inverted:        @wmui-color-base100;
+@color-base--emphasized:      @wmui-color-base0;
+@color-base--subtle:          @wmui-color-base30;
+@color-base--disabled:        @wmui-color-base30;
+@color-filled--disabled:      @color-base--inverted;
+@color-placeholder:           @wmui-color-base30;
+// Primary 'Progressive' Color, Background Color and states
+@background-color-primary:    @wmui-color-accent90;
+@background-color-primary--hover: rgba( 41, 98, 204, 0.1 );
+@color-primary:               @wmui-color-accent50;
+@color-primary--hover:        #447ff5; // = `lighten( @color-primary, 3 )`
+@color-primary--active:       @wmui-color-accent30;
+@color-primary--focus:        @color-primary;
+// 'Destructive' Color, Background Color and states
+@background-color-destructive: @wmui-color-red90;
+@color-destructive:           @wmui-color-red50;
+@color-destructive--hover:    #ff4242;
+@color-destructive--active:   @wmui-color-red30;
+@color-destructive--focus:    @color-destructive;
+// Secondary Color and states (links only)
+@color-secondary:             @wmui-color-green50;
+@color-secondary--hover:      #1c6665;
+@color-secondary--active:     @wmui-color-green30;
+@color-secondary--focus:      @color-secondary;
+// Validation error feedback
+@color-erroneous:             @wmui-color-red50;
+
+
+// Opacity
+@opacity-base:                1;
+@opacity-base--disabled:      0.51; // = `#7d7d7d` on `background-color: #fff`; HSB 0°, 0%, 49%
+@opacity-icon-base:           0.87; // = `#222` on `background-color: #fff`
+@opacity-icon-base--hover:    0.73; // = `#454545` on `background-color: #fff`, closest to `#444`
+@opacity-icon-base--selected: 1;
+
+
+/* Positioning */
+// Z-Index
+@z-index-base:                0;
+
+
+/* Box Model properties */
+/* Max Widths */
+@max-width-button:            28.75em; // = `460px` at `16px` base, see T95367
+@max-width-input-inline:      100%;
+
+// Border
+@border-base:                 @border-width-base solid @border-color-base;
+@border-dialog:               @border-base;
+@border-menu:                 @border-base;
+// Border Colors
+@border-color-base:           @wmui-color-base50;
+@border-color-base--hover:    @wmui-color-base50;
+@border-color-base--active:   @wmui-color-base30;
+@border-color-base--disabled: @color-base--disabled;
+@border-color-filled--disabled: @color-filled--disabled;
+@border-color-primary--active: #859dcc;
+@border-color-destructive--active: #b77c79;
+@border-color-inset--focus:   @color-base--inverted;
+@border-color-heading:        @wmui-color-base70;
+// Border Widths
+@border-width-base:           1px;
+// Border Radius
+@border-radius-base:          2px;
+
+// Box Shadows
+@box-shadow-base--focus:      inset 0 0 0 1px @wmui-color-accent50;
+@box-shadow-primary--focus:   inset 0 0 0 1px @color-primary, inset 0 0 0 2px @color-base--inverted;
+@box-shadow-inset--inverted:  inset 0 0 0 1px @color-base--inverted;
+@box-shadow-filled--disabled: inset 0 0 0 1px @color-filled--disabled;
+@box-shadow-dialog:           0 2px 2px 0 rgba( 0, 0, 0, 0.25 );
+@box-shadow-menu:             @box-shadow-dialog;
+
+
+/* Typography incl. print properties */
+// Font Families
+@font-family-base:            @font-family-sans;
+@font-family-heading-main:    @font-family-serif;
+@font-family-sans:            'Helvetica Neue', 'Helvetica', 'Nimbus Sans L', 'Arial', 'Liberation Sans', sans-serif;
+@font-family-sans--fallback:  sans-serif;
+@font-family-serif:           'Linux Libertine', 'Georgia', 'Times', serif;
+@font-family-serif--fallback: serif;
+// Line Heights
+@line-height-base:            1.6;
+@line-height-heading:         1.25;
+@text-decoration-link--hover: none;
+// Text Shadows
+@text-shadow-base:            0 1px 1px @color-base--inverted; // 'coined' effect
+@text-shadow-base--disabled:  @text-shadow-base;
+
+
+/* Other Properties */
+// Cursors
+@cursor-base--disabled:       default;
+
+
+/* Animation & Transition */
+// Transitions
+@transition-base:             @transition-duration-base;
+@transition-medium:           @transition-duration-medium;
+// Transitions > Durations
+@transition-duration-base:    100ms;
+@transition-duration-medium:  250ms;
index 8e0e512..2dbd4a5 100644 (file)
@@ -32,5 +32,5 @@
 }
 
 .mw-badge-important {
-       background-color: #c00;
+       background-color: #d33;
 }
index 1efcdd0..fbc9816 100644 (file)
@@ -153,7 +153,7 @@ span.history-deleted {
 
 .unpatrolled {
        font-weight: bold;
-       color: #f00;
+       color: #d33;
 }
 
 div.patrollink {
@@ -389,7 +389,7 @@ table.wikitable > caption {
 }
 
 .error {
-       color: #c00;
+       color: #d33;
 }
 
 .warning {
@@ -423,7 +423,7 @@ table.wikitable > caption {
 }
 
 .errorbox {
-       color: #c00;
+       color: #d33;
        border-color: #fac5c5;
        background-color: #fae3e3;
 }
@@ -460,7 +460,7 @@ table.wikitable > caption {
 
 /* Note on preview page */
 .previewnote {
-       color: #c00;
+       color: #d33;
        margin-bottom: 1em;
 }
 
index 0ad791b..0c897dc 100644 (file)
@@ -41,7 +41,7 @@
 @colorButtonTextHighlight: @colorGray4;
 @colorButtonTextActive: @colorGray1;
 @colorDisabledText: @colorGray12;
-@colorErrorText: #c00;
+@colorErrorText: #d33;
 @colorWarningText: #705000;
 
 // UI colors
index 99d0222..750a567 100644 (file)
 
 .apihelp-deprecated {
        font-weight: bold;
-       color: #f00;
+       color: #d33;
 }
 
 .apihelp-deprecated-value .oo-ui-labelElement-label {
index a36b379..0f331ee 100644 (file)
@@ -9,7 +9,7 @@ table.mw-htmlform-nolabel td.mw-label {
 }
 
 .mw-htmlform-invalid-input td.mw-input input {
-       border-color: #f00;
+       border-color: #d33;
 }
 
 .mw-htmlform-flatlist div.mw-htmlform-flatlist-item {
index bd4741d..7ef32ea 100644 (file)
@@ -37,7 +37,7 @@ div.apihelp-linktrail {
 .apihelp-flag-deprecated,
 .apihelp-flag-internal strong {
        font-weight: bold;
-       color: #f00;
+       color: #d33;
 }
 
 .apihelp-deprecated-value {
index 5ef30e8..7b56def 100644 (file)
@@ -220,48 +220,6 @@ class ExtensionProcessorTest extends MediaWikiTestCase {
                $this->assertEquals( 'somevalue', $extracted['globals']['egBar'] );
        }
 
-       /**
-        * @covers ExtensionProcessor::addConfigGlobal()
-        * @expectedException RuntimeException
-        */
-       public function testDuplicateConfigKey1() {
-               $processor = new ExtensionProcessor;
-               $info = [
-                       'config' => [
-                               'Bar' => '',
-                       ]
-               ] + self::$default;
-               $info2 = [
-                       'config' => [
-                               'Bar' => 'g',
-                       ],
-                       'name' => 'FooBar2',
-               ];
-               $processor->extractInfo( $this->dir, $info, 1 );
-               $processor->extractInfo( $this->dir, $info2, 1 );
-       }
-
-       /**
-        * @covers ExtensionProcessor::addConfigGlobal()
-        * @expectedException RuntimeException
-        */
-       public function testDuplicateConfigKey2() {
-               $processor = new ExtensionProcessor;
-               $info = [
-                       'config' => [
-                               'Bar' => [ 'value' => 'somevalue' ],
-                       ]
-               ] + self::$default;
-               $info2 = [
-                       'config' => [
-                               'Bar' => [ 'value' => 'somevalue' ],
-                       ],
-                       'name' => 'FooBar2',
-               ];
-               $processor->extractInfo( $this->dir, $info, 2 );
-               $processor->extractInfo( $this->dir, $info2, 2 );
-       }
-
        public static function provideExtractExtensionMessagesFiles() {
                $dir = __DIR__ . '/FooBar/';
                return [