Add missing trailing semicolon after HTML entity.
[mkws-moved-to-github.git] / src / mkws-widget-main.js
index 161f61f..85c2ba4 100644 (file)
@@ -140,7 +140,7 @@ mkws.registerWidgetType('Records', function() {
     }
   });
 
-  widget.autosearch(that);
+  that.autosearch();
 });
 
 
@@ -216,7 +216,7 @@ mkws.registerWidgetType('Switch', function() {
 <a href="#" onclick="mkws.switchView(\'' + tname + '\', \'records\')">Records</a><span> \
 | \
 </span><a href="#" onclick="mkws.switchView(\'' + tname + '\', \'targets\')">Targets</a>');
-  widget.hideWhenNarrow(this);
+  this.hideWhenNarrow();
 });
 
 
@@ -265,7 +265,7 @@ mkws.registerWidgetType('Results', function() {
   </tr>\
 </table>');
 
-  widget.autosearch(this);
+  this.autosearch();
 });
 
 
@@ -372,7 +372,7 @@ mkws.registerWidgetType('Lang', function() {
   }
 
   this.node.html(data);
-  widget.hideWhenNarrow(this);
+  this.hideWhenNarrow();
 
 
   // set or re-set "lang" URL parameter
@@ -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 = '<span class="mkwsDone">';
+    for (var i = 0; i < data.clients; i++) {
+      if (i == data.clients - data.activeclients) {
+        s += '</span>';
+        s += '<span class="mkwsWaiting">';
+      }
+      s += '&#x2588;';
+    }
+    s += '</span>';
+    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