Difference between revisions of "MediaWiki:PopupMenu.js"

From Wikibase Personal data
Jump to navigation Jump to search
Line 8: Line 8:
 
} ).done( function ( data ) {
 
} ).done( function ( data ) {
 
     var expanded = $(data.expandtemplates["*"]
 
     var expanded = $(data.expandtemplates["*"]
     console.log(expanded)
+
     console.log("Expanded", expanded)
 
     mw.notify(expanded ) , { autoHide: false } );
 
     mw.notify(expanded ) , { autoHide: false } );
 
} );
 
} );

Revision as of 05:46, 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 ) {
    var expanded = $(data.expandtemplates["*"]
    console.log("Expanded", expanded)
    mw.notify(expanded ) , { autoHide: false } );
} );