-/* eslint-disable no-restricted-properties */
/*!
* Add search suggestions to the search form.
*/
( function () {
+ // eslint-disable-next-line no-jquery/no-map-util
var searchNS = $.map( mw.config.get( 'wgFormattedNamespaces' ), function ( nsName, nsID ) {
if ( nsID >= 0 && mw.user.options.get( 'searchNs' + nsID ) ) {
// Cast string key to number
this.text( text );
// wrap only as link, if the config doesn't disallow it
- if ( textboxConfig.wrapAsLink !== false ) {
+ if ( textboxConfig.wrapAsLink !== false ) {
this.wrap(
$( '<a>' )
.attr( 'href', formData.baseHref + $.param( formData.linkParams ) )
} );
} else {
$input.closest( 'form' )
- .append( $( '<input type="hidden" name="fulltext" value="1"/>' ) );
+ .append(
+ $( '<input>' )
+ .prop( {
+ type: 'hidden',
+ value: 1
+ } )
+ .attr( 'name', 'fulltext' )
+ );
}
return true; // allow the form to be submitted
}