From: Jakub Skoczen Date: Fri, 18 May 2007 17:16:05 +0000 (+0000) Subject: Last touch :). X-Git-Tag: PAZPAR2.1.0.0~123 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=d293bd2470d6d93f44c89ca292ae3dfbb22e9b09;p=pazpar2-moved-to-github.git Last touch :). --- diff --git a/www/example/example_client.js b/www/example/example_client.js index 4dbac1c..e84d5c4 100644 --- a/www/example/example_client.js +++ b/www/example/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.2 2007-05-18 15:16:18 jakub Exp $ +** $Id: example_client.js,v 1.3 2007-05-18 17:16:05 jakub Exp $ */ // create a parameters array and pass it to the pz2's constructor @@ -30,6 +30,9 @@ function domReady () // when search button pressed function onFormSubmitEventHandler() { + curPage = 1; + curDetRecId = -1; + totalRec = 0; my_paz.search(document.search.query.value, recPerPage, 'relevance'); return false; } @@ -49,16 +52,16 @@ function my_onshow(data) { ' of ' + data.merged + ' (total not merged hits: ' + data.total + ')'; - body.innerHTML += '
' + body.innerHTML += '
' +'<< Prev | ' - +'' + +'' +'Next >>

'; for (var i = 0; i < data.hits.length; i++) { var hit = data.hits[i]; body.innerHTML += '
' +'' + (i + 1 + recPerPage * ( curPage - 1)) + '. ' - +'' + hit["md-title"] + + +'' + hit["md-title"] + ' by ' + hit["md-author"] + '
'; if ( hit.recid == curDetRecId ) { @@ -70,33 +73,33 @@ function my_onshow(data) { function my_onstat(data) { var stat = document.getElementById("stat"); - stat.innerHTML = 'active clients: ' + data.activeclients + ' ' + - 'hits: ' + data.hits + ' ' + - 'records: ' + data.records + ' ' + - 'clients: ' + data.clients + ' ' + - 'searching: ' + data.searching + ''; + stat.innerHTML = 'Active clients: '+ data.activeclients + + '/' + data.clients + ' | ' + + 'Retrieved records: ' + data.records + + '/' + data.hits + ''; } function my_onterm(data) { var termlist = document.getElementById("termlist"); termlist.innerHTML = "
TERMLISTS:
"; - termlist.innerHTML += "
--Author
"; - for (var i = 0; i < data.author.length; i++ ) { - termlist.innerHTML += '
' - + data.author[i].name - + ' (' - + data.author[i].freq - + ')
'; - } - termlist.innerHTML += "
"; - termlist.innerHTML += "
--Subject
"; + 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 += '' + + data.author[i].name + + ' (' + + data.author[i].freq + + ')
'; + } + } function my_onrecord(data) { @@ -176,3 +179,24 @@ function pagerPrev() { if ( my_paz.showPrev() != false ) curPage--; } + +// swithing view between targets and records + +function switchView(view) { + + var targets = document.getElementById('targetview'); + var records = document.getElementById('recordview'); + + switch(view) { + case 'targetview': + targets.style.display = "block"; + records.style.display = "none"; + break; + case 'recordview': + targets.style.display = "none"; + records.style.display = "block"; + break; + default: + alert('Unknown view.'); + } +} diff --git a/www/example/index.html b/www/example/index.html index 789f7b3..66bffb3 100644 --- a/www/example/index.html +++ b/www/example/index.html @@ -1,4 +1,4 @@ - + @@ -25,7 +25,19 @@ height: 1px; } - .heading { + thead { + font-weight: bold; + } + + .jslink { + cursor: pointer; + } + + .jslink:hover { + text-decoration: underline; + } + + #heading { background-color: #ff8c71; border-color: #ff8c71; color: #ffffff; @@ -50,6 +62,11 @@ font-size: 12px; } + div.termtitle { + margin: 4px; + font-weight: bold; + } + div.record { padding: 5px; } @@ -60,50 +77,65 @@ margin: 4px; } + #targetview { + padding: 6px; + } + + + Records Browser + | + Targets Information + +

- +
+ + + + +
PazPar2 +
+ + +
+
- - PazPar2 - -
- - -
- - +
+ + + + + + +
+
+
+
+
+ +
+
+ STATUS INFO: +
+
+
- - -
- - -
- - +
- +