Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions js/browzine.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Define Angular module and whitelist URL of server with Node.js script
var app = angular.module('viewCustom', ['angularLoad'])
.constant('nodeserver', "https://yourserver.edu")
.constant('nodeserver', "https://apiconnector.thirdiron.com/v1/libraries/your_browzine_library_id")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I could have nodeserver simply be https://apiconnector.thirdiron.com/v1/libraries/ , and then have another constant - say library_id - be defined later, so that someone integrating this would just need to change what library_id is if they use the apiconnector server.

However, I don't have an instance of Primo to use, so I can't test out how that would work. Even this approach should simplify setup instructions, though.

Thanks!

.config(['$sceDelegateProvider', 'nodeserver', ($sceDelegateProvider, nodeserver) => {
let urlWhitelist = $sceDelegateProvider.resourceUrlWhitelist();
urlWhitelist.push(`${nodeserver}**`);
Expand All @@ -12,7 +12,7 @@
var vm = this;
if (vm.parentCtrl.result.pnx.addata.doi && vm.parentCtrl.result.pnx.display.type[0] == 'article') {
vm.doi = vm.parentCtrl.result.pnx.addata.doi[0] || '';
var articleURL = nodeserver + "/primo/browzine/articles?DOI=" + vm.doi;
var articleURL = nodeserver + "/articles?DOI=" + vm.doi;
$http.jsonp(articleURL, {jsonpCallbackParam: 'callback'}).then(function(response) {
$scope.article = response.data;
}, function(error){
Expand All @@ -21,7 +21,7 @@
}
if (vm.parentCtrl.result.pnx.addata.issn && vm.parentCtrl.result.pnx.display.type[0] == 'journal') {
vm.issn = vm.parentCtrl.result.pnx.addata.issn[0].replace("-", "") || '';
var journalURL = nodeserver + "/primo/browzine/journals?ISSN=" + vm.issn;
var journalURL = nodeserver + "/journals?ISSN=" + vm.issn;
$http.jsonp(journalURL, {jsonpCallbackParam: 'callback'}).then(function(response) {
$scope.journal = response.data;
}, function(error){
Expand Down Expand Up @@ -51,7 +51,7 @@
var newThumbnail = '';
if (vm.parentCtrl.item.pnx.addata.issn) {
vm.issn = vm.parentCtrl.item.pnx.addata.issn[0].replace("-", "") || '';
var journalURL = nodeserver + "/primo/browzine/journals?ISSN=" + vm.issn;
var journalURL = nodeserver + "/journals?ISSN=" + vm.issn;
$http.jsonp(journalURL, {jsonpCallbackParam: 'callback'}).then(function(response) {
newThumbnail = response.data.data["0"].coverImageUrl;
}, function(error){
Expand Down