initialize: function() {
this.loadingSWF = false;
this.loadedSWF = false;
+
+ var sb = qwebirc.global.staticBaseURL;
+ if(qwebirc.global.baseURL.substr(qwebirc.global.baseURL.length - 1, 1) == "/" && sb.substr(0, 1) == "/")
+ sb = sb.substr(1)
+
+ this.soundURL = qwebirc.global.baseURL + sb + "sound/";
},
go: function() {
if(qwebirc.sound.domReady) {
if(this.loadingSWF)
return;
this.loadingSWF = true;
- if(eval("typeof soundManager") != "undefined") {
+
+ var debugMode = false;
+
+ window.soundManager = new SoundManager();
+
+ var sb = qwebirc.global.staticBaseURL;
+ if(qwebirc.global.baseURL.substr(-1) == "/" && sb.substr(0, 1) == "/")
+ sb = sb.substr(1)
+
+ window.soundManager.url = this.soundURL;
+ window.soundManager.debugMode = debugMode;
+ window.soundManager.useConsole = debugMode;
+ window.soundManager.onload = function() {
this.loadedSWF = true;
this.fireEvent("ready");
- return;
- }
-
- qwebirc.util.importJS(qwebirc.global.staticBaseURL + "js/" + (QWEBIRC_DEBUG?"soundmanager2":"soundmanager2-nodebug-jsmin") + ".js", "soundManager", function() {
- soundManager.url = qwebirc.global.staticBaseURL + "sound/";
-
- var debugMode = false;
- soundManager.debugMode = debugMode;
- soundManager.useConsole = debugMode;
- soundManager.onload = function() {
- this.loadedSWF = true;
- this.fireEvent("ready");
- }.bind(this);
- soundManager.beginDelayedInit();
- }.bind(this));
+ }.bind(this);
+ window.soundManager.beginDelayedInit();
},
createSound: function(name, src) {
try {
},
beep: function() {
if(!this.beepLoaded) {
- this.createSound("beep", qwebirc.global.staticBaseURL + "sound/beep3.mp3");
+ this.createSound("beep", this.soundURL + "beep3.mp3");
this.beepLoaded = true;
}
this.playSound("beep");