User:Cqm/specialsearchfix.js

/** * Allows accessing of Special pages through Oasis search * * @author Cqm */

this.rswiki = this.rswiki || {};

( function ( $, mw, rswiki ) {

'use strict';

rswiki.specialSearchFix = function { $( '#WikiaSearch' ).on( 'submit', function ( e ) {

var term = this.getElementsByTagName( 'input' )[0].value, config = mw.config.get( [                   'wgServer',                    'wgArticlePath'                ] );

// check for special namespace prefix and that something is after the colon if ( term.toLowerCase.indexOf( 'special:' ) === 0 && term.length > 8 ) { e.preventDefault; window.location.assign( config.wgServer + config.wgArticlePath.replace( '$1', term ) ); }       } );    };

$( rswiki.specialSearchFix );

}( this.jQuery, this.mediaWiki, this.rswiki ) );