* 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() {
// 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,
}
$( 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 ) );
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%;
+}