Difference between revisions of "MediaWiki:PopupMenu.js"
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
// License: GPL | // License: GPL | ||
+ | console.log( "popupmenu" ) | ||
+ | var $title = $( '.wikibase-title' ), | ||
+ | qId = $title.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 } ); | |
− | + | } ); | |
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 05:56, 25 September 2019
// License: GPL
console.log( "popupmenu" )
var $title = $( '.wikibase-title' ),
qId = $title.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 } );
} );