View source for MediaWiki:Gadget-sound.js
Appearance
You do not have permission to edit this page, for the following reasons:
You can view and copy the source of this page.
// jshint jquery:true, esversion:5
/* globals require, module, mediaWiki, mw, OO
Attribution: https://minecraft.wiki/w/MediaWiki:Gadget-sound.js
*/
'use strict';
mw.hook( 'wikipage.content' ).add( function( $content ) {
var i18n = {
playTitle: 'Click to play',
stopTitle: 'Click to stop',
openFilePage: 'Open file page'
};
var $contextmenu = $( '#sound-contextmenu' );
$content.find('.sound' ).prop( 'title', i18n.playTitle ).on( 'contextmenu', function( e ) {
// Ignore links or selection
if ( e.target.tagName === 'A' || window.getSelection().toString() ) {
return;
}
var audio = $( this ).find( '.sound-audio audio' )[0];
if ( !audio || !audio.dataset.mwtitle ) {
return;
000
1:0
Return to MediaWiki:Gadget-sound.js.