- termlists.push('<div class="facet">');
- termlists.push('<div class="termtitle">' + M('Subjects') + '</div>');
- for (var i = 0; i < data.subject.length && i < SubjectMax; i++ ) {
- termlists.push('<a href="#" onclick="limitQuery(\'su\', this.firstChild.nodeValue);return false;">' + data.subject[i].name + '</a><span> ('
- + data.subject[i].freq + ')</span><br/>');
- }
- termlists.push('</div>');
-
- termlists.push('<div class="facet">');
- termlists.push('<div class="termtitle">' + M('Authors') + '</div>');
- for (var i = 0; i < data.author.length && i < AuthorMax; i++ ) {
- termlists.push('<a href="#" onclick="limitQuery(\'au\', this.firstChild.nodeValue);return false;">'
- + data.author[i].name
- + ' </a><span> ('
- + data.author[i].freq
- + ')</span><br/>');
+ // display if we first got results
+ $("#termlist").parent().show();
+
+ var termlists = [];
+ termlists.push('<div class="title">' + M('Termlists') + '</div>');
+ var facets = mkws_config.facets;
+
+ for(var i = 0; i < facets.length; i++) {
+ if (facets[i] == "sources")
+ add_single_facet(termlists, "Sources", data.xtargets, SourceMax, null);
+ if (facets[i] == "subjects")
+ add_single_facet(termlists, "Subjects", data.subject, SubjectMax, "su");
+ if (facets[i] == "authors")
+ add_single_facet(termlists, "Authors", data.author, AuthorMax, "au");