From: Mike Taylor Date: Sun, 30 Jun 2013 08:17:25 +0000 (+0100) Subject: Code-formatting. X-Git-Tag: 0.9.1~399 X-Git-Url: http://jsfdemo.indexdata.com/?a=commitdiff_plain;h=47778f5059519183412b187b7fd1038b6e11a9b4;p=mkws-moved-to-github.git Code-formatting. --- diff --git a/experiments/spclient/mkws.js b/experiments/spclient/mkws.js index 97138ce..01c7990 100644 --- a/experiments/spclient/mkws.js +++ b/experiments/spclient/mkws.js @@ -163,35 +163,31 @@ function my_onterm(data) { var termlists = []; termlists.push('
' + M('Termlists') + '
'); - - 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"); + 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"); var termlist = document.getElementById("termlist"); replaceHtml(termlist, termlists.join('')); } -function add_single_facet(termlists, caption, data, max, cclIndex) { - termlists.push('
'); - termlists.push('
' + M(caption) + '
'); +function add_single_facet(acc, caption, data, max, cclIndex) { + acc.push('
'); + acc.push('
' + M(caption) + '
'); for (var i = 0; i < data.length && i < max; i++ ) { - termlists.push('' - + data[i].name - + ' (' - + data[i].freq - + ')
'); + acc.push('onclick="' + action + ';return false;">' + data[i].name + '' + + ' (' + data[i].freq + ')
'); } - termlists.push('
'); + acc.push('
'); } function my_onrecord(data) {