From d9022f63880ce039446fba8364f68e656b7bf4cb Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 3 May 2012 13:01:35 +0200 Subject: Update to MediaWiki 1.19.0 --- .../mediawiki.special.preferences.js | 43 ++-------------------- 1 file changed, 4 insertions(+), 39 deletions(-) (limited to 'resources/mediawiki.special/mediawiki.special.preferences.js') diff --git a/resources/mediawiki.special/mediawiki.special.preferences.js b/resources/mediawiki.special/mediawiki.special.preferences.js index 2e07e7f1..b7200826 100644 --- a/resources/mediawiki.special/mediawiki.special.preferences.js +++ b/resources/mediawiki.special/mediawiki.special.preferences.js @@ -22,7 +22,7 @@ $legends.each( function( i, legend ) { $legend.parent().show(); } var ident = $legend.parent().attr( 'id' ); - + var $li = $( '
  • ', { 'class' : ( i === 0 ) ? 'selected' : null }); @@ -37,7 +37,7 @@ $legends.each( function( i, legend ) { var scrollTop = $(window).scrollTop(); window.location.hash = $(this).attr('href'); $(window).scrollTop(scrollTop); - + $preftoc.find( 'li' ).removeClass( 'selected' ); $(this).parent().addClass( 'selected' ); $( '#preferences > fieldset' ).hide(); @@ -58,41 +58,6 @@ $( function() { } } ); -/** - * Given an email validity status (true, false, null) update the label CSS class - */ -var updateMailValidityLabel = function( mail ) { - var isValid = mw.util.validateEmail( mail ), - $label = $( '#mw-emailaddress-validity' ); - - // We allow empty address - if( isValid === null ) { - $label.text( '' ).removeClass( 'valid invalid' ); - - // Valid - } else if ( isValid ) { - $label.text( mw.msg( 'email-address-validity-valid' ) ).addClass( 'valid' ).removeClass( 'invalid' ); - - // Not valid - } else { - $label.text( mw.msg( 'email-address-validity-invalid' ) ).addClass( 'invalid' ).removeClass( 'valid' ); - } -}; - -// Lame tip to let user know if its email is valid. See bug 22449 -// Only bind once for 'blur' so that the user can fill it in without errors -// After that look at every keypress for direct feedback if it was invalid onblur -$( '#mw-input-wpemailaddress' ).one( 'blur', function() { - if ( $( '#mw-emailaddress-validity' ).length === 0 ) { - $(this).after( '' ); - } - updateMailValidityLabel( $(this).val() ); - $(this).keyup( function() { - updateMailValidityLabel( $(this).val() ); - } ); -} ); - - /** * Timezone functions. @@ -145,7 +110,7 @@ var updateTimezoneSelection = function() { $tzTextbox.val( minutesToHours( minuteDiff ) ); $tzSelect.val( 'other' ); $tzTextbox.get( 0 ).disabled = false; - } else if ( type == 'other' ) { + } else if ( type == 'other' ) { // Grab data from the textbox, parse it. minuteDiff = hoursToMinutes( $tzTextbox.val() ); } else { @@ -172,4 +137,4 @@ if ( $tzSelect.length && $tzTextbox.length ) { $tzTextbox.blur( function() { updateTimezoneSelection(); } ); updateTimezoneSelection(); } -} )( jQuery, mediaWiki ); +} )( jQuery, mediaWiki ); \ No newline at end of file -- cgit v1.2.3-54-g00ecf