| Line 1: |
Line 1: |
| | + | // License: GPL |
| | | | |
| − | console.log( "it's a controller" )
| + | var $title = $( '.wikibase-title' ), |
| − | var $title2 = $( '.wikibase-title' ),
| + | qId = $title.find( '.wikibase-title-id' ).text().replace( /[()]/g, '' ); |
| − | qId = $title2.find( '.wikibase-title-id' ).text().replace( /[()]/g, '' );
| + | |
| − | var api = new mw.Api();
| + | |
| − | api.get( {
| + | var api = new mw.Api(); |
| − | action: 'expandtemplates',
| + | api.get( { |
| − | text: '{{Menu|qID='+qId+'}}'
| + | action: 'expandtemplates', |
| − | } ).done( function ( data ) {
| + | text: '{{PopupMenu|qID='+qId+'}}' |
| − | var expanded = $(data.expandtemplates["*"])
| + | } ).done( function ( data ) { |
| − | console.log(expanded)
| + | var expanded = data.expandtemplates["*"] |
| − | mw.notify( expanded , { autoHide: false } );
| + | |
| | + | mw.notify( expanded , { autoHide: false } ); |
| | + | } ); |