From: Jakub Skoczen Date: Tue, 24 Jul 2007 08:15:12 +0000 (+0000) Subject: Added clickable facets to the jsdemo. X-Git-Tag: PAZPAR2.1.0.2~36 X-Git-Url: http://git.indexdata.com/?p=pazpar2-moved-to-github.git;a=commitdiff_plain;h=5c050b4ec84d485021bce4a43389bc572073f635 Added clickable facets to the jsdemo. --- diff --git a/www/jsdemo/example_client.js b/www/jsdemo/example_client.js index dc10ad1..0df0002 100644 --- a/www/jsdemo/example_client.js +++ b/www/jsdemo/example_client.js @@ -1,5 +1,5 @@ /* A very simple client that shows a basic usage of the pz2.js -** $Id: example_client.js,v 1.4 2007-07-16 17:01:46 adam Exp $ +** $Id: example_client.js,v 1.5 2007-07-24 08:15:12 jakub Exp $ */ // create a parameters array and pass it to the pz2's constructor @@ -94,16 +94,16 @@ function my_onterm(data) { termlist.innerHTML = "
TERMLISTS:
"; termlist.innerHTML += '
.::Subjects
'; for (var i = 0; i < data.subject.length; i++ ) { - termlist.innerHTML += '' + termlist.innerHTML += '' + data.subject[i].name - + ' (' + + ' (' + data.subject[i].freq + ')
'; } termlist.innerHTML += "
"; termlist.innerHTML += '
.::Authors
'; for (var i = 0; i < data.author.length; i++ ) { - termlist.innerHTML += '' + termlist.innerHTML += '' + data.author[i].name + ' (' + data.author[i].freq @@ -176,6 +176,12 @@ function drawCurDetails () ""; } +// limit the query after clicking the facet +function limitQuery (field, value) +{ + document.search.query.value += ' and ' + field + '="' + value + '"'; + onFormSubmitEventHandler(); +} // simple paging functions