Difference between revisions of "MediaWiki:PopupMenu.js"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
console.log( "it's a controller" ) | console.log( "it's a controller" ) | ||
var $title2 = $( '.wikibase-title' ), | var $title2 = $( '.wikibase-title' ), | ||
Line 36: | Line 11: | ||
console.log(expanded) | console.log(expanded) | ||
mw.notify( expanded , { autoHide: false } ); | mw.notify( expanded , { autoHide: false } ); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 05:52, 25 September 2019
console.log( "it's a controller" )
var $title2 = $( '.wikibase-title' ),
qId = $title2.find( '.wikibase-title-id' ).text().replace( /[()]/g, '' );
var api = new mw.Api();
api.get( {
action: 'expandtemplates',
text: '{{Menu|qID='+qId+'}}'
} ).done( function ( data ) {
var expanded = $(data.expandtemplates["*"])
console.log(expanded)
mw.notify( expanded , { autoHide: false } );