ajax-chat/public/js/custom.js
2022-02-06 17:08:09 +01:00

41 lines
1.1 KiB
JavaScript

/*
* @package AJAX_Chat
* @author Sebastian Tschan
* @copyright (c) Sebastian Tschan
* @license GNU Affero General Public License
* @link https://blueimp.net/ajax/
*/
// Overriding client side functionality:
/*
// Example - Overriding the replaceCustomCommands method:
ajaxChat.replaceCustomCommands = function(text, textParts) {
return text;
}
*/
ajaxChat.customInitialize = function() {
ajaxChat.addChatBotMessageToChatList("[b]Welcome to Flashii Chat![/b]");
ajaxChat.addChatBotMessageToChatList("[i]the one time i tried to use gimp i got scared and tried closing it and it crashed[/i]");
}
ajaxChat.loadHTML5Sounds=function(){
aO = document.createElement('audio');
aO.id = 'audioObject';
document.body.appendChild(aO);
this.audioObject = document.getElementById('audioObject');
this.setAudioVolume(this.settings['audioVolume']);
this.sounds = {};
for(var key in this.soundFiles){
this.sounds[key] = this.dirs['sounds']+this.soundFiles[key];
}
}
ajaxChat.playHTML5Sound=function(soundID,soundFile){
this.audioObject.src = soundFile;
this.audioObject.play();
}
ajaxChat.setHTML5SoundVolume=function(volume){
this.audioObject.volume = volume;
}