\
\
@@ -283,7 +283,7 @@ mkws.registerWidgetType('Ranking', function() {
}
s += '';
- this.jqnode.html(s);
+ this.node.html(s);
function mkwsHtmlSort() {
@@ -371,7 +371,7 @@ mkws.registerWidgetType('Lang', function() {
}
}
- this.jqnode.html(data);
+ this.node.html(data);
widget.hideWhenNarrow(this);
@@ -400,11 +400,46 @@ mkws.registerWidgetType('MOTD', function() {
var container = this.team.widget('MOTDContainer');
if (container) {
// Move the MOTD from the provided element down into the container
- this.jqnode.appendTo(container.jqnode);
+ this.node.appendTo(container.node);
}
});
+// This widget has no functionality of its own, but its configuration
+// is copied up into its team, allowing it to affect other widgets in
+// the team.
+//
+mkws.registerWidgetType('Config', function() {
+ var c = this.config;
+ for (var name in c) {
+ if (c.hasOwnProperty(name)) {
+ this.team.config()[name] = c[name];
+ this.log(this + " copied property " + name + "='" + c[name] + "' up to team");
+ }
+ }
+});
+
+
+mkws.registerWidgetType('Progress', function() {
+ var that = this;
+
+ this.node.hide();
+ this.team.queue("stat").subscribe(function(data) {
+ var s = '';
+ for (var i = 0; i < data.clients; i++) {
+ if (i == data.clients - data.activeclients) {
+ s += '';
+ s += '';
+ }
+ s += '█';
+ }
+ s += '';
+ that.node.html(s);
+ that.node.show();
+ });
+});
+
+
// Some elements have mkws* classes that makes them appear as widgets
// -- for example, because we want to style them using CSS -- but have
// no actual functionality. We register these to prevent ignorable
|