fixed a bug in the download that didn't allow it include limits such as Class when drilling down, added a slider that allows you to modify the maximum number of results returned and modified the csv template to include the sitename, query text, and date in its header
This commit is contained in:
parent
32395cbac2
commit
b5e148975a
4 changed files with 60 additions and 12 deletions
|
@ -2,13 +2,23 @@
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
// This function creates and styles the "qTip" tooltip that displays the resource uri and the rdf link when the user clicks the uri/rdf icon.
|
// This function creates and styles the "qTip" tooltip that displays the resource uri and the rdf link when the user clicks the uri/rdf icon.
|
||||||
|
|
||||||
$('span#downloadResults').children('img#downloadIcon').each(function()
|
$('span#downloadResults').children('img#downloadIcon').each(function()
|
||||||
{
|
{
|
||||||
$(this).qtip(
|
$(this).qtip(
|
||||||
{
|
{
|
||||||
content: {
|
content: {
|
||||||
prerender: true, // We need this for the .click() event listener on 'a.close'
|
prerender: true, // We need this for the .click() event listener on 'a.close'
|
||||||
text: '<h5>Download the results from this search</h5> <h5 class ="download-url"><a href="' + urlsBase + '/search?querytext=' + queryText +'&xml=1&hitsPerPage=500">download results in XML format</a></h5><h5 class ="download-url"><a href="' + urlsBase + '/search?querytext=' + queryText +'&csv=1&hitsPerPage=500">download results in CSV format</a></h5><br /><a class="close" href="#">close</a>'
|
text: '<div style="float:right; width:150px">'
|
||||||
|
+'<p><label for="amount" style="font-size:14px;">Maximum Records:</label>'
|
||||||
|
+'<input disabled type="text" id="amount" style="margin-left:35px; border: 0; color: #f6931f; font-weight: bold; width:45px" /></p>'
|
||||||
|
+'<div id="slider-vertical" style="margin-left:60px; margin-top: -20px; height: 100px; background-color:white"></div>'
|
||||||
|
+'</div>'
|
||||||
|
+'<div style="float:left; width:300px"><h5>Download the results from this search</h5> '
|
||||||
|
+'<h5 class ="download-url"><a id=xmlDownload href="' + urlsBase + '/search?' + queryText +'&xml=1&hitsPerPage=500">download results in XML format</a></h5>'
|
||||||
|
+'<h5 class ="download-url"><a id=csvDownload href="' + urlsBase + '/search?' + queryText +'&csv=1&hitsPerPage=500">download results in CSV format</a></h5>'
|
||||||
|
+'<br /><a class="close" href="#">close</a></div>'
|
||||||
|
|
||||||
},
|
},
|
||||||
position: {
|
position: {
|
||||||
corner: {
|
corner: {
|
||||||
|
@ -28,12 +38,26 @@ $(document).ready(function(){
|
||||||
},
|
},
|
||||||
style: {
|
style: {
|
||||||
padding: '1em',
|
padding: '1em',
|
||||||
width: 350,
|
width: 500,
|
||||||
backgroundColor: '#f1f2ee'
|
backgroundColor: '#f1f2ee'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$( "#slider-vertical" ).slider({
|
||||||
|
orientation: "vertical",
|
||||||
|
range: "min",
|
||||||
|
min: 10,
|
||||||
|
max: 1000,
|
||||||
|
value: 500,
|
||||||
|
slide: function( event, ui ) {
|
||||||
|
$( "#amount" ).val( ui.value );
|
||||||
|
$('#csvDownload').attr("href", urlsBase + '/search?' + queryText +'&csv=1&hitsPerPage=' + ui.value);
|
||||||
|
$('#xmlDownload').attr("href", urlsBase + '/search?' + queryText +'&xml=1&hitsPerPage=' + ui.value);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$( "#amount" ).val( $( "#slider-vertical" ).slider( "value" ) );
|
||||||
|
|
||||||
|
|
||||||
// Prevent close link for URI qTip from requesting bogus '#' href
|
// Prevent close link for URI qTip from requesting bogus '#' href
|
||||||
|
@ -41,4 +65,6 @@ $(document).ready(function(){
|
||||||
$('#downloadIcon').qtip("hide");
|
$('#downloadIcon').qtip("hide");
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
|
@ -1,5 +1,9 @@
|
||||||
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
|
||||||
URI, Name
|
<#assign today = .now >
|
||||||
|
<#assign todayDate = today?date>
|
||||||
|
Results from ${siteName} for ${querytext} on ${todayDate}
|
||||||
|
|
||||||
|
URI, Name, URL
|
||||||
<#list individuals as individual>
|
<#list individuals as individual>
|
||||||
"${individual.uri}","${individual.name}"
|
"${individual.uri}","${individual.name}","${individual.profileUrl}"
|
||||||
</#list>
|
</#list>
|
||||||
|
|
|
@ -4,15 +4,23 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<h2 style="float:left">
|
<h2 style="float:left">
|
||||||
<#escape x as x?html>
|
<#escape x as x?html>
|
||||||
Search results for '${querytext}'
|
Search results for '${querytext}'
|
||||||
<#if classGroupName?has_content>limited to type '${classGroupName}'</#if>
|
<#if classGroupName?has_content>limited to type '${classGroupName}'</#if>
|
||||||
<#if typeName?has_content>limited to type '${typeName}'</#if>
|
<#if typeName?has_content>limited to type '${typeName}'</#if>
|
||||||
</#escape>
|
</#escape>
|
||||||
<script>
|
<script type="text/javascript">
|
||||||
var queryText = '${querytext}'
|
var url = window.location.toString();
|
||||||
var urlsBase = '${urls.base}'
|
if (url.indexOf("?") == -1){
|
||||||
|
var queryText = 'querytext=${querytext}';
|
||||||
|
} else {
|
||||||
|
var urlArray = url.split("?");
|
||||||
|
var queryText = urlArray[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
var urlsBase = '${urls.base}';
|
||||||
</script>
|
</script>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
@ -105,9 +113,12 @@
|
||||||
|
|
||||||
</div> <!-- end contentsBrowseGroup -->
|
</div> <!-- end contentsBrowseGroup -->
|
||||||
|
|
||||||
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/search.css" />')}
|
${stylesheets.add('<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />',
|
||||||
|
'<link rel="stylesheet" href="${urls.base}/css/search.css" />')}
|
||||||
|
|
||||||
${headScripts.add('<script type="text/javascript" src="${urls.base}/js/jquery_plugins/qtip/jquery.qtip-1.0.0-rc3.min.js"></script>',
|
${headScripts.add('<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>',
|
||||||
'<script type="text/javascript" src="${urls.base}/js/tiny_mce/tiny_mce.js"></script>')}
|
'<script type="text/javascript" src="${urls.base}/js/jquery_plugins/qtip/jquery.qtip-1.0.0-rc3.min.js"></script>',
|
||||||
|
'<script type="text/javascript" src="${urls.base}/js/tiny_mce/tiny_mce.js"></script>'
|
||||||
|
)}
|
||||||
|
|
||||||
${scripts.add('<script type="text/javascript" src="${urls.base}/js/searchDownload.js"></script>')}
|
${scripts.add('<script type="text/javascript" src="${urls.base}/js/searchDownload.js"></script>')}
|
||||||
|
|
|
@ -14,6 +14,13 @@
|
||||||
<doc>
|
<doc>
|
||||||
<str name="uri">${individual.uri?xml}</str>
|
<str name="uri">${individual.uri?xml}</str>
|
||||||
<str name="name">${individual.name?xml}</str>
|
<str name="name">${individual.name?xml}</str>
|
||||||
|
<#if individual.preferredTitle?has_content>
|
||||||
|
<str name="title">${individual.preferredTitle?xml}</str>
|
||||||
|
</#if>
|
||||||
|
<#if individual.email?has_content>
|
||||||
|
<str name="email">"${individual.email}"</str>
|
||||||
|
</#if>
|
||||||
|
<str name="vivo-url">${individual.profileUrl?xml}"</str>
|
||||||
</doc>
|
</doc>
|
||||||
</#list>
|
</#list>
|
||||||
</result>
|
</result>
|
||||||
|
|
Loading…
Add table
Reference in a new issue