Difference between revisions of "MediaWiki:Access.js"

From Wikibase Personal data
Jump to navigation Jump to search
Line 3: Line 3:
 
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, '' )
console.log("qqqqq")
+
// console.log("qqqqq")
console.log(qID)
+
// console.log(qID)
 
var api = new mw.Api();
 
var api = new mw.Api();
 
api.get( {
 
api.get( {

Revision as of 00:20, 30 March 2019

console.log("qqqqq")

var $title = $( '.wikibase-title' ),
qId = $title.find( '.wikibase-title-id' ).text().replace( /[()]/g, '' )
// console.log("qqqqq")
// console.log(qID)
var api = new mw.Api();
api.get( {
    action: 'expandtemplates',
    text: '{{MailtoAccess|'+qId+'}}'
} ).done( function ( data ) {
    mw.notify( $('<a href="'+data.expandtemplates["*"]+'"> do a SAR to this controller!</a>') , { autoHide: false } );
} );