Browse Source

using labels provided by eds

2.x-ebsco
Paul Pound 11 years ago
parent
commit
22266c2d8e
  1. 4
      targets/eds/css/roblib_search_eds.css
  2. 8
      targets/eds/js/eds_results.js
  3. 36
      targets/eds/js/eds_results_article.js
  4. 2
      targets/eds/roblib_search_eds.module

4
targets/eds/css/roblib_search_eds.css

@ -11,3 +11,7 @@
.eds-sor, .eds-date, .eds-holdings-item, .eds-db, .eds-src, .eds-pubinfo, .eds-type{
padding-left: 10px; font-size: smaller;
}
.eds-label {
font-weight: bolder;
}

8
targets/eds/js/eds_results.js

@ -25,9 +25,11 @@ Drupal.behaviors.roblib_search_eds = {
items.push('<a href="'+val.PLink+'">'+val2.Data+'</a></div>');
})
}
items.push('<div class="eds-sor">');
jQuery.each(val.RecordInfo.BibRelationships.HasContributorRelationships, function(key3, authors){
items.push('<div class="eds-sor">'+authors.NameFull+'</div>');
})
items.push(authors.NameFull+';'+' ');
})
items.push('</div>');
if (typeof val.Items.Src !== 'undefined') {
jQuery.each(val.Items.Src, function(key4, source){
items.push('<div class="eds-src">'+source.Data+'</div>');
@ -40,7 +42,7 @@ Drupal.behaviors.roblib_search_eds = {
}
if (typeof val.Items.TypPub !== 'undefined') {
jQuery.each(val.Items.TypPub, function(key6, typpub){
items.push('<div class="eds-type">'+typpub.Data+'</div>');
items.push('<div class="eds-type"><span class="eds-label">'+typpub.Label+'</span>: '+typpub.Data+'</div>');
})
}

36
targets/eds/js/eds_results_article.js

@ -25,26 +25,30 @@ Drupal.behaviors.roblib_search_eds_articles = {
items.push('<a href="'+val.PLink+'">'+val2.Data+'</a></div>');
})
}
items.push('<div class="eds-sor">');
jQuery.each(val.RecordInfo.BibRelationships.HasContributorRelationships, function(key3, authors){
items.push('<div class="eds-sor">'+authors.NameFull+'</div>');
})
items.push(authors.NameFull+';'+' ');
})
items.push('</div>');
if (typeof val.Items.Src !== 'undefined') {
jQuery.each(val.Items.Src, function(key4, source){
items.push('<div class="eds-src">'+source.Data+'</div>');
jQuery.each(val.Items.Src, function(key4, source){
items.push('<div class="eds-src"><span class="eds-label">'+source.Label+':</span> '+source.Data+'</div>');
})
}
if (typeof val.Items.PubIrInfo !== 'undefined') {
jQuery.each(val.Items.PubIrInfo, function(key5, pubinfo){
items.push('<div class="eds-pubinfo">'+pubinfo.Data+'</div>');
})
//if (typeof val.Items.PubIrInfo !== 'undefined') {
// jQuery.each(val.Items.PubIrInfo, function(key5, pubinfo){
// items.push('<div class="eds-pubinfo">'+pubinfo.Data+'</div>');
// })
//}
//if (typeof val.Items.TypPub !== 'undefined') {
// jQuery.each(val.Items.TypPub, function(key6, typpub){
// items.push('<div class="eds-type">'+typpub.Data+'</div>');
// })
//}
if (typeof val.PLink !== 'undefined'){
items.push('<div class="eds-db eds-pdf-link"><a href="'+val.PLink+'">Full Text</a></div>');
}
if (typeof val.Items.TypPub !== 'undefined') {
jQuery.each(val.Items.TypPub, function(key6, typpub){
items.push('<div class="eds-type">'+typpub.Data+'</div>');
})
}
items.push('<div class="eds-db">'+val.DbLabel+'</div>');
//items.push('<div class="eds-db">'+val.DbLabel+'</div>');
items.push('</div>');
}
@ -57,7 +61,7 @@ Drupal.behaviors.roblib_search_eds_articles = {
})
var query_str = data.queries[0].query;
var href_str = 'http://search.ebscohost.com/login.aspx?direct=true&site=ehost-live&scope=site&type=1&custid=uprince&groupid=main&profid=eds&mode=bool&lang=en&bquery=';
jQuery('#roblib-search-eds-more').empty().append('<a href="'+href_str+query_str+'" id="see_all_results">See all ' + data.recordCount + ' results</a>');
jQuery('#roblib-search-eds-article-more').empty().append('<a href="'+href_str+query_str+'" id="see_all_results">See all ' + data.recordCount + ' results</a>');
});
}

2
targets/eds/roblib_search_eds.module

@ -225,7 +225,7 @@ function roblib_search_eds_get_results($query = NULL, $type = NULL) {
$number_per_page = variable_get('roblib_search_eds_num_results', '5');
$query = urlencode($query);
$query = $query;
$params = "query=AND,$query&includefacets=y&$limiters&resultsperpage=$number_per_page";
$params = "query=OR,$query&includefacets=y&$limiters&resultsperpage=$number_per_page";
$output = $eds_api->apiSearch($params);
return json_encode($output);
}

Loading…
Cancel
Save