Difference between revisions of "MediaWiki:PopupMenu.js"
Jump to navigation
Jump to search
Tag: Undo |
|||
(12 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
// License: GPL | // License: GPL | ||
− | + | var $title = $( '.wikibase-title' ), | |
+ | qId = $title.find( '.wikibase-title-id' ).text().replace( /[()]/g, '' ); | ||
− | var | + | var api = new mw.Api(); |
+ | api.get( { | ||
+ | action: 'expandtemplates', | ||
+ | text: '{{PopupMenu|qID='+qId+'}}' | ||
+ | } ).done( function ( data ) { | ||
+ | var expanded = data.expandtemplates["*"] | ||
− | + | mw.notify( expanded , { autoHide: false } ); | |
− | + | } ); | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | } | ||
− | |||
− | |||
− | |||
− |
Latest revision as of 06:01, 25 September 2019
// License: GPL
var $title = $( '.wikibase-title' ),
qId = $title.find( '.wikibase-title-id' ).text().replace( /[()]/g, '' );
var api = new mw.Api();
api.get( {
action: 'expandtemplates',
text: '{{PopupMenu|qID='+qId+'}}'
} ).done( function ( data ) {
var expanded = data.expandtemplates["*"]
mw.notify( expanded , { autoHide: false } );
} );