User
Nicolas NALLET/bluell.js
< User:Nicolas NALLETRevision as of 09:00, 3 June 2021 by Nicolas NALLET (talk | contribs)
Revision as of 09:00, 3 June 2021 by Nicolas NALLET (talk | contribs)
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/* Fix links to WIkipedia on P19 property*/
$('div#P19 .wb-external-id').attr('href', $( 'div#P19 .wb-external-id' ).attr('href').replace(/\+/g, "_"));
/*Display a drilldown interface for record*/
function createAudioBoxes( data ) {
if ( data.query === undefined || data.query.rwrecords === undefined || data.query.rwrecords.length < 2 ) {
displayError( 'nodata' );
return;
}
ab1 = new AudioBox( data.query.rwrecords[ 0 ], $( '.audiobox' ).eq( 0 ) );
ab2 = new AudioBox( data.query.rwrecords[ 1 ], $( '.audiobox' ).eq( 1 ) );
}
function getRecords() {
var api = new mw.Api();
api.get( {
action: 'query',
format: 'json',
list: 'rwrecords',
rwrlimit: '2',
rwrsort: 'pageid',
rwrdir: 'descending',
rwrformat: 'qid'
} ).then( createAudioBoxes, displayError );
}
function displayError( code, error ) {
console.warn( code, error );
}
if ( mw.config.get( 'wgPageName' ) === 'User:Nicolas_NALLET' ) {
mw.loader.using( [ 'mediawiki.api', 'ext.recordWizard.wikibase' ] ).then( getRecords );
}