} else if (type === 'Stat') {
promoteStat();
} else {
- // Unsupported widget type: call an extension?
+ // ### Handle other types here
}
- // ### More to do here, surely: e.g. wiring into the team
mkws.debug("made widget(team=" + team + ", type=" + type + ", node=" + node);
+ return that;
function promoteTargets() {
- mkws.queue("targets").subscribe(function(data) {
+ mkws.queue("targets." + team.name()).subscribe(function(data) {
if (node.length === 0) alert("huh?!");
var table ='<table><thead><tr>' +
function promoteStat() {
- mkws.queue("stat").subscribe(function(data) {
+ mkws.queue("stat." + team.name()).subscribe(function(data) {
if (node.length === 0) alert("huh?!");
$(node).html('<span class="head">' + M('Status info') + '</span>' +
'<span class="records">' + M('Retrieved records') + ': ' + data.records + '/' + data.hits + '</span>');
});
}
-
-
- return that;
}
function team($, teamName) {
var that = {};
var m_teamName = teamName;
+ that.name = function() { return m_teamName; }
var m_submitted = false;
var m_query; // initially undefined
var m_sort; // will be set below
function onBytarget(data) {
debug("target");
- mkws.queue("targets").publish(data);
+ mkws.queue("targets." + m_teamName).publish(data);
}
function onStat(data) {
debug("stat");
- mkws.queue("stat").publish(data);
+ mkws.queue("stat." + m_teamName).publish(data);
}