Browse Source

added popups to eds targets and modified eds so we get the detailed record for each result

2.x-ebsco
Paul Pound 11 years ago
parent
commit
442c3bb371
  1. 28
      targets/eds/js/eds_results.js
  2. 38
      targets/eds/js/eds_results_article.js
  3. 12
      targets/eds/roblib_search_eds.module

28
targets/eds/js/eds_results.js

@ -13,12 +13,15 @@ Drupal.behaviors.roblib_search_eds = {
jQuery('#' + 'roblib-search-content-eds').empty().append('No Results'); jQuery('#' + 'roblib-search-content-eds').empty().append('No Results');
jQuery('.' + 'pane-roblib-search-eds-roblib-search-eds-results').hide(); jQuery('.' + 'pane-roblib-search-eds-roblib-search-eds-results').hide();
} else { } else {
var counter = 0;
var divs = new Array();
var content = new Array();
jQuery.each(data.records, function(key, val) { jQuery.each(data.records, function(key, val) {
id = 'roblib-search-eds-' + counter;
//items.push('<a class="roblib-search-eds-tn" href="'+val.ImageInfo.thumb+'"/>'); edsPopulatePopupDivs(content, val, counter);
//jQuery.each(val.RecordInfo.BibEntity.Titles, function(key2, val2){ divs[counter++] = id;
if (typeof val.Items !== 'undefined') { if (typeof val.Items !== 'undefined') {
items.push('<div class ="roblib-search-row">'); items.push('<div class ="roblib-search-row" id="' + id + '">');
if (typeof val.Items.Ti !== 'undefined') { if (typeof val.Items.Ti !== 'undefined') {
jQuery.each(val.Items.Ti, function(key2, val2){ jQuery.each(val.Items.Ti, function(key2, val2){
items.push('<div class="roblib-title eds">'); items.push('<div class="roblib-title eds">');
@ -50,9 +53,11 @@ Drupal.behaviors.roblib_search_eds = {
items.push('</div>'); items.push('</div>');
} }
}); });
jQuery('#' + 'roblib-search-content-eds').empty().append(items.join(''));
qtipify(divs, content, 'Notes');
} }
jQuery('#' + 'roblib-search-content-eds').empty().append(items.join(''));
var queries = []; var queries = [];
jQuery.each(data.queries, function(key7, query){ jQuery.each(data.queries, function(key7, query){
queries.push(query.query); queries.push(query.query);
@ -64,3 +69,14 @@ Drupal.behaviors.roblib_search_eds = {
}); });
} }
} }
function edsPopulatePopupDivs(content, val, counter){
content[counter] = '';
jQuery.each(val.DetailedRecord, function(key, value){
if(value.Group == 'Note' || value.Group == 'TOC') {
content[counter] += '<div class="eds-popup-content"><span class="eds-popup-label">' + value.Label + '</span>' ;
content[counter] += '<span class="eds-popup-value"> ' + value.Data +'</span></div>';
}
})
}

38
targets/eds/js/eds_results_article.js

@ -13,12 +13,16 @@ Drupal.behaviors.roblib_search_eds_articles = {
jQuery('#' + 'roblib-search-content-eds').empty().append('No Results'); jQuery('#' + 'roblib-search-content-eds').empty().append('No Results');
jQuery('.' + 'pane-roblib-search-eds-roblib-search-eds-articles').hide(); jQuery('.' + 'pane-roblib-search-eds-roblib-search-eds-articles').hide();
} else { } else {
var counter = 0;
var divs = new Array();
var content = new Array();
jQuery.each(data.records, function(key, val) { jQuery.each(data.records, function(key, val) {
id = 'roblib-search-eds-article-' + counter;
//items.push('<a class="roblib-search-eds-tn" href="'+val.ImageInfo.thumb+'"/>'); edsPopulatePopupDivs(content, val, counter);
//jQuery.each(val.RecordInfo.BibEntity.Titles, function(key2, val2){ divs[counter++] = id;
if (typeof val.Items !== 'undefined') { if (typeof val.Items !== 'undefined') {
items.push('<div class ="roblib-search-row">'); items.push('<div class ="roblib-search-row" id="' + id +'">');
if (typeof val.Items.Ti !== 'undefined') { if (typeof val.Items.Ti !== 'undefined') {
jQuery.each(val.Items.Ti, function(key2, val2){ jQuery.each(val.Items.Ti, function(key2, val2){
items.push('<div class="roblib-title eds">'); items.push('<div class="roblib-title eds">');
@ -35,16 +39,6 @@ Drupal.behaviors.roblib_search_eds_articles = {
items.push('<div class="eds-src"><span class="eds-label">'+source.Label+':</span> '+source.Data+'</div>'); 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.TypPub !== 'undefined') {
// jQuery.each(val.Items.TypPub, function(key6, typpub){
// items.push('<div class="eds-type">'+typpub.Data+'</div>');
// })
//}
if (typeof val.PLink !== 'undefined'){ if (typeof val.PLink !== 'undefined'){
items.push('<div class="eds-db eds-pdf-link"><a href="'+val.PLink+'">Full Text</a></div>'); items.push('<div class="eds-db eds-pdf-link"><a href="'+val.PLink+'">Full Text</a></div>');
} }
@ -52,9 +46,11 @@ Drupal.behaviors.roblib_search_eds_articles = {
items.push('</div>'); items.push('</div>');
} }
}); });
jQuery('#' + 'roblib-search-content-eds-articles').empty().append(items.join(''));
qtipify(divs, content, 'Notes');
} }
jQuery('#' + 'roblib-search-content-eds-articles').empty().append(items.join(''));
var queries = []; var queries = [];
jQuery.each(data.queries, function(key7, query){ jQuery.each(data.queries, function(key7, query){
queries.push(query.query); queries.push(query.query);
@ -66,3 +62,13 @@ Drupal.behaviors.roblib_search_eds_articles = {
}); });
} }
} }
/*function edsArticlesPopulatePopupDivs(content, val, counter){
content[counter] = '';
jQuery.each(val.DetailedRecord, function(key, value){
if(value.Group == 'Note') {
content[counter] += '<div class="eds-popup-content"><span class="eds-popup-label">' + value.Label + '</span>' ;
content[counter] += '<span class="eds-popup-value"> ' + value.Data +'</span></div>';
}
})
} */

12
targets/eds/roblib_search_eds.module

@ -237,9 +237,21 @@ function roblib_search_eds_get_results($query = NULL, $type = NULL) {
$query = urlencode($query); $query = urlencode($query);
$params = "query=AND,$query&view=detailed&includefacets=n&$limiters&resultsperpage=$number_per_page"; $params = "query=AND,$query&view=detailed&includefacets=n&$limiters&resultsperpage=$number_per_page";
$output = $eds_api->apiSearch($params); $output = $eds_api->apiSearch($params);
$output = roblib_search_eds_get_detailed_result($output, $query, $eds_api);
return json_encode($output); return json_encode($output);
} }
function roblib_search_eds_get_detailed_result(&$output, $query, &$eds_api) {
$detailed_record = array();
foreach ($output['records'] as &$record) {
$db = $record['DbId'];
$an = $record['An'];
$arr = $eds_api->apiRetrieve($an, $db, $query);
$record['DetailedRecord'] = $arr['Items'];
}
return $output;
}
function roblib_search_eds_get_query_limiters($type) { function roblib_search_eds_get_query_limiters($type) {
$limiters = 'n'; $limiters = 'n';
switch ($type) { switch ($type) {

Loading…
Cancel
Save