Browse Source

updated eds js files to get profile from drupal settings

2.x
Paul Pound 10 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) { if (context == document) {
$query = drupalSettings.path.currentPath.replace('roblib_search/', ''); $query = drupalSettings.path.currentPath.replace('roblib_search/', '');
$url = settings.eds_article_search_url + $query; $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="; proxy_url = "https://proxy.library.upei.ca/login?url=";
jQuery.getJSON($url, function (data) { jQuery.getJSON($url, function (data) {
var items = []; var items = [];
@ -25,7 +25,7 @@ Drupal.behaviors.roblib_search_eds_articles = {
queries.push(query.query); queries.push(query.query);
}) })
var query_str = encodeURI(data.queries[0].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) { jQuery.each(data.documents, function (key, val) {
id = 'roblib-search-eds-article-' + counter; id = 'roblib-search-eds-article-' + counter;
divs[counter++] = id; 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) { if (context == document) {
$query = drupalSettings.path.currentPath.replace('roblib_search/', ''); $query = drupalSettings.path.currentPath.replace('roblib_search/', '');
$url = settings.eds_book_search_url + $query; $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="; proxy_url = "https://proxy.library.upei.ca/login?url=";
jQuery.getJSON($url, function (data) { jQuery.getJSON($url, function (data) {
var items = []; var items = [];
@ -25,7 +25,7 @@ Drupal.behaviors.roblib_search_eds = {
queries.push(query.query); queries.push(query.query);
}) })
var query_str = encodeURI(data.queries[0].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) { jQuery.each(data.documents, function (key, val) {
id = 'roblib-search-eds-' + counter; id = 'roblib-search-eds-' + counter;

Loading…
Cancel
Save