- // Functions follow for promoting the regular widget object into
- // widgets of specific types. These could be moved outside of the
- // widget object, or even into their own source files.
-
- function promoteTargets() {
- var that = this;
- var M = mkws.M;
-
- this.team.queue("targets").subscribe(function(data) {
- var table ='<table><thead><tr>' +
- '<td>' + M('Target ID') + '</td>' +
- '<td>' + M('Hits') + '</td>' +
- '<td>' + M('Diags') + '</td>' +
- '<td>' + M('Records') + '</td>' +
- '<td>' + M('State') + '</td>' +
- '</tr></thead><tbody>';
-
- for (var i = 0; i < data.length; i++) {
- table += "<tr><td>" + data[i].id +
- "</td><td>" + data[i].hits +
- "</td><td>" + data[i].diagnostic +
- "</td><td>" + data[i].records +
- "</td><td>" + data[i].state + "</td></tr>";
- }
-
- table += '</tbody></table>';
- var subnode = $(that.node).children('.mkwsBytarget');
- subnode.html(table);
- });
- }
-
-
- function promoteStat() {
- var that = this;
- var M = mkws.M;
-
- this.team.queue("stat").subscribe(function(data) {
- if (that.node.length === 0) alert("huh?!");
-
- $(that.node).html('<span class="head">' + M('Status info') + '</span>' +
- ' -- ' +
- '<span class="clients">' + M('Active clients') + ': ' + data.activeclients + '/' + data.clients + '</span>' +
- ' -- ' +
- '<span class="records">' + M('Retrieved records') + ': ' + data.records + '/' + data.hits + '</span>');
- });
- }
-
+// Functions follow for promoting the regular widget object into
+// widgets of specific types. These could be moved outside of the
+// widget object, or even into their own source files.
+
+function promoteToTargets() {
+ var that = this;
+ var M = mkws.M;
+
+ this.team.queue("targets").subscribe(function(data) {
+ var table ='<table><thead><tr>' +
+ '<td>' + M('Target ID') + '</td>' +
+ '<td>' + M('Hits') + '</td>' +
+ '<td>' + M('Diags') + '</td>' +
+ '<td>' + M('Records') + '</td>' +
+ '<td>' + M('State') + '</td>' +
+ '</tr></thead><tbody>';
+
+ for (var i = 0; i < data.length; i++) {
+ table += "<tr><td>" + data[i].id +
+ "</td><td>" + data[i].hits +
+ "</td><td>" + data[i].diagnostic +
+ "</td><td>" + data[i].records +
+ "</td><td>" + data[i].state + "</td></tr>";
+ }
+
+ table += '</tbody></table>';
+ var subnode = $(that.node).children('.mkwsBytarget');
+ subnode.html(table);
+ });
+}