projects
/
pazpar2-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove illegal ccl characters from subject refinements.
[pazpar2-moved-to-github.git]
/
www
/
test1
/
index.html
diff --git
a/www/test1/index.html
b/www/test1/index.html
index
3b44bcc
..
9360c46
100644
(file)
--- a/
www/test1/index.html
+++ b/
www/test1/index.html
@@
-103,7
+103,7
@@
function show_records()
var xml = xshow.responseXML;
var body = document.getElementById("body");
var hits = xml.getElementsByTagName("hit");
var xml = xshow.responseXML;
var body = document.getElementById("body");
var hits = xml.getElementsByTagName("hit");
- if (!hits[0])
+ if (!hits[0]) // We should never get here with blocking operations
{
body.innerHTML = "No records yet";
searchtimer = setTimeout(check_search, 250);
{
body.innerHTML = "No records yet";
searchtimer = setTimeout(check_search, 250);
@@
-141,12
+141,12
@@
function show_records()
}
shown++;
if (shown < 5)
}
shown++;
if (shown < 5)
- searchtimer = setTimeout(check_search, 400);
- else if (shown < 10)
searchtimer = setTimeout(check_search, 1000);
else
searchtimer = setTimeout(check_search, 1000);
else
- searchtimer = setTimeout(check_search, 4000);
+ searchtimer = setTimeout(check_search, 2000);
}
}
+ if (!termtimer)
+ termtimer = setTimeout(check_termlist, 1000);
}
function check_search()
}
function check_search()
@@
-155,24
+155,37
@@
function check_search()
var url = "search.pz2?" +
"command=show" +
"&start=" + startrec +
var url = "search.pz2?" +
"command=show" +
"&start=" + startrec +
- "&session=" + session;
+ "&session=" + session +
+ "&block=1";
xshow = GetXmlHttpObject();
xshow.onreadystatechange=show_records;
xshow.open("GET", url);
xshow.send(null);
}
xshow = GetXmlHttpObject();
xshow.onreadystatechange=show_records;
xshow.open("GET", url);
xshow.send(null);
}
+
+function refine_query (obj) {
+ var query_cell = document.getElementById('query');
+ var subject = obj.innerHTML;
+
+ subject = subject.replace(/[\(\)]/g, '');
+ query_cell.value += ' and su=(' + subject + ')';
+ start_search();
+}
+
function show_termlist()
{
if (xtermlist.readyState != 4)
return;
function show_termlist()
{
if (xtermlist.readyState != 4)
return;
+
var i;
var xml = xtermlist.responseXML;
var body = document.getElementById("termlist");
var hits = xml.getElementsByTagName("term");
if (!hits[0])
{
var i;
var xml = xtermlist.responseXML;
var body = document.getElementById("termlist");
var hits = xml.getElementsByTagName("term");
if (!hits[0])
{
- termtimer = (check_termlist, 1000);
+ termtimer = setTimeout(check_termlist, 1000);
+
}
else
{
}
else
{
@@
-181,7
+194,9
@@
function show_termlist()
{
var namen = hits[i].getElementsByTagName("name");
if (namen[0])
{
var namen = hits[i].getElementsByTagName("name");
if (namen[0])
- body.innerHTML += namen[0].childNodes[0].nodeValue;
+ body.innerHTML += '<a href="#" onclick="refine_query(this)">' +
+ namen[0].childNodes[0].nodeValue +
+ '</a>';
/*
body.innerHTML += ' (';
var freqn = hits[i].getElementsByTagName("frequency");
/*
body.innerHTML += ' (';
var freqn = hits[i].getElementsByTagName("frequency");
@@
-260,17
+275,20
@@
function search_started()
alert(msg);
return;
}
alert(msg);
return;
}
- searchtimer = setTimeout(check_search, 250);
- termtimer = setTimeout(check_termlist, 1000);
+ check_search();
stattimer = setTimeout(check_stat, 1000);
}
function start_search()
{
clearTimeout(termtimer);
stattimer = setTimeout(check_stat, 1000);
}
function start_search()
{
clearTimeout(termtimer);
+ termtimer = 0;
clearTimeout(searchtimer);
clearTimeout(searchtimer);
+ searchtimer = 0;
clearTimeout(stattimer);
clearTimeout(stattimer);
+ stattimer = 0;
clearTimeout(showtimer);
clearTimeout(showtimer);
+ showtimer = 0;
if (!targets_loaded)
{
alert("Please load targets first");
if (!targets_loaded)
{
alert("Please load targets first");