Special:Preferences Remove red box in email and changed confirm error to warning
authorKrzysztof Zbudniewek <krzysztof.zbudniewek@gmail.com>
Sun, 13 Dec 2015 00:56:47 +0000 (01:56 +0100)
committerKrzysztof Zbudniewek <krzysztof.zbudniewek@gmail.com>
Mon, 14 Dec 2015 17:50:07 +0000 (18:50 +0100)
As @matmarex suggested I used the same colors for warning as in shared.css for .warningbox

Bug: T58611
Change-Id: Icba7787db4cc77ee793b9637c60b5977d28dc8cf

includes/Preferences.php
resources/src/mediawiki.special/mediawiki.special.preferences.styles.css
tests/phpunit/includes/PreferencesTest.php

index c7ab9cd..327d19a 100644 (file)
@@ -508,7 +508,6 @@ class Preferences {
                                                # Apply the same CSS class used on the input to the message:
                                                'cssclass' => $emailauthenticationclass,
                                        );
-                                       $defaultPreferences['emailaddress']['cssclass'] = $emailauthenticationclass;
                                }
                        }
 
index 5b76712..4a797a6 100644 (file)
@@ -1,9 +1,9 @@
-/* Reuses colors from mediawiki.special.changeemail.css */
+/* Reuses colors from mediawiki.legacy/shared.css */
 .mw-email-not-authenticated .mw-input,
 .mw-email-none .mw-input{
-       border: 1px solid #FF8080;
-       background-color: #FFC0C0;
-       color: black;
+       border: 1px solid #fde29b;
+       background-color: #fdf1d1;
+       color: #000000;
 }
 /* Authenticated email field has its own class too. Unstyled by default */
 /*
index 5841bb6..fe431b6 100644 (file)
@@ -45,36 +45,36 @@ class PreferencesTest extends MediaWikiTestCase {
         * Placeholder to verify bug 34302
         * @covers Preferences::profilePreferences
         */
-       public function testEmailFieldsWhenUserHasNoEmail() {
+       public function testEmailAuthenticationFieldWhenUserHasNoEmail() {
                $prefs = $this->prefsFor( 'noemail' );
                $this->assertArrayHasKey( 'cssclass',
-                       $prefs['emailaddress']
+                       $prefs['emailauthentication']
                );
-               $this->assertEquals( 'mw-email-none', $prefs['emailaddress']['cssclass'] );
+               $this->assertEquals( 'mw-email-none', $prefs['emailauthentication']['cssclass'] );
        }
 
        /**
         * Placeholder to verify bug 34302
         * @covers Preferences::profilePreferences
         */
-       public function testEmailFieldsWhenUserEmailNotAuthenticated() {
+       public function testEmailAuthenticationFieldWhenUserEmailNotAuthenticated() {
                $prefs = $this->prefsFor( 'notauth' );
                $this->assertArrayHasKey( 'cssclass',
-                       $prefs['emailaddress']
+                       $prefs['emailauthentication']
                );
-               $this->assertEquals( 'mw-email-not-authenticated', $prefs['emailaddress']['cssclass'] );
+               $this->assertEquals( 'mw-email-not-authenticated', $prefs['emailauthentication']['cssclass'] );
        }
 
        /**
         * Placeholder to verify bug 34302
         * @covers Preferences::profilePreferences
         */
-       public function testEmailFieldsWhenUserEmailIsAuthenticated() {
+       public function testEmailAuthenticationFieldWhenUserEmailIsAuthenticated() {
                $prefs = $this->prefsFor( 'auth' );
                $this->assertArrayHasKey( 'cssclass',
-                       $prefs['emailaddress']
+                       $prefs['emailauthentication']
                );
-               $this->assertEquals( 'mw-email-authenticated', $prefs['emailaddress']['cssclass'] );
+               $this->assertEquals( 'mw-email-authenticated', $prefs['emailauthentication']['cssclass'] );
        }
 
        /** Helper */