Merge "Revert "(bug 30625) Add, to every API upload response, the warnings raised.""
[lhc/web/wiklou.git] / resources / mediawiki / mediawiki.htmlform.js
index 0b8cf83..17a02cf 100644 (file)
@@ -1,17 +1,29 @@
 /**
  * Utility functions for jazzing up HTMLForm elements
  */
-( function( $ ) { 
+( function( $ ) {
 
-// Fade or snap depending on argument
+/**
+ * jQuery plugin to fade or snap to visible state.
+ *
+ * @param boolean instantToggle (optional)
+ * @return jQuery
+ */
 $.fn.goIn = function( instantToggle ) {
-       if ( typeof instantToggle != 'undefined' && instantToggle === true ) {
+       if ( instantToggle === true ) {
                return $(this).show();
        }
        return $(this).stop( true, true ).fadeIn();
 };
+
+/**
+ * jQuery plugin to fade or snap to hiding state.
+ *
+ * @param boolean instantToggle (optional)
+ * @return jQuery
+ */
 $.fn.goOut = function( instantToggle ) {
-       if ( typeof instantToggle != 'undefined' && instantToggle === true ) {
+       if ( instantToggle === true ) {
                return $(this).hide();
        }
        return $(this).stop( true, true ).fadeOut();
@@ -34,12 +46,12 @@ $.fn.liveAndTestAtStart = function( callback ){
 // Document ready:
 $( function() {
 
-       // animate the SelectOrOther fields, to only show the text field when
-       // 'other' is selected
+       // Animate the SelectOrOther fields, to only show the text field when
+       // 'other' is selected.
        $( '.mw-htmlform-select-or-other' ).liveAndTestAtStart( function( instant ) {
                var $other = $( '#' + $(this).attr( 'id' ) + '-other' );
                $other = $other.add( $other.siblings( 'br' ) );
-               if ( $(this).val() == 'other' ) {
+               if ( $(this).val() === 'other' ) {
                        $other.goIn( instant );
                } else {
                        $other.goOut( instant );
@@ -49,4 +61,4 @@ $( function() {
 });
 
 
-})( jQuery );
\ No newline at end of file
+})( jQuery );