mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-28 01:10:09 +00:00
18 lines
520 B
JavaScript
18 lines
520 B
JavaScript
|
( function () {
|
||
|
'use strict';
|
||
|
|
||
|
var serverUrl = mw.config.get( 'wgServer' ),
|
||
|
scriptPath = mw.config.get( 'wgScriptPath' ),
|
||
|
repoApiUrl = serverUrl + scriptPath + '/api.php',
|
||
|
contLang = mw.config.get( 'wgContentLanguage' );
|
||
|
|
||
|
// eslint-disable-next-line no-jquery/no-global-selector
|
||
|
$( '.mwe-math-wikibase-entityselector-input input' ).entityselector( {
|
||
|
url: repoApiUrl,
|
||
|
language: contLang,
|
||
|
type: 'item'
|
||
|
} ).on( 'entityselectorselected', function ( event, entityId ) {
|
||
|
this.value = entityId;
|
||
|
} );
|
||
|
}() );
|