Changes

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

Navigation menu