Merge "Unify handling of *-message(s) settings in HTMLForm"
[lhc/web/wiklou.git] / resources / src / mediawiki.special / mediawiki.special.search.js
index b27fe34..ab83e1a 100644 (file)
                        $( '<label>' )
                                .text( mw.msg( 'powersearch-togglelabel' ) )
                ).append(
-                       $( '<input type="button" />' )
+                       $( '<input>' ).attr( 'type', 'button' )
                                .attr( 'id', 'mw-search-toggleall' )
                                .prop( 'value', mw.msg( 'powersearch-toggleall' ) )
                                .click( function () {
                                        $checkboxes.prop( 'checked', true );
                                } )
                ).append(
-                       $( '<input type="button" />' )
+                       $( '<input>' ).attr( 'type', 'button' )
                                .attr( 'id', 'mw-search-togglenone' )
                                .prop( 'value', mw.msg( 'powersearch-togglenone' ) )
                                .click( function () {
                                var parts = $( this ).attr( 'href' ).split( 'search=' ),
                                        lastpart = '',
                                        prefix = 'search=';
-                               if ( parts.length > 1 && parts[1].indexOf( '&' ) !== -1 ) {
-                                       lastpart = parts[1].slice( parts[1].indexOf( '&' ) );
+                               if ( parts.length > 1 && parts[ 1 ].indexOf( '&' ) !== -1 ) {
+                                       lastpart = parts[ 1 ].slice( parts[ 1 ].indexOf( '&' ) );
                                } else {
                                        prefix = '&search=';
                                }
-                               this.href = parts[0] + prefix + encodeURIComponent( searchterm ) + lastpart;
+                               this.href = parts[ 0 ] + prefix + encodeURIComponent( searchterm ) + lastpart;
                        } );
                } ).trigger( 'change' );