/
custom.js
156 lines (134 loc) · 5.9 KB
/
custom.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/*Global variables*/
var vid = "OUHK";
var libPrimoVid = "ouhk";
var pdsServer = "primo2.lib.ouhk.edu.hk";
var libPrimoServer = "www2.lib.ouhk.edu.hk";
var csidsPrimoServer = "primo2.csids.edu.hk";
var institute = "OUHK";
var xhttp = new XMLHttpRequest();
xhttp.open("GET", "/primo_library/libweb/action/search.do?vid=" + vid, true);
xhttp.send();
/*GA track code*/
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-98135600-1', 'auto');
ga('send', 'pageview');
(function () {
"use strict";
'use strict';
var app = angular.module('viewCustom', ['angularLoad']);
/*Start - CSIDS OUHK LIB View Customization */
/*Start - Convert to Simp Chin on Simp-Chin-Interface*/
app.component('prmBriefResultContainerAfter', {
require: ['child', '^parent'],
bindings: {parentCtrl: '='},
controller: 'prmBriefResultContainerAfterController'
});
app.controller('prmBriefResultContainerAfterController', ['angularLoad', function (angularLoad) {
var prmCtrl = this;
angular.element(document).ready(function () {
angularLoad.loadScript('/primo-explore/custom/' + vid + '/js/simpTradChinConversion.js')
.then(function(){briefViewConvertToSimpChin(prmCtrl);});
});
}]);
/*End - Convert to Simp Chin on Simp-Chin-Interface*/
/*Start - Change eshelf icon*/
app.component('prmIconAfter', {
require: ['child', '^parent'],
bindings: {parentCtrl: '<'},
controller: 'prmIconAfterController'
});
app.controller('prmIconAfterController', ['angularLoad', function (angularLoad) {
var prmCtrl=this;
angular.element(document).ready(function () {
angularLoad.loadScript('/primo-explore/custom/' + vid + '/js/ouhk.js').then(function(){changeEshelfIcon(prmCtrl);});
});
}]);
/*End - Change eshelf icon*/
/*Start - 1. Logout also to CSIDS Primo and 2. Change the guest wordings.*/
app.component('prmAuthenticationAfter', {
require: ['child', '^parent'],
bindings: {parentCtrl: '='},
controller: 'prmAuthenticationAfterController'
});
app.controller('prmAuthenticationAfterController', ['angularLoad', function (angularLoad) {
var prmCtrl = this;
//logout OU LIB Primo also
angularLoad.loadScript('/primo-explore/custom/' + vid + '/js/csids_ouhk.js').then(function(){logoutLIBPrimoAlso(prmCtrl);});
//handle logout request from OU LIB Primo
angularLoad.loadScript('/primo-explore/custom/' + vid + '/js/csids_ouhk.js').then(function(){handleLogoutFromLIBPrimo(prmCtrl);});
//Change the user area guest wording
angularLoad.loadScript('/primo-explore/custom/' + vid + '/js/ouhk.js').then(function(){changeGuestWordings(prmCtrl);});
}]);
/*End - 1. Logout also to CSIDS Primo and 2. Change the guest wordings.*/
/*Start - Fix Send Email Record Source ID Problem.*/
app.component('prmSendEmailAfter', {
require: ['child', '^parent'],
bindings: {parentCtrl: '='},
controller: 'prmSendEmailAfterController'
});
app.controller('prmSendEmailAfterController', ['angularLoad', function (angularLoad) {
var prmCtrl = this;
angularLoad.loadScript('/primo-explore/custom/' + vid + '/js/ouhk.js').then(function(){fixSendEmailRecord(prmCtrl);});
}]);
/*End - Fix Send Email Record Source ID Problem*/
/*Start - Add reminder for the citation users.*/
app.component('prmCitationAfter', {
templateUrl: '/primo-explore/custom/' + vid + '/html/prmCitationAfter.html',
require: ['child', '^parent'],
bindings: {parentCtrl: '='},
});
/*End - Add reminder for the citation users.*/
/*End - CSIDS OUHK View Customization */
/*Start - CSIDS Union Search Customized Features*/
/*Start - Check if in Union Search and prepare for the customized Features*/
app.component('prmSearchBarAfter', {
require: ['child', '^parent'],
bindings: {parentCtrl: '='},
controller: 'prmSearchBarAfterController'
});
app.controller('prmSearchBarAfterController', ['angularLoad', function (angularLoad) {
var prmCtrl = this;
angularLoad.loadScript('/primo-explore/custom/' + vid + '/js/csids.js').then(function(){ prepareUnionSearchFeature(prmCtrl);});
}]);
/*End - Check if in Union Search and prepare for the customized Features*/
/*Start - CSIDS Customed Viewonline*/
app.component('prmFullViewAfter', {
require: ['child', '^parent'],
bindings: {parentCtrl: '='},
controller: 'prmFullViewAfterController'
});
app.controller('prmFullViewAfterController', ['angularLoad', function (angularLoad) {
var prmCtrl = this;
angularLoad.loadScript('/primo-explore/custom/' + vid + '/js/csids.js').then(function(){customizedViewonlineTab(prmCtrl);});
}]);
/*End - CSIDS Customed Viewonline*/
/*Start - CSIDS Customed Location Tab RTA*/
app.component('prmLocationsAfter', {
require: ['child', '^parent'],
bindings: {parentCtrl: '='},
controller: 'prmLocationsAfter'
});
app.controller('prmLocationsAfter', ['angularLoad', function (angularLoad) {
var prmCtrl = this;
angularLoad.loadScript('/primo-explore/custom/' + vid + '/js/csids.js').then(function(){customizedLocationTabRTA(prmCtrl);});
}]);
/*End - CSIDS Customed Location Tab RTA*/
/*Start - CSIDS Customed Summary Status and ILL Tab*/
app.component('prmSearchResultAvailabilityLineAfter', {
bindings: { parentCtrl: '<' },
controller: 'prmSearchResultAvailabilityLineAfterController',
templateUrl: '/primo-explore/custom/' + vid + '/html/csids_summarystatus_and_ill.html',
});
app.controller('prmSearchResultAvailabilityLineAfterController', ['angularLoad', function(angularLoad){
var prmCtrl = this;
angularLoad.loadScript('/primo-explore/custom/' + vid + '/js/csids.js').then(function(){
customizedSummaryStatus(prmCtrl);
customizedILLTab(prmCtrl);
});
}]);
/*End - CSIDS Customed Summary Status and ILL Tab*/
/*End - CSIDS Union Search Customized Features*/
})();