|
1 | 1 | // Define Angular module and whitelist URL of server with Node.js script |
2 | | - var app = angular.module('viewCustom', ['angularLoad']) |
| 2 | + var app = angular.module('viewCustom', ['angularLoad']) |
3 | 3 | .constant('nodeserver', "https://yourserver.edu") |
4 | 4 | .config(['$sceDelegateProvider', 'nodeserver', ($sceDelegateProvider, nodeserver) => { |
5 | 5 | let urlWhitelist = $sceDelegateProvider.resourceUrlWhitelist(); |
6 | | - urlWhitelist.push(`${nodeserver}**`); |
| 6 | + urlWhitelist.push(`${nodeserver}**`); |
7 | 7 | $sceDelegateProvider.resourceUrlWhitelist(urlWhitelist); |
8 | 8 | }]); |
9 | 9 |
|
10 | 10 | // Add Article In Context & BrowZine Links |
11 | | - app.controller('prmSearchResultAvailabilityLineAfterController', function($scope, $http, nodeserver) { |
| 11 | + app.controller('prmSearchResultAvailabilityLineAfterController', function($scope, $http, nodeserver) { |
12 | 12 | var vm = this; |
13 | 13 | if (vm.parentCtrl.result.pnx.addata.doi && vm.parentCtrl.result.pnx.display.type[0] == 'article') { |
14 | 14 | vm.doi = vm.parentCtrl.result.pnx.addata.doi[0] || ''; |
15 | | - var articleURL = nodeserver + "/primo/browzine/browzineArticleInContext?DOI=" + vm.doi; |
| 15 | + var articleURL = nodeserver + "/primo/browzine/articles?DOI=" + vm.doi; |
16 | 16 | $http.jsonp(articleURL, {jsonpCallbackParam: 'callback'}).then(function(response) { |
17 | 17 | $scope.article = response.data; |
18 | 18 | }, function(error){ |
19 | 19 | console.log(error); |
20 | 20 | }); |
21 | 21 | } |
22 | | - if (vm.parentCtrl.result.pnx.addata.issn && vm.parentCtrl.result.pnx.display.type[0] == 'journal') { |
| 22 | + if (vm.parentCtrl.result.pnx.addata.issn && vm.parentCtrl.result.pnx.display.type[0] == 'journal') { |
23 | 23 | vm.issn = vm.parentCtrl.result.pnx.addata.issn[0].replace("-", "") || ''; |
24 | | - var journalURL = nodeserver + "/primo/browzine/browzineJournals?ISSN=" + vm.issn; |
| 24 | + var journalURL = nodeserver + "/primo/browzine/journals?ISSN=" + vm.issn; |
25 | 25 | $http.jsonp(journalURL, {jsonpCallbackParam: 'callback'}).then(function(response) { |
26 | 26 | $scope.journal = response.data; |
27 | 27 | }, function(error){ |
28 | 28 | console.log(error); |
29 | 29 | }); |
30 | 30 | } |
31 | 31 |
|
32 | | - }); |
| 32 | + }); |
33 | 33 |
|
34 | 34 | // Below is where you can customize the wording that is displayed (as well as the hover over text) for the BrowZine links. |
35 | 35 | // 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" |
36 | 36 | // St Olaf is using "View Issue Contents" for the "Article in Context" link but another great option is "View Complete Issue" or "View Article in Context". |
37 | 37 | // St Olaf also has added a hover over link that says "Via BrowZine" to emphasize the interaction being used. |
38 | 38 |
|
39 | | - app.component('prmSearchResultAvailabilityLineAfter', { |
40 | | - bindings: { parentCtrl: '<' }, |
| 39 | + app.component('prmSearchResultAvailabilityLineAfter', { |
| 40 | + bindings: { parentCtrl: '<' }, |
41 | 41 | controller: 'prmSearchResultAvailabilityLineAfterController', |
42 | 42 | template: ` |
43 | 43 | <div ng-if="article.data.browzineWebLink"><a href="{{ article.data.browzineWebLink }}" target="_blank" title="Via BrowZine"><img src="custom/01BRC_SOC/img/browzine.png" class="browzine-icon"> View Issue Contents <md-icon md-svg-icon="primo-ui:open-in-new" aria-label="icon-open-in-new" role="img" class="browzine-external-link"><svg id="open-in-new_cache29" width="100%" height="100%" viewBox="0 0 24 24" y="504" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"></svg></md-icon></a></div> |
44 | 44 | <div ng-if="journal.data[0].browzineWebLink"><a href="{{ journal.data[0].browzineWebLink }}" target="_blank" title="Via BrowZine"><img src="custom/01BRC_SOC/img/browzine.png" class="browzine-icon"> View Journal Contents <md-icon md-svg-icon="primo-ui:open-in-new" aria-label="icon-open-in-new" role="img" class="browzine-external-link"><svg id="open-in-new_cache29" width="100%" height="100%" viewBox="0 0 24 24" y="504" xmlns="http://www.w3.org/2000/svg" fit="" preserveAspectRatio="xMidYMid meet" focusable="false"></svg></md-icon></a></div> |
45 | | - ` |
| 45 | + ` |
46 | 46 | }); |
47 | 47 |
|
48 | 48 | // Add Journal Cover Images from BrowZine |
|
51 | 51 | var newThumbnail = ''; |
52 | 52 | if (vm.parentCtrl.item.pnx.addata.issn) { |
53 | 53 | vm.issn = vm.parentCtrl.item.pnx.addata.issn[0].replace("-", "") || ''; |
54 | | - var journalURL = nodeserver + "/primo/browzine/browzineJournals?ISSN=" + vm.issn; |
| 54 | + var journalURL = nodeserver + "/primo/browzine/journals?ISSN=" + vm.issn; |
55 | 55 | $http.jsonp(journalURL, {jsonpCallbackParam: 'callback'}).then(function(response) { |
56 | 56 | newThumbnail = response.data.data["0"].coverImageUrl; |
57 | 57 | }, function(error){ |
|
61 | 61 | vm.$doCheck = function(changes) { |
62 | 62 | if (vm.parentCtrl.selectedThumbnailLink) { |
63 | 63 | if (newThumbnail != '' && (vm.parentCtrl.selectedThumbnailLink.linkURL.indexOf("icon_journal.png") != -1 || vm.parentCtrl.selectedThumbnailLink.linkURL.indexOf("img/icon_article.png") != -1) ) { |
64 | | - vm.parentCtrl.selectedThumbnailLink.linkURL = newThumbnail; |
| 64 | + vm.parentCtrl.selectedThumbnailLink.linkURL = newThumbnail; |
65 | 65 | } |
66 | 66 | } |
67 | 67 | }; |
|
0 commit comments