From: Mike Taylor Date: Sun, 30 Jun 2013 08:14:54 +0000 (+0100) Subject: Replace target-facet generation with another add_single_facet() invocation. X-Git-Tag: 0.9.1~400 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=548622e76659b11cdaba69a5b8dd3b4b0c0842ac;p=mkws-moved-to-github.git Replace target-facet generation with another add_single_facet() invocation. --- diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js index 3bf3069..97138ce 100644 --- a/experiments/spclient/mkws.js +++ b/experiments/spclient/mkws.js @@ -164,17 +164,7 @@ function my_onterm(data) { var termlists = []; termlists.push('
' + M('Termlists') + '
'); - termlists.push('
'); - termlists.push('
' + M('Sources') + '
'); - for (var i = 0; i < data.xtargets.length && i < SourceMax; i++ ) { - termlists.push('' - + data.xtargets[i].name - + ' (' - + data.xtargets[i].freq - + ')
'); - } - termlists.push('
'); - + add_single_facet(termlists, "Sources", data.xtargets, SourceMax, null); add_single_facet(termlists, "Subjects", data.subject, SubjectMax, "su"); add_single_facet(termlists, "Authors", data.author, AuthorMax, "au"); @@ -186,7 +176,16 @@ function add_single_facet(termlists, caption, data, max, cclIndex) { termlists.push('
'); termlists.push('
' + M(caption) + '
'); for (var i = 0; i < data.length && i < max; i++ ) { - termlists.push('' + termlists.push('' + data[i].name + ' (' + data[i].freq