X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=tools%2Fhtdocs%2Fmkws.js;h=ee055204fbfaa84cecc95cf82fc5d22eaba7c2df;hb=75a31106246500cc5ca1445fcf337a329d6865b0;hp=796fd2c2504c9a21ab0b0c448805d6b5a1a82279;hpb=a4549c27facf4260bf93d71ef26d7a755063d13b;p=mkws-moved-to-github.git diff --git a/tools/htdocs/mkws.js b/tools/htdocs/mkws.js index 796fd2c..ee05520 100644 --- a/tools/htdocs/mkws.js +++ b/tools/htdocs/mkws.js @@ -186,15 +186,15 @@ function widget($, team, type, node) { } 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 ='' + @@ -221,7 +221,7 @@ function widget($, team, type, node) { function promoteStat() { - mkws.queue("stat").subscribe(function(data) { + mkws.queue("stat." + team.name()).subscribe(function(data) { if (node.length === 0) alert("huh?!"); $(node).html('' + M('Status info') + '' + @@ -231,9 +231,6 @@ function widget($, team, type, node) { '' + M('Retrieved records') + ': ' + data.records + '/' + data.hits + ''); }); } - - - return that; } @@ -248,6 +245,7 @@ function widget($, team, type, node) { 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 @@ -309,13 +307,13 @@ function team($, teamName) { 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); }