X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmkws-widget-main.js;h=5951c1c140c802f98a2c9d64e2969baf182ae93a;hb=c302068454a4f0a77574eae189b582a01138e763;hp=161f61fe7355fbed9dc16c4691b413d8881a42c7;hpb=16708a6aebe10acd3b72bcb20b03c54d1195a1b9;p=mkws-moved-to-github.git
diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js
index 161f61f..5951c1c 100644
--- a/src/mkws-widget-main.js
+++ b/src/mkws-widget-main.js
@@ -140,7 +140,7 @@ mkws.registerWidgetType('Records', function() {
}
});
- widget.autosearch(that);
+ that.autosearch();
});
@@ -265,7 +265,7 @@ mkws.registerWidgetType('Results', function() {
\
');
- widget.autosearch(this);
+ this.autosearch();
});
@@ -405,6 +405,41 @@ mkws.registerWidgetType('MOTD', function() {
});
+// 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