that.addWidget = function(w) {
if (!m_widgets[w.type]) {
- m_widgets[w.type] = widget;
+ m_widgets[w.type] = w;
log("Registered '" + w.type + "' widget in team '" + m_teamName + "'");
} else if (typeof(m_widgets[w.type]) !== 'number') {
m_widgets[w.type] = 2;
}
}
+ that.widgetTypes = function() {
+ var keys = [];
+ for (var k in m_widgets) keys.push(k);
+ return keys.sort();
+ }
+
that.widget = function(type) {
return m_widgets[type];
}