X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fmkws-widget-main.js;h=1ea183522d9084df1216cbf0a252209b96c02f55;hb=6fca436aa42f947b752e583ecf1fe201769782a2;hp=ffe00d64d696c5f65e129bad7ce69cacf90705e1;hpb=7508a91294fa89cb3f57218eefd7f0354df81ea4;p=mkws-moved-to-github.git diff --git a/src/mkws-widget-main.js b/src/mkws-widget-main.js index ffe00d6..1ea1835 100644 --- a/src/mkws-widget-main.js +++ b/src/mkws-widget-main.js @@ -96,7 +96,7 @@ mkws.registerWidgetType('Records', function() { var hit = data.hits[i]; that.team.queue("record").publish(hit); hit.detailLinkId = team.recordElementId(hit.recid[0]); - hit.detailClick = "mkws.showDetails('" + team.name() + "', '" + hit.recid[0] + "');return false;" + hit.detailClick = "mkws.showDetails('" + team.name() + "', '" + hit.recid[0] + "');return false;"; hit.containerClass = "mkwsSummary mkwsTeam_" + team.name(); hit.containerClass += " " + hit.detailLinkId; // ### At some point, we may be able to move the @@ -121,26 +121,29 @@ mkws.registerWidgetType('Records', function() { mkws.registerWidgetType('Navi', function() { var that = this; var teamName = this.team.name(); - var M = mkws.M; this.team.queue("navi").subscribe(function() { var filters = that.team.filters(); - var text = ""; + var output = {filters:[]}; filters.visitTargets(function(id, name) { - if (text) text += " | "; - text += M('source') + ': ' + name + ''; + var cur = {}; + cur.facet = 'source'; + cur.value = name; + cur.click = "mkws.delimitTarget('" + teamName + "', '" + id + "'); return false;"; + output.filters.push(cur); }); filters.visitFields(function(field, value) { - if (text) text += " | "; - text += M(field) + ': ' + value + ''; + var cur = {}; + cur.facet = field; + cur.value = value; + cur.click = "mkws.delimitQuery('" + teamName + "', '" + field + "', '" + value + "'" + ");return false;"; + output.filters.push(cur); }); - that.node.html(text); + var template = that.team.loadTemplate(that.config.template || "Navi"); + that.node.html(template(output)); }); }); @@ -344,8 +347,8 @@ mkws.registerWidgetType('Progress', function() { var that = this; this.node.hide(); this.team.queue("stat").subscribe(function(data) { - var template = this.team.loadTemplate(this.config.template || "Progress"); - this.node.html(template({ + var template = that.team.loadTemplate(that.config.template || "Progress"); + that.node.html(template({ done: data.clients - data.activeclients, waiting: data.activeclients }));