The hideWhenNarrow function is now a member of the widget object, so it's
[mkws-moved-to-github.git] / src / mkws-widget-main.js
index 9271602..5951c1c 100644 (file)
@@ -140,7 +140,7 @@ mkws.registerWidgetType('Records', function() {
     }
   });
 
-  widget.autosearch(that);
+  that.autosearch();
 });
 
 
@@ -265,7 +265,7 @@ mkws.registerWidgetType('Results', function() {
   </tr>\
 </table>');
 
-  widget.autosearch(this);
+  this.autosearch();
 });
 
 
@@ -420,6 +420,26 @@ mkws.registerWidgetType('Config', function() {
 });
 
 
+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