mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-07-07 08:58:49 +00:00
jappixmini: include jappix source
This commit is contained in:
parent
61eb1f0d18
commit
302b2820d1
231 changed files with 96082 additions and 2 deletions
46
jappixmini/jappix/js/audio.js
Normal file
46
jappixmini/jappix/js/audio.js
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
|
||||
Jappix - An open social platform
|
||||
These are the audio JS scripts for Jappix
|
||||
|
||||
-------------------------------------------------
|
||||
|
||||
License: AGPL
|
||||
Author: Vanaryon
|
||||
Last revision: 10/08/11
|
||||
|
||||
*/
|
||||
|
||||
// Plays the given sound ID
|
||||
function soundPlay(num) {
|
||||
try {
|
||||
// Not supported!
|
||||
if((BrowserDetect.browser == 'Explorer') && (BrowserDetect.version < 9))
|
||||
return false;
|
||||
|
||||
// If the sounds are enabled
|
||||
if(getDB('options', 'sounds') == '1') {
|
||||
// If the audio elements aren't yet in the DOM
|
||||
if(!exists('#audio')) {
|
||||
$('body').append(
|
||||
'<div id="audio">' +
|
||||
'<audio id="new-chat" src="./snd/new-chat.oga" type="audio/ogg" />' +
|
||||
'<audio id="receive-message" src="./snd/receive-message.oga" type="audio/ogg" />' +
|
||||
'<audio id="notification" src="./snd/notification.oga" type="audio/ogg" />' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
// We play the target sound
|
||||
var playThis = document.getElementById('audio').getElementsByTagName('audio')[num];
|
||||
playThis.load();
|
||||
playThis.play();
|
||||
}
|
||||
}
|
||||
|
||||
catch(e) {}
|
||||
|
||||
finally {
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue