2 xtargets: [ "Sources", 16, false ],
3 subject: [ "Subjects", 10, true ],
4 author: [ "Authors", 10, true ]
8 mkws.registerWidgetType('Termlists', function() {
10 var facets = that.config.facets;
12 this.team.queue("termlists").subscribe(function(data) {
13 // display if we first got results
17 widget.autosearch(that);
21 mkws.registerWidgetType('Facet', function() {
23 var teamName = that.team.name();
24 var name = that.config.facet;
25 var ref = mkws.facetConfig[name] || alert("no facet definition for '" + name + "'");
28 var pzIndex = ref[2] ? name : null;
30 that.team.queue("termlists").subscribe(function(data) {
34 acc.push('<div class="termtitle">' + mkws.M(caption) + '</div>');
35 for (var i = 0; i < data.length && i < max; i++) {
36 acc.push('<div class="term">');
37 acc.push('<a href="#" ');
40 // Special case: target selection
41 acc.push('target_id='+data[i].id+' ');
42 if (!that.team.targetFiltered(data[i].id)) {
43 action = 'mkws.limitTarget(\'' + teamName + '\', this.getAttribute(\'target_id\'),this.firstChild.nodeValue)';
46 action = 'mkws.limitQuery(\'' + teamName + '\', \'' + pzIndex + '\', this.firstChild.nodeValue)';
48 acc.push('onclick="' + action + ';return false;">' + data[i].name + '</a>'
49 + ' <span>' + data[i].freq + '</span>');
53 $(that.node).html(acc.join(''));