_launch: false
};
TogetherJS.startup = TogetherJS._extend(TogetherJS._startupInit);
TogetherJS.running = false;
TogetherJS.requireConfig = {
context: "togetherjs",
baseUrl: baseUrl + "/togetherjs",
urlArgs: "bust=" + cacheBust,
paths: {
jquery: "libs/jquery-1.8.3.min",
walkabout: "libs/walkabout/walkabout",
esprima: "libs/walkabout/lib/esprima",
falafel: "libs/walkabout/lib/falafel",
tinycolor: "libs/tinycolor",
whrandom: "libs/whrandom/random"
}
};
TogetherJS._mixinEvents = function (proto) {
proto.on = function on(name, callback) {
if (typeof callback != "function") {
console.warn("Bad callback for", this, ".once(", name, ", ", callback, ")");
throw "Error: .once() called with non-callback";
}
if (name.search(" ") != -1) {
var names = name.split(/ +/g);
names.forEach(function (n) {
this.on(n, callback);
}, this);
return;
}
if (this._knownEvents && this._knownEvents.indexOf(name) == -1) {
var thisString = "" + this;
if (thisString.length > 20) {
thisString = thisString.substr(0, 20) + "...";
}
console.warn(thisString + ".on('" + name + "', ...): unknown event");
if (console.trace) {
console.trace();
}
}
if (! this._listeners) {
this._listeners = {};
}
if (! this._listeners[name]) {
this._listeners[name] = [];
}
if (this._listeners[name].indexOf(callback) == -1) {
this._listeners[name].push(callback);
}
};
proto.once = function once(name, callback) {
if (typeof callback != "function") {
console.warn("Bad callback for", this, ".once(", name, ", ", callback, ")");
throw "Error: .once() called with non-callback";
}
var attr = "onceCallback_" + name;