X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget-main.js;h=d3a13cf2e2e1b729331759a2eae39c750dcd3b95;hb=b02b6a27733ce4fc5a01ae2d8286dad769824e1b;hp=92716027b0639467e1209637f95bb1b3504e3fd4;hpb=5374406d1e6b911c4a92a826b20ec6282ec31012;p=mkws-moved-to-github.git
diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js
index 9271602..d3a13cf 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();
});
@@ -216,7 +216,7 @@ mkws.registerWidgetType('Switch', function() {
Records \
| \
Targets');
- widget.hideWhenNarrow(this);
+ this.hideWhenNarrow();
});
@@ -265,7 +265,7 @@ mkws.registerWidgetType('Results', function() {
\
');
- 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
@@ -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 = '';
+ 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
@@ -428,6 +448,5 @@ mkws.registerWidgetType('Config', function() {
mkws.registerWidgetType('Query', function() {});
mkws.registerWidgetType('MOTDContainer', function() {});
mkws.registerWidgetType('Button', function() {});
-mkws.registerWidgetType('Popup', function() {});