Browse Source

reformatted code and started work on formatting eds article results

2.x-ebsco
Paul Pound 7 years ago
parent
commit
57918136e8
  1. 13
      targets/eds/js/eds_results.js
  2. 34
      targets/eds/js/eds_results_article.js

13
targets/eds/js/eds_results.js

@ -28,18 +28,13 @@ Drupal.behaviors.roblib_search_eds = {
items.push('<a href="http://proxy.library.upei.ca/login?url=' + val.PLink + '&scope=site">' + val2.TitleFull + '</a></div>'); items.push('<a href="http://proxy.library.upei.ca/login?url=' + val.PLink + '&scope=site">' + val2.TitleFull + '</a></div>');
}) })
} }
val.pubType == 'Book' ? pubType = 'Print Book' : pubType = val.pubType; pubType = val.pubType;
pubYear = val.RecordInfo.BibRelationships.IsPartOfRelationships["date"]; pubYear = val.RecordInfo.BibRelationships.IsPartOfRelationships["date"];
!pubYear ? pubYear = " " : pubYear = pubYear[0]["Y"]; !pubYear ? pubYear = " " : pubYear = pubYear[0]["Y"];
if (typeof val.Items.TypPub !== 'undefined') {
jQuery.each(val.Items.TypPub, function (key6, typpub) {
//strs = typpub.Data.split('; ');
//types = roblib_intersects(strs, ['<span class="highlight">Book</span>', '<span class="highlight">eBook</span>']);
items.push('<div class="eds-type"><span class="eds-pubyear">' + pubYear + '</span> - ' + pubType + '</div>'); items.push('<div class="eds-type"><span class="eds-pubyear">' + pubYear + '</span> - ' + pubType + '</div>');
})
}
var roblib_authors =[]; var roblib_authors =[];
jQuery.each(val.RecordInfo.BibRelationships.HasContributorRelationships, function (key3, author) { jQuery.each(val.RecordInfo.BibRelationships.HasContributorRelationships, function (key3, author) {
roblib_authors.push(author.NameFull); roblib_authors.push(author.NameFull);
@ -50,7 +45,7 @@ Drupal.behaviors.roblib_search_eds = {
items.push(roblib_authors); items.push(roblib_authors);
items.push('</div>'); items.push('</div>');
if (typeof val.Items.Src !== 'undefined') { /*if (typeof val.Items.Src !== 'undefined') {
jQuery.each(val.Items.Src, function (key4, source) { jQuery.each(val.Items.Src, function (key4, source) {
items.push('<div class="eds-src">' + source.Data + '</div>'); items.push('<div class="eds-src">' + source.Data + '</div>');
}) })
@ -59,7 +54,7 @@ Drupal.behaviors.roblib_search_eds = {
jQuery.each(val.Items.PubIrInfo, function (key5, pubinfo) { jQuery.each(val.Items.PubIrInfo, function (key5, pubinfo) {
items.push('<div class="eds-pubinfo">' + pubinfo.Data + '</div>'); items.push('<div class="eds-pubinfo">' + pubinfo.Data + '</div>');
}) })
} }*/
var url; var url;
!val.Items.URL ? url = " " : url = val.Items.URL[0].Data; !val.Items.URL ? url = " " : url = val.Items.URL[0].Data;
if(url) { if(url) {

34
targets/eds/js/eds_results_article.js

@ -29,14 +29,28 @@ Drupal.behaviors.roblib_search_eds_articles = {
items.push('<a href="http://proxy.library.upei.ca/login?url=' + val.PLink + '&scope=site">' + val2.Data + '</a></div>'); items.push('<a href="http://proxy.library.upei.ca/login?url=' + val.PLink + '&scope=site">' + val2.Data + '</a></div>');
}) })
} }
items.push('<div class="eds-sor">'); pubType = val.pubType;
jQuery.each(val.RecordInfo.BibRelationships.HasContributorRelationships, function(key3, authors){
items.push(authors.NameFull+';'+' '); pubYear = val.RecordInfo.BibRelationships.IsPartOfRelationships["date"];
!pubYear ? pubYear = " " : pubYear = pubYear[0]["Y"];
items.push('<div class="eds-type"><span class="eds-pubyear">' + pubYear + '</span> - ' + pubType + '</div>');
var roblib_authors = [];
jQuery.each(val.RecordInfo.BibRelationships.HasContributorRelationships, function (key3, author) {
roblib_authors.push(author.NameFull);
}) })
items.push('<div class="eds-sor">');
roblib_authors = roblib_shorten(roblib_authors.join('; '), 50, " ");
items.push(roblib_authors);
items.push('</div>'); items.push('</div>');
if (typeof val.Items.Src !== 'undefined') { if (typeof val.Items.Src !== 'undefined') {
jQuery.each(val.Items.Src, function (key4, source) { jQuery.each(val.Items.Src, function (key4, source) {
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">In:</span> ' + source.Data + '</div>');
}) })
} }
if (typeof val.PLink !== 'undefined' && typeof val.PDF !== 'undefined' && val.PDF == 'pdflink') { if (typeof val.PLink !== 'undefined' && typeof val.PDF !== 'undefined' && val.PDF == 'pdflink') {
@ -45,13 +59,10 @@ Drupal.behaviors.roblib_search_eds_articles = {
if (typeof val.PLink !== 'undefined' && typeof val.HTML !== 'undefined' && val.HTML == '1') { if (typeof val.PLink !== 'undefined' && typeof val.HTML !== 'undefined' && val.HTML == '1') {
items.push('<div class="eds-db eds-pdf-link"><a href="' + val.PLink + '&scope=site">HTML Full Text</a></div>'); items.push('<div class="eds-db eds-pdf-link"><a href="' + val.PLink + '&scope=site">HTML Full Text</a></div>');
} }
//items.push('<div class="eds-db">'+val.DbLabel+'</div>');
items.push('</div>'); items.push('</div>');
} }
}); });
jQuery('#' + 'roblib-search-content-eds-articles').empty().append(items.join('')); jQuery('#' + 'roblib-search-content-eds-articles').empty().append(items.join(''));
//qtipify(divs, content, 'Notes');
} }
var queries = []; var queries = [];
@ -66,12 +77,3 @@ 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>';
}
})
} */

Loading…
Cancel
Save