mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Math
synced 2024-11-24 23:46:39 +00:00
4a7bc3ee31
Add a special page and an API endpoint to fetch data from Wikibase items with a given qID. The special page summarizes information from Wikibase. The API endpoint allows to request the information directly. Both, the API endpoint and the special page, fetch the data from a new helper class for consistency. Bug: T208758 Bug: T229939 Change-Id: Idd22057a88312bf1a1cb5546d0a6edca5678d80d
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;
|
|
} );
|
|
}() );
|