Browse Source

updated eds js files to get profile from drupal settings

2.x
Paul Pound 7 months ago
parent
commit
222a8f83d0
  1. 4
      modules/roblib_search_eds/js/eds_results_article.js
  2. 4
      modules/roblib_search_eds/js/eds_results_book.js

4
modules/roblib_search_eds/js/eds_results_article.js

@ -3,7 +3,7 @@ Drupal.behaviors.roblib_search_eds_articles = {
if (context == document) {
$query = drupalSettings.path.currentPath.replace('roblib_search/', '');
$url = settings.eds_article_search_url + $query;
profile = settings.eds_article_profile;
article_profile = settings.eds_article_profile;
proxy_url = "https://proxy.library.upei.ca/login?url=";
jQuery.getJSON($url, function (data) {
var items = [];
@ -25,7 +25,7 @@ Drupal.behaviors.roblib_search_eds_articles = {
queries.push(query.query);
})
var query_str = encodeURI(data.queries[0].query);
var href_str = 'https://search.ebscohost.com/login.aspx?direct=true&site=eds-live&scope=site&type=1&custid=uprince&groupid=main&profid=edsapi&mode=bool&lang=en&bquery=';
var href_str = 'https://search.ebscohost.com/login.aspx?direct=true&site=eds-live&scope=site&type=1&custid=uprince&groupid=main&profid=' + article_profile + '&mode=bool&lang=en&bquery=';
jQuery.each(data.documents, function (key, val) {
id = 'roblib-search-eds-article-' + counter;
divs[counter++] = id;

4
modules/roblib_search_eds/js/eds_results_book.js

@ -3,7 +3,7 @@ Drupal.behaviors.roblib_search_eds = {
if (context == document) {
$query = drupalSettings.path.currentPath.replace('roblib_search/', '');
$url = settings.eds_book_search_url + $query;
profile = settings.eds_book_profile;
book_profile = settings.eds_book_profile;
proxy_url = "https://proxy.library.upei.ca/login?url=";
jQuery.getJSON($url, function (data) {
var items = [];
@ -25,7 +25,7 @@ Drupal.behaviors.roblib_search_eds = {
queries.push(query.query);
})
var query_str = encodeURI(data.queries[0].query);
var href_str = 'https://search.ebscohost.com/login.aspx?direct=true&site=eds-live&scope=site&type=1&custid=uprince&groupid=main&profid=lite&mode=bool&lang=en&bquery=';
var href_str = 'https://search.ebscohost.com/login.aspx?direct=true&site=eds-live&scope=site&type=1&custid=uprince&groupid=main&profid='+ book_profile + '&mode=bool&lang=en&bquery=';
jQuery.each(data.documents, function (key, val) {
id = 'roblib-search-eds-' + counter;

Loading…
Cancel
Save