From 2009.igem.org
/* ************************************************************************
* Thanks to Fabian Jakobs
*/
qx.Class.define("qooxwaveclient.wave.WaveFactory",
{
extend : qx.core.Object,
members :
{
getWave : function()
{
if (this.isInWaveContainer()) //check if application runs in wave
{
return wave;
}
else //create emulated wave so the application works outside wave
{
var state = new qooxwaveclient.wave.State();
var participants = [
new qooxwaveclient.wave.Participant("Fabian Jakobs", "http://www.gravatar.com/avatar/a6d98536d90d2987d40a6abe731805ca")
];
return new qooxwaveclient.wave.Wave(state, participants);
}
},
//checks if qooxdoo application runs in wave
isInWaveContainer : function() {
var isInWave = typeof window.wave != "undefined" && wave.isInWaveContainer();
isInWave ? this.debug("Application runs Wave") : this.debug("Application runs outside waveContainer");
return isInWave;
}
}
});