From: Wolfram Schneider Date: Fri, 5 Dec 2008 16:46:45 +0000 (+0100) Subject: Configurable length of termlist entries. Print max. 10 items for X-Git-Tag: v1.1.0~60 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=d63d842aedbc1c8ce12b3efcfc986ea1c3b7ec2d;p=pazpar2-moved-to-github.git Configurable length of termlist entries. Print max. 10 items for Subjects and Authors, and 16 items for Sources. --- diff --git a/www/jsdemo/example_client.js b/www/jsdemo/example_client.js index c1671e2..6a4be33 100644 --- a/www/jsdemo/example_client.js +++ b/www/jsdemo/example_client.js @@ -31,6 +31,9 @@ var curDetRecData = null; var curSort = 'relevance'; var curFilter = null; var submitted = false; +var SourceMax = 16; +var SubjectMax = 10; +var AuthorMax = 10; // // pz2.js event handlers: @@ -89,7 +92,7 @@ function my_onterm(data) { termlist.innerHTML = "
TERMLISTS:
"; termlist.innerHTML += '
.::Sources
'; - for (var i = 0; i < data.xtargets.length; i++ ) { + for (var i = 0; i < data.xtargets.length && i < SourceMax; i++ ) { termlist.innerHTML += '' @@ -102,7 +105,7 @@ function my_onterm(data) { termlist.innerHTML += "
"; termlist.innerHTML += '
.::Subjects
'; - for (var i = 0; i < data.subject.length; i++ ) { + for (var i = 0; i < data.subject.length && i < SubjectMax; i++ ) { termlist.innerHTML += '
' + data.subject[i].name + ' (' @@ -113,7 +116,7 @@ function my_onterm(data) { termlist.innerHTML += "
"; termlist.innerHTML += '
.::Authors
'; - for (var i = 0; i < data.author.length; i++ ) { + for (var i = 0; i < data.author.length && i < AuthorMax; i++ ) { termlist.innerHTML += '' + data.author[i].name + ' ('