Difference between revisions of "MediaWiki:PopupMenu.js"

From Wikibase Personal data
Jump to navigation Jump to search
Line 10: Line 10:
 
     text: '{{PopupMenu|qID='+qId+'}}'
 
     text: '{{PopupMenu|qID='+qId+'}}'
 
} ).done( function ( data ) {
 
} ).done( function ( data ) {
     //var expanded = $(data.expandtemplates["*"])
+
     var expanded = $(data.expandtemplates["*"])
 
     // console.log(expanded)
 
     // console.log(expanded)
 
     mw.notify( "hello" , { autoHide: false } );
 
     mw.notify( "hello" , { autoHide: false } );
 
} );
 
} );

Revision as of 06:00, 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: '{{PopupMenu|qID='+qId+'}}'
} ).done( function ( data ) {
    var expanded = $(data.expandtemplates["*"])
    // console.log(expanded)
    mw.notify( "hello" , { autoHide: false } );
} );