From 22266c2d8e4fdb0ad5011107f61cefeb5a6a7f8b Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Fri, 30 May 2014 10:58:58 -0300 Subject: [PATCH] using labels provided by eds --- targets/eds/css/roblib_search_eds.css | 4 +++ targets/eds/js/eds_results.js | 8 +++--- targets/eds/js/eds_results_article.js | 36 +++++++++++++++------------ targets/eds/roblib_search_eds.module | 2 +- 4 files changed, 30 insertions(+), 20 deletions(-) diff --git a/targets/eds/css/roblib_search_eds.css b/targets/eds/css/roblib_search_eds.css index f52b497..0df0197 100644 --- a/targets/eds/css/roblib_search_eds.css +++ b/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; +} diff --git a/targets/eds/js/eds_results.js b/targets/eds/js/eds_results.js index 7d06d5c..f0f0d0a 100644 --- a/targets/eds/js/eds_results.js +++ b/targets/eds/js/eds_results.js @@ -25,9 +25,11 @@ Drupal.behaviors.roblib_search_eds = { items.push(''+val2.Data+''); }) } + items.push('
'); jQuery.each(val.RecordInfo.BibRelationships.HasContributorRelationships, function(key3, authors){ - items.push('
'+authors.NameFull+'
'); - }) + items.push(authors.NameFull+';'+' '); + }) + items.push('
'); if (typeof val.Items.Src !== 'undefined') { jQuery.each(val.Items.Src, function(key4, source){ items.push('
'+source.Data+'
'); @@ -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('
'+typpub.Data+'
'); + items.push('
'+typpub.Label+': '+typpub.Data+'
'); }) } diff --git a/targets/eds/js/eds_results_article.js b/targets/eds/js/eds_results_article.js index 78d0255..e3ee0a2 100644 --- a/targets/eds/js/eds_results_article.js +++ b/targets/eds/js/eds_results_article.js @@ -25,26 +25,30 @@ Drupal.behaviors.roblib_search_eds_articles = { items.push(''+val2.Data+''); }) } + items.push('
'); jQuery.each(val.RecordInfo.BibRelationships.HasContributorRelationships, function(key3, authors){ - items.push('
'+authors.NameFull+'
'); - }) + items.push(authors.NameFull+';'+' '); + }) + items.push('
'); if (typeof val.Items.Src !== 'undefined') { - jQuery.each(val.Items.Src, function(key4, source){ - items.push('
'+source.Data+'
'); + jQuery.each(val.Items.Src, function(key4, source){ + items.push('
'+source.Label+': '+source.Data+'
'); }) } - if (typeof val.Items.PubIrInfo !== 'undefined') { - jQuery.each(val.Items.PubIrInfo, function(key5, pubinfo){ - items.push('
'+pubinfo.Data+'
'); - }) + //if (typeof val.Items.PubIrInfo !== 'undefined') { + // jQuery.each(val.Items.PubIrInfo, function(key5, pubinfo){ + // items.push('
'+pubinfo.Data+'
'); + // }) + //} + //if (typeof val.Items.TypPub !== 'undefined') { + // jQuery.each(val.Items.TypPub, function(key6, typpub){ + // items.push('
'+typpub.Data+'
'); + // }) + //} + if (typeof val.PLink !== 'undefined'){ + items.push(''); } - if (typeof val.Items.TypPub !== 'undefined') { - jQuery.each(val.Items.TypPub, function(key6, typpub){ - items.push('
'+typpub.Data+'
'); - }) - } - - items.push('
'+val.DbLabel+'
'); + //items.push('
'+val.DbLabel+'
'); items.push(''); } @@ -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('See all ' + data.recordCount + ' results'); + jQuery('#roblib-search-eds-article-more').empty().append('See all ' + data.recordCount + ' results'); }); } diff --git a/targets/eds/roblib_search_eds.module b/targets/eds/roblib_search_eds.module index f5f7191..2c7b37f 100644 --- a/targets/eds/roblib_search_eds.module +++ b/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); }