From 28c98539cd0fd4a1cf5e9ce7662b7a360fb64dbb Mon Sep 17 00:00:00 2001 From: Krzysztof Zbudniewek Date: Sun, 13 Dec 2015 01:56:47 +0100 Subject: [PATCH] Special:Preferences Remove red box in email and changed confirm error to warning As @matmarex suggested I used the same colors for warning as in shared.css for .warningbox Bug: T58611 Change-Id: Icba7787db4cc77ee793b9637c60b5977d28dc8cf --- includes/Preferences.php | 1 - .../mediawiki.special.preferences.styles.css | 8 ++++---- tests/phpunit/includes/PreferencesTest.php | 18 +++++++++--------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/includes/Preferences.php b/includes/Preferences.php index c7ab9cddc9..327d19ae37 100644 --- a/includes/Preferences.php +++ b/includes/Preferences.php @@ -508,7 +508,6 @@ class Preferences { # Apply the same CSS class used on the input to the message: 'cssclass' => $emailauthenticationclass, ); - $defaultPreferences['emailaddress']['cssclass'] = $emailauthenticationclass; } } diff --git a/resources/src/mediawiki.special/mediawiki.special.preferences.styles.css b/resources/src/mediawiki.special/mediawiki.special.preferences.styles.css index 5b76712149..4a797a67f7 100644 --- a/resources/src/mediawiki.special/mediawiki.special.preferences.styles.css +++ b/resources/src/mediawiki.special/mediawiki.special.preferences.styles.css @@ -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 */ /* diff --git a/tests/phpunit/includes/PreferencesTest.php b/tests/phpunit/includes/PreferencesTest.php index 5841bb6f07..fe431b6673 100644 --- a/tests/phpunit/includes/PreferencesTest.php +++ b/tests/phpunit/includes/PreferencesTest.php @@ -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 */ -- 2.20.1