Skip to content

Instantly share code, notes, and snippets.

@jkarlsen
jkarlsen / customHoldingsNote.js
Last active April 15, 2024 16:11
Adds notes to particular locations in Primo VE
app.component('prmLocationAfter', {
bindings: { parentCtrl: '<' },
template:
'<custom-holdings-note parent-ctrl="$ctrl.parentCtrl"></custom-holdings-note>'
});
app.component('prmLocationItemsAfter', {
bindings: { parentCtrl: '<' },
template:
'<custom-holdings-note parent-ctrl="$ctrl.parentCtrl"></custom-holdings-note>'
});
@jkarlsen
jkarlsen / changeMenuTarget.js
Created March 2, 2024 00:30
Sets Primo VE menu links to target same window. To only apply to certain links, edit selectors in line 9.
app.component('prmTopNavBarLinksAfter', {
controller: function () {
const vm = this;
vm.$onInit = () => {
// flag will check that links have been changed and then stop this from continuing to run, so as to avoid excessive DOM queries
vm.run = true;
vm.$doCheck = () => {
if (vm.run === true) {
const el = angular.element(document.querySelectorAll('#mainMenu a'));
if (el.length > 0) {
@jkarlsen
jkarlsen / component.js
Last active July 29, 2023 04:12
Alternative ILL link for Primo VE
// copies GES-based ILL link and adds url parameter that can be passed to ILL form, then hides original link. Have not yet added this to production.
app.component('lrIllLink', {
bindings: {parentCtrl: '<'},
template:
`<div ng-if="$ctrl.show">
<md-list layout="column">
<md-list-item>
<div layout="row" flex="">
<div layout="row">
<div layout="column" flex="" flex-xs="100">
@jkarlsen
jkarlsen / custom.js
Last active June 20, 2023 16:10
Code for default Primo VE view that links to college-level views
(() => {
'use strict';
const app = angular.module('viewCustom', ['angularLoad']);
app.component('prmSearchResultAvailabilityLineAfter', {
bindings: { parentCtrl: '<' },
// the template includes the component that we are defining below
template:
'<lr-view-buttons parent-ctrl="$ctrl.parentCtrl"></lr-view-buttons>'
});
app.component('lrViewButtons', {
@jkarlsen
jkarlsen / select.js
Last active June 20, 2023 16:17
Select collections in EBSCOadmin - not scholarly to send to Primo VE OpenURL
(() => {
const collections = [
'system,edsbltc', // asp black thought and culture
'system,a0720561', // newsbank access world news
'system,a00000010400000007503', // digital theatre plus
'system,a0188076', // Gale slavery and anti-slavery I
'system,a0188078', // Gale slavery and antislavery III
// next three are ProQuest NY Times archive - not clear which is correct
'system,pqnytime',
@jkarlsen
jkarlsen / select.js
Last active August 22, 2023 03:29
Select collections for custom links in EBSCOadmin - scholarly for LibKey
(() => {
const collections = [
'system,a00000000280000017891', // JSTOR Archival and Primary Source Collection
'system,a0180353', // Literature Resource Center
'system,a0161245', // ovid
'system,a00000000570000022724', // SAGE Premier 2021
'system,a00000000570000024518', // SAGE Premier 2022
'system,a0261079', // sciencedirect
'system,a00000000580000021983', // Wiley database model 2021
'system,a00000000580000024428', // Wiley db model 2022
@jkarlsen
jkarlsen / gobi title list.js
Last active March 24, 2023 22:19
Create title list from GOBI
var titleList = [];
var isbnList = [];
var titles = document.getElementsByClassName('title-text');
for (var i = 0; i < titles.length; i++) {
titleList.push(titles[i].innerHTML);
}
var el = document.getElementsByClassName('label');
for (i = 0; i < el.length; i++) {
if (el[i].innerHTML === 'ISBN:') {
el[i].classList.add('ib-label');