jenkins-bot has submitted this change and it was merged. Change subject: Additional styling for CAPTCHA on Special:UserLogin ......................................................................
Additional styling for CAPTCHA on Special:UserLogin Bug: 56370 Change-Id: Ic1d021e8e3604777e20a08a0e07281567ef522c4 --- M includes/specials/SpecialUserlogin.php M resources/mediawiki.special/mediawiki.special.createAccount.js M resources/mediawiki.special/mediawiki.special.userLogin.css 3 files changed, 53 insertions(+), 6 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/specials/SpecialUserlogin.php b/includes/specials/SpecialUserlogin.php index 9764c9f..e701e0f 100644 --- a/includes/specials/SpecialUserlogin.php +++ b/includes/specials/SpecialUserlogin.php @@ -1118,6 +1118,10 @@ 'mediawiki.special.userlogin' ) ); + $out->addModules( array( + 'mediawiki.special.createaccount.js' + ) ); + $q = 'action=submitlogin&type=login'; $linkq = 'type=signup'; } diff --git a/resources/mediawiki.special/mediawiki.special.createAccount.js b/resources/mediawiki.special/mediawiki.special.createAccount.js index 5cbb1ee..609b2dd 100644 --- a/resources/mediawiki.special/mediawiki.special.createAccount.js +++ b/resources/mediawiki.special/mediawiki.special.createAccount.js @@ -2,7 +2,6 @@ * JavaScript for Create account form (Special:UserLogin?type=signup). */ ( function ( mw, $ ) { - // When sending password by email, hide the password input fields. // This function doesn't need to be loaded early by ResourceLoader, but is tiny. function hidePasswordOnEmail() { @@ -34,9 +33,8 @@ // Move the FancyCaptcha image into a more attractive container. // This function does need to be run early by ResourceLoader. - function adjustFancyCaptcha() { - var $content = $( '#mw-content-text' ), - $submit = $content.find( '#wpCreateaccount' ), + function adjustFancyCaptcha( $content, buttonSubmit ) { + var $submit = $content.find( buttonSubmit ), tabIndex, $captchaStuff, $captchaImageContainer, @@ -105,8 +103,22 @@ } $( function () { - adjustFancyCaptcha(); - hidePasswordOnEmail(); + // Checks if the current page is Special:UserLogin + var isLogin = false, + $content = $( '#mw-content-text' ), + buttonSubmit = '#wpCreateaccount'; + + if ( $content.find( buttonSubmit ).length === 0 ) { + buttonSubmit = '#wpLoginAttempt'; + isLogin = true; + } + + adjustFancyCaptcha( $content, buttonSubmit ); + + if ( !isLogin ) { + hidePasswordOnEmail(); + } + } ); }( mediaWiki, jQuery ) ); diff --git a/resources/mediawiki.special/mediawiki.special.userLogin.css b/resources/mediawiki.special/mediawiki.special.userLogin.css index 24c8d77..cf9eaa0 100644 --- a/resources/mediawiki.special/mediawiki.special.userLogin.css +++ b/resources/mediawiki.special/mediawiki.special.userLogin.css @@ -37,3 +37,34 @@ width: auto; display: inline-block; } + +/**** shuffled CAPTCHA ****/ +#wpCaptchaWord { + margin-top: 6px; +} + +.mw-createacct-captcha-container { + background-color: #f8f8f8; + border: 1px solid #c9c9c9; + padding: 10px; + text-align: center; +} + +.mw-createacct-captcha-assisted { + display: block; + margin-top: 0.5em; +} + +/* Put a border around the fancycaptcha-image-container. */ +.mw-createacct-captcha-and-reload { + border: 1px solid #c9c9c9; + display: table-cell; /* Other display formats end up too wide */ + width: 270px; + background-color: #FFF; +} + +/* Make the fancycaptcha-image-container full-width within its parent. */ +.fancycaptcha-image-container +{ + width: 100%; +} -- To view, visit https://gerrit.wikimedia.org/r/98357 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic1d021e8e3604777e20a08a0e07281567ef522c4 Gerrit-PatchSet: 9 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Jcf2000 <jaredflores2...@gmail.com> Gerrit-Reviewer: Bartosz Dziewoński <matma....@gmail.com> Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net> Gerrit-Reviewer: Jcf2000 <jaredflores2...@gmail.com> Gerrit-Reviewer: Parent5446 <tylerro...@gmail.com> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits