dev

MiniComplete is an autocomplete library. It works by detecting when you've opened a brackets for a link [[ or a template {{ and suggests options you might be looking for based on what you typed after those opening brackets. It was made for general use back when normal editor autocomplete didn't exist, but the Fandom LinkSuggest extension replicates its functionality. However, with the Unified Community Platform, LinkSuggest is no longer an easily accessible library.

It is designed to look and function the same as the autocomplete when editing pages. If there is a feature that the editor autocomplete has, but this does not, please request it on the talk page.

Usage

This script can be used in almost any other script where an autocomplete is wanted for a textarea element. You will need to load the script and register the module containing it's dependencies and then pass the a selector to a function from this script.

The following is an example used for the demo of this script:

// Load the module
mw.loader.implement( 'minicomplete', [ '/load.php?debug=false&lang=en&mode=articles&skin=oasis&missingCallback=importArticleMissing&articles=u%3Acamtest%3AMediaWiki%3ATextareaHelper.js%7Cu%3Adev%3AColors%2Fcode.js%7Cu%3Adev%3AMiniComplete%2Fcode.js&only=scripts' ], {}, {} );

// Insert the textarea
$( '#minicomplete-demo' )
// Empty the element first in case of loading twice or more
.empty()
.append(
    $( '<textarea>' )
    .attr( {
        id: 'minicomplete-textarea',
        placeholder: 'Try the MiniComplete demo here!'
    } )
    .css( {
        resize: 'none',
        height: '80px',
        width: '98.3%',
        padding: '2px 5px'
    } )
);

// Call the modules we need and execute the script in the callback
mw.loader.using( [ 'mediawiki.api', 'minicomplete' ], function () {
    dev.minicomplete.load( '#minicomplete-textarea' );
} );

It is recommended to use the ID of the textarea, like in this example, as the selector to pass to dev.minicomplete.load(). If for some reason this cannot be done, you can use any selector you might use in CSS.

Demo

To do list

Changelog

This only documents major updates, so may not correlate with the latest update in the infobox.

6th February 2015 (diff)
15th February 2014 (diff)
9th November 2013 (diff)
31st October 2013 (diff)
28th October 2013
Text above can be found here (edit)