projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
661865e
)
Added clickable facets to the jsdemo.
author
Jakub Skoczen
<jakub@indexdata.dk>
Tue, 24 Jul 2007 08:15:12 +0000
(08:15 +0000)
committer
Jakub Skoczen
<jakub@indexdata.dk>
Tue, 24 Jul 2007 08:15:12 +0000
(08:15 +0000)
www/jsdemo/example_client.js
patch
|
blob
|
history
diff --git
a/www/jsdemo/example_client.js
b/www/jsdemo/example_client.js
index
dc10ad1
..
0df0002
100644
(file)
--- 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
/* 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
*/
// create a parameters array and pass it to the pz2's constructor
@@
-94,16
+94,16
@@
function my_onterm(data) {
termlist.innerHTML = "<hr/><b>TERMLISTS:</b><hr/>";
termlist.innerHTML += '<div class="termtitle">.::Subjects</div>';
for (var i = 0; i < data.subject.length; i++ ) {
termlist.innerHTML = "<hr/><b>TERMLISTS:</b><hr/>";
termlist.innerHTML += '<div class="termtitle">.::Subjects</div>';
for (var i = 0; i < data.subject.length; i++ ) {
- termlist.innerHTML += '<span>'
+ termlist.innerHTML += '<span class="jslink" onclick="limitQuery(\'su\', this.firstChild.nodeValue)">'
+ data.subject[i].name
+ data.subject[i].name
- + ' </span><span> ('
+ + '</span><span> ('
+ data.subject[i].freq
+ ')</span><br/>';
}
termlist.innerHTML += "<hr/>";
termlist.innerHTML += '<div class="termtitle">.::Authors</div>';
for (var i = 0; i < data.author.length; i++ ) {
+ data.subject[i].freq
+ ')</span><br/>';
}
termlist.innerHTML += "<hr/>";
termlist.innerHTML += '<div class="termtitle">.::Authors</div>';
for (var i = 0; i < data.author.length; i++ ) {
- termlist.innerHTML += '<span>'
+ termlist.innerHTML += '<span class="jslink" onclick="limitQuery(\'au\', this.firstChild.nodeValue)">'
+ data.author[i].name
+ ' </span><span> ('
+ data.author[i].freq
+ data.author[i].name
+ ' </span><span> ('
+ data.author[i].freq
@@
-176,6
+176,12
@@
function drawCurDetails ()
"</td></tr></table></div>";
}
"</td></tr></table></div>";
}
+// limit the query after clicking the facet
+function limitQuery (field, value)
+{
+ document.search.query.value += ' and ' + field + '="' + value + '"';
+ onFormSubmitEventHandler();
+}
// simple paging functions
// simple paging functions