Skip to content

Commit 5cd627c

Browse files
authored
Merge pull request #12 from jnylin/master
Set the book icon src from the controller
2 parents 8c0599a + 4c67a7e commit 5cd627c

1 file changed

Lines changed: 24 additions & 21 deletions

File tree

js/browzine.js

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,30 @@ var app = angular.module('viewCustom', ['angularLoad'])
88
}]);
99

1010
// Add Article In Context & BrowZine Links
11-
app.controller('prmSearchResultAvailabilityLineAfterController', function ($scope, $http, nodeserver) {
12-
var vm = this;
13-
if (vm.parentCtrl.result.pnx.addata.doi && vm.parentCtrl.result.pnx.display.type[0] == 'article') {
14-
vm.doi = vm.parentCtrl.result.pnx.addata.doi[0] || '';
15-
var articleURL = nodeserver + "/primo/browzine/articles?DOI=" + vm.doi;
16-
$http.jsonp(articleURL, { jsonpCallbackParam: 'callback' }).then(function (response) {
17-
$scope.article = response.data;
18-
}, function (error) {
19-
console.log(error);
20-
});
21-
}
22-
if (vm.parentCtrl.result.pnx.addata.issn && vm.parentCtrl.result.pnx.display.type[0] == 'journal') {
23-
vm.issn = vm.parentCtrl.result.pnx.addata.issn[0].replace("-", "") || '';
24-
var journalURL = nodeserver + "/primo/browzine/journals?ISSN=" + vm.issn;
25-
$http.jsonp(journalURL, { jsonpCallbackParam: 'callback' }).then(function (response) {
26-
$scope.journal = response.data;
27-
}, function (error) {
28-
console.log(error);
29-
});
30-
}
31-
});
11+
app.controller('prmSearchResultAvailabilityLineAfterController', function($scope, $http, nodeserver) {
12+
var vm = this;
13+
$scope.book_icon = "https://s3.amazonaws.com/thirdiron-assets/images/integrations/browzine_open_book_icon.png";
14+
if (vm.parentCtrl.result.pnx.addata.doi && vm.parentCtrl.result.pnx.display.type[0] == 'article') {
15+
vm.doi = vm.parentCtrl.result.pnx.addata.doi[0] || '';
16+
var articleURL = nodeserver + "/primo/browzine/articles?DOI=" + vm.doi;
17+
$http.jsonp(articleURL, {jsonpCallbackParam: 'callback'}).then(function(response) {
18+
$scope.article = response.data;
19+
}, function(error){
20+
console.log(error);
21+
});
22+
}
23+
if (vm.parentCtrl.result.pnx.addata.issn && vm.parentCtrl.result.pnx.display.type[0] == 'journal') {
24+
vm.issn = vm.parentCtrl.result.pnx.addata.issn[0].replace("-", "") || '';
25+
var journalURL = nodeserver + "/primo/browzine/journals?ISSN=" + vm.issn;
26+
$http.jsonp(journalURL, {jsonpCallbackParam: 'callback'}).then(function(response) {
27+
$scope.journal = response.data;
28+
}, function(error){
29+
console.log(error);
30+
});
31+
}
32+
33+
});
34+
3235

3336
// Below is where you can customize the wording that is displayed (as well as the hover over text) for the BrowZine links.
3437
// St Olaf has chosen "View Journal Contents" for the "Journal Availability Link" but other great options include things such as "View Journal" or "View this Journal"

0 commit comments

Comments
 (0)