Difference between revisions of "MediaWiki:PopupMenu.js"

From Wikibase Personal data
Jump to navigation Jump to search
(Created page with "var $title = $( '.wikibase-title' ), qId = $title.find( '.wikibase-title-id' ).text().replace( /[()]/g, '' ); var api = new mw.Api(); api.get( { action: 'expandtemplates',...")
 
Line 1: Line 1:
 +
console.log("launching popup menu")
 
var $title = $( '.wikibase-title' ),
 
var $title = $( '.wikibase-title' ),
 
qId = $title.find( '.wikibase-title-id' ).text().replace( /[()]/g, '' );
 
qId = $title.find( '.wikibase-title-id' ).text().replace( /[()]/g, '' );

Revision as of 05:41, 25 September 2019

console.log("launching popup menu")
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 ) {
    mw.notify( $(data.expandtemplates["*"]) , { autoHide: false } );
} );