merging latest master
[lhc/web/wiklou.git] / resources / mediawiki / mediawiki.htmlform.js
index 1a6acd6..df62105 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * Utility functions for jazzing up HTMLForm elements
  */
-( function( $ ) { 
+( function ( $ ) {
 
 /**
  * jQuery plugin to fade or snap to visible state.
@@ -9,8 +9,8 @@
  * @param boolean instantToggle (optional)
  * @return jQuery
  */
-$.fn.goIn = function( instantToggle ) {
-       if ( instantToggle !== undefined && instantToggle === true ) {
+$.fn.goIn = function ( instantToggle ) {
+       if ( instantToggle === true ) {
                return $(this).show();
        }
        return $(this).stop( true, true ).fadeIn();
@@ -22,8 +22,8 @@ $.fn.goIn = function( instantToggle ) {
  * @param boolean instantToggle (optional)
  * @return jQuery
  */
-$.fn.goOut = function( instantToggle ) {
-       if ( instantToggle !== undefined && instantToggle === true ) {
+$.fn.goOut = function ( instantToggle ) {
+       if ( instantToggle === true ) {
                return $(this).hide();
        }
        return $(this).stop( true, true ).fadeOut();
@@ -35,20 +35,20 @@ $.fn.goOut = function( instantToggle ) {
  * @param callback function taking one paramter, which is Bool true when the event
  *     is called immediately, and the EventArgs object when triggered from an event
  */
-$.fn.liveAndTestAtStart = function( callback ){
+$.fn.liveAndTestAtStart = function ( callback ){
        $(this)
                .live( 'change', callback )
-               .each( function( index, element ){
+               .each( function ( index, element ){
                        callback.call( this, true );
                } );
 };
 
 // Document ready:
-$( function() {
+$( function () {
 
        // Animate the SelectOrOther fields, to only show the text field when
        // 'other' is selected.
-       $( '.mw-htmlform-select-or-other' ).liveAndTestAtStart( function( instant ) {
+       $( '.mw-htmlform-select-or-other' ).liveAndTestAtStart( function ( instant ) {
                var $other = $( '#' + $(this).attr( 'id' ) + '-other' );
                $other = $other.add( $other.siblings( 'br' ) );
                if ( $(this).val() === 'other' ) {
@@ -61,4 +61,4 @@ $( function() {
 });
 
 
-})( jQuery );
+}( jQuery ) );