From: Bartosz DziewoƄski Date: Mon, 25 Jul 2016 10:59:28 +0000 (+0200) Subject: mediawiki.special.userlogin.signup: Remove unnecessary field hiding code X-Git-Tag: 1.31.0-rc.0~6260^2~1 X-Git-Url: http://git.cyclocoop.org/data/%24oldEdit?a=commitdiff_plain;h=23e5bcb767c57d3a3f90b9fc597b87c8706a4027;p=lhc%2Fweb%2Fwiklou.git mediawiki.special.userlogin.signup: Remove unnecessary field hiding code We now use HTMLForm, which implements a generic method to do this using 'hide-if' parameters. We already use it for the signup form too. This is just dead code. Change-Id: I35cfc31aae714f3be8aa0d044de1119c279e3d34 --- diff --git a/resources/src/mediawiki.special/mediawiki.special.userlogin.signup.js b/resources/src/mediawiki.special/mediawiki.special.userlogin.signup.js index 24f54d0ada..770a2f074c 100644 --- a/resources/src/mediawiki.special/mediawiki.special.userlogin.signup.js +++ b/resources/src/mediawiki.special/mediawiki.special.userlogin.signup.js @@ -2,34 +2,6 @@ * JavaScript for signup form. */ ( function ( mw, $ ) { - // When sending password by email, hide the password input fields. - $( function () { - // Always required if checked, otherwise it depends, so we use the original - var $emailLabel = $( 'label[for="wpEmail"]' ), - originalText = $emailLabel.text(), - requiredText = mw.message( 'createacct-emailrequired' ).text(), - $createByMailCheckbox = $( '#wpCreateaccountMail' ), - $beforePwds = $( '.mw-row-password:first' ).prev(), - $pwds; - - function updateForCheckbox() { - var checked = $createByMailCheckbox.prop( 'checked' ); - if ( checked ) { - $pwds = $( '.mw-row-password' ).detach(); - $emailLabel.text( requiredText ); - } else { - if ( $pwds ) { - $beforePwds.after( $pwds ); - $pwds = null; - } - $emailLabel.text( originalText ); - } - } - - $createByMailCheckbox.on( 'change', updateForCheckbox ); - updateForCheckbox(); - } ); - // Check if the username is invalid or already taken $( function () { var