MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
No edit summary |
(Character voice preview, init player on click instead of page ready to avoid TMH meddling) |
||
Line 129: | Line 129: | ||
var voice = $(".character td.character-voice"); |
var voice = $(".character td.character-voice"); |
||
if (voice.length && voice.attr('data-voice').length) { |
if (voice.length && voice.attr('data-voice').length) { |
||
⚫ | |||
} |
|||
} |
|||
function playCharacterVoice(){ |
|||
var voice = $(".character td.character-voice"); |
|||
if (voice.find('audio').length == 0) { |
|||
voice.wrapInner('<span>'); |
voice.wrapInner('<span>'); |
||
if (voice.find("span").width() > voice.width()-36 ) voice.css('padding-right', '16px'); |
if (voice.find("span").width() > voice.width()-36 ) voice.css('padding-right', '16px'); |
||
Line 134: | Line 141: | ||
voice.append('<audio class="voice-clip" src="'+voice.attr('data-voice')+'"></audio>').addClass('character-voice-preview'); |
voice.append('<audio class="voice-clip" src="'+voice.attr('data-voice')+'"></audio>').addClass('character-voice-preview'); |
||
voice.find('audio')[0].volume=0.6; |
voice.find('audio')[0].volume=0.6; |
||
⚫ | |||
} |
} |
||
voice.find('audio')[0].play(); |
|||
} |
} |
||
/* Character voice preview - end */ |
/* Character voice preview - end */ |