blacklight-frontend 7.38.0 → 7.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/assets/javascripts/blacklight/blacklight.esm.js +276 -76
- package/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
- package/app/assets/javascripts/blacklight/blacklight.js +5 -10
- package/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
- package/app/assets/stylesheets/blacklight/_constraints.scss +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
attribute (HTML5-style doc-*) that contains the id/primary key
|
|
11
11
|
of the object in question -- used by plugin for a unique value for
|
|
12
12
|
DOM id's.
|
|
13
|
-
Uses HTML for a checkbox compatible with Bootstrap
|
|
13
|
+
Uses HTML for a checkbox compatible with Bootstrap.
|
|
14
14
|
new CheckboxSubmit(document.querySelector('form.something')).render()
|
|
15
15
|
*/
|
|
16
16
|
class CheckboxSubmit {
|
|
@@ -36,8 +36,16 @@ class CheckboxSubmit {
|
|
|
36
36
|
}).then((json) => {
|
|
37
37
|
this.labelTarget.removeAttribute('disabled');
|
|
38
38
|
this.checkboxTarget.removeAttribute('disabled');
|
|
39
|
+
// For accessibility return keyboard focus
|
|
40
|
+
// back to the checkbox after form submission
|
|
41
|
+
this.checkboxTarget.focus();
|
|
39
42
|
this.updateStateFor(!this.checked);
|
|
40
|
-
|
|
43
|
+
this.bookmarksCounter().forEach(counter => {
|
|
44
|
+
counter.innerHTML = json.bookmarks.count;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
var e = new CustomEvent('bookmark.blacklight', { detail: { checked: this.checked }, bubbles: true });
|
|
48
|
+
this.formTarget.dispatchEvent(e);
|
|
41
49
|
}).catch((error) => {
|
|
42
50
|
this.handleError(error);
|
|
43
51
|
});
|
|
@@ -63,12 +71,17 @@ class CheckboxSubmit {
|
|
|
63
71
|
return this.form.querySelector('[data-checkboxsubmit-target="span"]')
|
|
64
72
|
}
|
|
65
73
|
|
|
74
|
+
bookmarksCounter() {
|
|
75
|
+
return document.querySelectorAll('[data-role="bookmark-counter"]')
|
|
76
|
+
}
|
|
77
|
+
|
|
66
78
|
handleError() {
|
|
67
79
|
alert("Unable to save the bookmark at this time.");
|
|
68
80
|
}
|
|
69
81
|
|
|
70
82
|
updateStateFor(state) {
|
|
71
|
-
this.checkboxTarget.checked
|
|
83
|
+
if (state) { this.checkboxTarget.setAttribute('checked', state); }
|
|
84
|
+
else { this.checkboxTarget.removeAttribute('checked'); }
|
|
72
85
|
|
|
73
86
|
if (state) {
|
|
74
87
|
this.labelTarget.classList.add('checked');
|
|
@@ -85,25 +98,220 @@ class CheckboxSubmit {
|
|
|
85
98
|
}
|
|
86
99
|
|
|
87
100
|
const BookmarkToggle = (e) => {
|
|
88
|
-
|
|
101
|
+
const elementType = e.target.getAttribute('data-checkboxsubmit-target');
|
|
102
|
+
if (elementType == 'checkbox' || elementType == 'label') {
|
|
89
103
|
const form = e.target.closest('form');
|
|
90
104
|
if (form) new CheckboxSubmit(form).clicked(e);
|
|
105
|
+
if (e.code == 'Space') e.preventDefault();
|
|
91
106
|
}
|
|
92
107
|
};
|
|
93
108
|
|
|
94
109
|
document.addEventListener('click', BookmarkToggle);
|
|
110
|
+
document.addEventListener('keydown', function (e) {
|
|
111
|
+
if (e.key === 'Enter' || e.code == 'Space') { BookmarkToggle(e); } }
|
|
112
|
+
);
|
|
95
113
|
|
|
96
114
|
const ButtonFocus = (e) => {
|
|
97
115
|
// Button clicks should change focus. As of 10/3/19, Firefox for Mac and
|
|
98
116
|
// Safari both do not set focus to a button on button click.
|
|
99
117
|
// See https://zellwk.com/blog/inconsistent-button-behavior/ for background information
|
|
100
|
-
if (e.target.matches('[data-
|
|
118
|
+
if (e.target.matches('[data-bs-toggle="collapse"]')) {
|
|
101
119
|
e.target.focus();
|
|
102
120
|
}
|
|
103
121
|
};
|
|
104
122
|
|
|
105
123
|
document.addEventListener('click', ButtonFocus);
|
|
106
124
|
|
|
125
|
+
const Core = function() {
|
|
126
|
+
const buffer = new Array;
|
|
127
|
+
return {
|
|
128
|
+
onLoad: function(func) {
|
|
129
|
+
buffer.push(func);
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
activate: function() {
|
|
133
|
+
for(let i = 0; i < buffer.length; i++) {
|
|
134
|
+
buffer[i].call();
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
listeners: function () {
|
|
139
|
+
const listeners = [];
|
|
140
|
+
if (typeof Turbo !== 'undefined') {
|
|
141
|
+
listeners.push('turbo:load', 'turbo:frame-load');
|
|
142
|
+
} else {
|
|
143
|
+
listeners.push('DOMContentLoaded');
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return listeners;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
}();
|
|
150
|
+
|
|
151
|
+
// turbo triggers turbo:load events on page transition
|
|
152
|
+
// If app isn't using turbo, this event will never be triggered, no prob.
|
|
153
|
+
Core.listeners().forEach(function(listener) {
|
|
154
|
+
document.addEventListener(listener, function() {
|
|
155
|
+
Core.activate();
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
Core.onLoad(function () {
|
|
160
|
+
const elem = document.querySelector('.no-js');
|
|
161
|
+
|
|
162
|
+
// The "no-js" class may already have been removed because this function is
|
|
163
|
+
// run on every turbo:load event, in that case, it won't find an element.
|
|
164
|
+
if (!elem) return;
|
|
165
|
+
|
|
166
|
+
elem.classList.remove('no-js');
|
|
167
|
+
elem.classList.add('js');
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
/*!
|
|
171
|
+
* Color mode toggler for Blacklight
|
|
172
|
+
* Based on Bootstrap's color mode toggler (https://getbootstrap.com/docs/5.3/customize/color-modes/#javascript)
|
|
173
|
+
*/
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
const ColorThemeSwitcher = (() => {
|
|
177
|
+
|
|
178
|
+
const getStoredTheme = () => localStorage.getItem('theme');
|
|
179
|
+
const setStoredTheme = theme => localStorage.setItem('theme', theme);
|
|
180
|
+
|
|
181
|
+
const getPreferredTheme = () => {
|
|
182
|
+
const storedTheme = getStoredTheme();
|
|
183
|
+
if (storedTheme) {
|
|
184
|
+
return storedTheme
|
|
185
|
+
}
|
|
186
|
+
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
|
|
187
|
+
};
|
|
188
|
+
|
|
189
|
+
const setTheme = theme => {
|
|
190
|
+
if (theme === 'auto') {
|
|
191
|
+
document.documentElement.setAttribute('data-bs-theme', window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
192
|
+
} else {
|
|
193
|
+
document.documentElement.setAttribute('data-bs-theme', theme);
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
const showActiveTheme = (theme, focus = false) => {
|
|
198
|
+
const themeSwitcher = document.querySelector('#bl-theme-switcher');
|
|
199
|
+
if (!themeSwitcher) return
|
|
200
|
+
|
|
201
|
+
// Reset all dropdown items
|
|
202
|
+
document.querySelectorAll('[data-bs-theme-value]').forEach(element => {
|
|
203
|
+
element.classList.remove('active');
|
|
204
|
+
element.setAttribute('aria-pressed', 'false');
|
|
205
|
+
const check = element.querySelector('.bl-theme-check');
|
|
206
|
+
if (check) check.classList.add('d-none');
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
// Activate the selected item
|
|
210
|
+
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`);
|
|
211
|
+
if (btnToActive) {
|
|
212
|
+
btnToActive.classList.add('active');
|
|
213
|
+
btnToActive.setAttribute('aria-pressed', 'true');
|
|
214
|
+
const check = btnToActive.querySelector('.bl-theme-check');
|
|
215
|
+
if (check) check.classList.remove('d-none');
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Swap the toggle button icon
|
|
219
|
+
themeSwitcher.querySelectorAll('.bl-theme-icon').forEach(icon => icon.classList.add('d-none'));
|
|
220
|
+
const activeIcon = themeSwitcher.querySelector(`.bl-theme-icon[data-bl-theme-icon="${theme}"]`);
|
|
221
|
+
if (activeIcon) activeIcon.classList.remove('d-none');
|
|
222
|
+
|
|
223
|
+
themeSwitcher.setAttribute('aria-label', `Toggle theme (${theme})`);
|
|
224
|
+
|
|
225
|
+
if (focus) {
|
|
226
|
+
themeSwitcher.focus();
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
|
|
231
|
+
const storedTheme = getStoredTheme();
|
|
232
|
+
if (storedTheme !== 'light' && storedTheme !== 'dark') {
|
|
233
|
+
setTheme(getPreferredTheme());
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
document.addEventListener('click', e => {
|
|
238
|
+
const btn = e.target.closest('[data-bs-theme-value]');
|
|
239
|
+
if (!btn) return
|
|
240
|
+
|
|
241
|
+
const theme = btn.getAttribute('data-bs-theme-value');
|
|
242
|
+
setStoredTheme(theme);
|
|
243
|
+
setTheme(theme);
|
|
244
|
+
showActiveTheme(theme, true);
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
Core.onLoad(() => showActiveTheme(getPreferredTheme()));
|
|
248
|
+
|
|
249
|
+
return { setTheme, getPreferredTheme, showActiveTheme }
|
|
250
|
+
})();
|
|
251
|
+
|
|
252
|
+
// Usage:
|
|
253
|
+
// ```
|
|
254
|
+
// const basicFunction = (entry) => console.log(entry)
|
|
255
|
+
// const debounced = debounce(basicFunction("I should only be called once"));
|
|
256
|
+
//
|
|
257
|
+
// debounced // does NOT print to the screen because it is invoked again less than 200 milliseconds later
|
|
258
|
+
// debounced // does print to the screen
|
|
259
|
+
// ```
|
|
260
|
+
function debounce(func, timeout = 200) {
|
|
261
|
+
let timer;
|
|
262
|
+
return (...args) => {
|
|
263
|
+
clearTimeout(timer);
|
|
264
|
+
timer = setTimeout(() => { func.apply(this, args); }, timeout);
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const FacetSuggest = async (e) => {
|
|
269
|
+
if (e.target.matches('.facet-suggest')) {
|
|
270
|
+
const queryFragment = e.target.value?.trim();
|
|
271
|
+
const facetField = e.target.dataset.facetField;
|
|
272
|
+
const facetArea = document.querySelector('.facet-extended-list');
|
|
273
|
+
const prevNextLinks = document.querySelectorAll('.prev_next_links');
|
|
274
|
+
|
|
275
|
+
if (!facetField) { return; }
|
|
276
|
+
|
|
277
|
+
// Get the search params from the current query so the facet suggestions
|
|
278
|
+
// can retain that context.
|
|
279
|
+
const facetSearchContext = e.target.dataset.facetSearchContext;
|
|
280
|
+
const url = new URL(facetSearchContext, window.location.origin);
|
|
281
|
+
|
|
282
|
+
// Drop facet.page so a filtered suggestion list will always start on page 1
|
|
283
|
+
url.searchParams.delete('facet.page');
|
|
284
|
+
// add our queryFragment for facet filtering
|
|
285
|
+
url.searchParams.append('query_fragment', queryFragment);
|
|
286
|
+
|
|
287
|
+
const facetSearchParams = url.searchParams.toString();
|
|
288
|
+
const basePathComponent = url.pathname.split('/')[1];
|
|
289
|
+
|
|
290
|
+
const urlToFetch = `/${basePathComponent}/facet_suggest/${facetField}?${facetSearchParams}`;
|
|
291
|
+
|
|
292
|
+
const response = await fetch(urlToFetch);
|
|
293
|
+
if (response.ok) {
|
|
294
|
+
const blob = await response.blob();
|
|
295
|
+
const text = await blob.text();
|
|
296
|
+
|
|
297
|
+
if (text && facetArea) {
|
|
298
|
+
facetArea.innerHTML = text;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// Hide the prev/next links when a user enters text in the facet
|
|
303
|
+
// suggestion input. They don't work with a filtered list.
|
|
304
|
+
prevNextLinks.forEach(element => {
|
|
305
|
+
element.classList.toggle('invisible', !!queryFragment);
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
// Add a class to distinguish suggested facet values vs. regular.
|
|
309
|
+
facetArea.classList.toggle('facet-suggestions', !!queryFragment);
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
document.addEventListener('input', debounce(FacetSuggest));
|
|
314
|
+
|
|
107
315
|
/*
|
|
108
316
|
The blacklight modal plugin can display some interactions inside a Bootstrap
|
|
109
317
|
modal window, including some multi-page interactions.
|
|
@@ -138,7 +346,7 @@ document.addEventListener('click', ButtonFocus);
|
|
|
138
346
|
|
|
139
347
|
<div data-blacklight-modal="container">
|
|
140
348
|
<div class="modal-header">
|
|
141
|
-
<button type="button" class="close" data-bl-dismiss="modal" aria-hidden="true">×</button>
|
|
349
|
+
<button type="button" class="btn-close" data-bl-dismiss="modal" aria-hidden="true">×</button>
|
|
142
350
|
<h3 class="modal-title">Request Placed</h3>
|
|
143
351
|
</div>
|
|
144
352
|
|
|
@@ -187,8 +395,7 @@ const Modal = (() => {
|
|
|
187
395
|
|
|
188
396
|
const contents = `<div class="modal-header">
|
|
189
397
|
<div class="modal-title">There was a problem with your request.</div>
|
|
190
|
-
<button type="button" class="blacklight-modal-close btn-close
|
|
191
|
-
<span aria-hidden="true" class="visually-hidden">×</span>
|
|
398
|
+
<button type="button" class="blacklight-modal-close btn-close" data-bl-dismiss="modal" aria-label="Close">
|
|
192
399
|
</button>
|
|
193
400
|
</div>
|
|
194
401
|
<div class="modal-body">
|
|
@@ -196,7 +403,7 @@ const Modal = (() => {
|
|
|
196
403
|
<pre>${this.url}\n${error}</pre>
|
|
197
404
|
</div>`;
|
|
198
405
|
|
|
199
|
-
|
|
406
|
+
modal.target().querySelector('.modal-content').innerHTML = contents;
|
|
200
407
|
|
|
201
408
|
modal.show();
|
|
202
409
|
};
|
|
@@ -216,9 +423,15 @@ const Modal = (() => {
|
|
|
216
423
|
}
|
|
217
424
|
elements.forEach((el) => frag.appendChild(el));
|
|
218
425
|
modal.activateScripts(frag);
|
|
219
|
-
|
|
220
|
-
document.querySelector(`${modal.modalSelector} .modal-content`).replaceChildren(frag);
|
|
221
426
|
|
|
427
|
+
modal.target().querySelector('.modal-content').replaceChildren(frag);
|
|
428
|
+
|
|
429
|
+
// send custom event with the modal dialog div as the target
|
|
430
|
+
var e = new CustomEvent('loaded.blacklight.blacklight-modal', { bubbles: true, cancelable: true });
|
|
431
|
+
modal.target().dispatchEvent(e);
|
|
432
|
+
|
|
433
|
+
// if they did preventDefault, don't show the dialog
|
|
434
|
+
if (e.defaultPrevented) return;
|
|
222
435
|
modal.show();
|
|
223
436
|
};
|
|
224
437
|
|
|
@@ -234,8 +447,8 @@ const Modal = (() => {
|
|
|
234
447
|
|
|
235
448
|
modal.modalAjaxLinkClick = function(e) {
|
|
236
449
|
e.preventDefault();
|
|
237
|
-
const href = e.target.getAttribute('href');
|
|
238
|
-
fetch(href)
|
|
450
|
+
const href = e.target.closest('a').getAttribute('href');
|
|
451
|
+
fetch(href, { headers: { 'X-Requested-With': 'XMLHttpRequest' }})
|
|
239
452
|
.then(response => {
|
|
240
453
|
if (!response.ok) {
|
|
241
454
|
throw new TypeError("Request failed");
|
|
@@ -247,29 +460,66 @@ const Modal = (() => {
|
|
|
247
460
|
};
|
|
248
461
|
|
|
249
462
|
modal.setupModal = function() {
|
|
250
|
-
// Register
|
|
251
|
-
//
|
|
252
|
-
//
|
|
463
|
+
// Register several click handlers in ONE event handler for efficiency
|
|
464
|
+
//
|
|
465
|
+
// * close button OR click on backdrop (modal.modalSelector) closes modal
|
|
466
|
+
// * trigger and preserve link in modal functionality -- if somethign matches both trigger and
|
|
467
|
+
// preserve, still only called once.
|
|
253
468
|
document.addEventListener('click', (e) => {
|
|
254
469
|
if (e.target.closest(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))
|
|
255
470
|
modal.modalAjaxLinkClick(e);
|
|
256
|
-
else if (e.target.closest('[data-bl-dismiss="modal"]'))
|
|
471
|
+
else if (e.target.matches(`${modal.modalSelector}`) || e.target.closest('[data-bl-dismiss="modal"]'))
|
|
257
472
|
modal.hide();
|
|
258
473
|
});
|
|
474
|
+
|
|
475
|
+
// Make sure user-agent dismissal of html 'dialog', etc `esc` key, triggers
|
|
476
|
+
// our hide logic, including events and scroll restoration.
|
|
477
|
+
const modalDom = modal.target();
|
|
478
|
+
if (modalDom) {
|
|
479
|
+
modal.target().addEventListener('cancel', (e) => {
|
|
480
|
+
e.preventDefault(); // 'hide' will close the modal unless cancelled
|
|
481
|
+
|
|
482
|
+
modal.hide();
|
|
483
|
+
});
|
|
484
|
+
}
|
|
259
485
|
};
|
|
260
486
|
|
|
261
487
|
modal.hide = function (el) {
|
|
262
|
-
const dom =
|
|
488
|
+
const dom = modal.target();
|
|
263
489
|
|
|
264
490
|
if (!dom.open) return
|
|
491
|
+
|
|
492
|
+
var e = new CustomEvent('hide.blacklight.blacklight-modal', { bubbles: true, cancelable: true });
|
|
493
|
+
dom.dispatchEvent(e);
|
|
494
|
+
|
|
265
495
|
dom.close();
|
|
496
|
+
|
|
497
|
+
// Turn body scrolling back to what it was
|
|
498
|
+
document.body.style["overflow"] = modal.originalBodyOverflow;
|
|
499
|
+
document.body.style["padding-right"] = modal.originalBodyPaddingRight;
|
|
500
|
+
modal.originalBodyOverflow = undefined;
|
|
501
|
+
modal.originalBodyPaddingRight = undefined;
|
|
266
502
|
};
|
|
267
503
|
|
|
268
504
|
modal.show = function(el) {
|
|
269
|
-
const dom =
|
|
505
|
+
const dom = modal.target();
|
|
270
506
|
|
|
271
507
|
if (dom.open) return
|
|
508
|
+
|
|
509
|
+
var e = new CustomEvent('show.blacklight.blacklight-modal', { bubbles: true, cancelable: true });
|
|
510
|
+
dom.dispatchEvent(e);
|
|
511
|
+
|
|
272
512
|
dom.showModal();
|
|
513
|
+
|
|
514
|
+
// Turn off body scrolling
|
|
515
|
+
modal.originalBodyOverflow = document.body.style['overflow'];
|
|
516
|
+
modal.originalBodyPaddingRight = document.body.style['padding-right'];
|
|
517
|
+
document.body.style["overflow"] = "hidden";
|
|
518
|
+
document.body.style["padding-right"] = "0px";
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
modal.target = function() {
|
|
522
|
+
return document.querySelector(modal.modalSelector);
|
|
273
523
|
};
|
|
274
524
|
|
|
275
525
|
modal.setupModal();
|
|
@@ -278,8 +528,9 @@ const Modal = (() => {
|
|
|
278
528
|
})();
|
|
279
529
|
|
|
280
530
|
const SearchContext = (e) => {
|
|
281
|
-
|
|
282
|
-
|
|
531
|
+
const contextLink = e.target.closest('[data-context-href]');
|
|
532
|
+
if (contextLink) {
|
|
533
|
+
SearchContext.handleSearchContextMethod.call(contextLink, e);
|
|
283
534
|
}
|
|
284
535
|
};
|
|
285
536
|
|
|
@@ -330,66 +581,15 @@ SearchContext.handleSearchContextMethod = function(event) {
|
|
|
330
581
|
|
|
331
582
|
document.addEventListener('click', SearchContext);
|
|
332
583
|
|
|
333
|
-
const Blacklight = function() {
|
|
334
|
-
const buffer = new Array;
|
|
335
|
-
return {
|
|
336
|
-
onLoad: function(func) {
|
|
337
|
-
buffer.push(func);
|
|
338
|
-
},
|
|
339
|
-
|
|
340
|
-
activate: function() {
|
|
341
|
-
for(let i = 0; i < buffer.length; i++) {
|
|
342
|
-
buffer[i].call();
|
|
343
|
-
}
|
|
344
|
-
},
|
|
345
|
-
|
|
346
|
-
listeners: function () {
|
|
347
|
-
const listeners = [];
|
|
348
|
-
if (typeof Turbo !== 'undefined') {
|
|
349
|
-
listeners.push('turbo:load', 'turbo:frame-load');
|
|
350
|
-
} else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {
|
|
351
|
-
// Turbolinks 5
|
|
352
|
-
if (Turbolinks.BrowserAdapter) {
|
|
353
|
-
listeners.push('turbolinks:load');
|
|
354
|
-
} else {
|
|
355
|
-
// Turbolinks < 5
|
|
356
|
-
listeners.push('page:load', 'DOMContentLoaded');
|
|
357
|
-
}
|
|
358
|
-
} else {
|
|
359
|
-
listeners.push('DOMContentLoaded');
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
return listeners;
|
|
363
|
-
}
|
|
364
|
-
};
|
|
365
|
-
}();
|
|
366
|
-
|
|
367
|
-
// turbolinks triggers page:load events on page transition
|
|
368
|
-
// If app isn't using turbolinks, this event will never be triggered, no prob.
|
|
369
|
-
Blacklight.listeners().forEach(function(listener) {
|
|
370
|
-
document.addEventListener(listener, function() {
|
|
371
|
-
Blacklight.activate();
|
|
372
|
-
});
|
|
373
|
-
});
|
|
374
|
-
|
|
375
|
-
Blacklight.onLoad(function () {
|
|
376
|
-
const elem = document.querySelector('.no-js');
|
|
377
|
-
|
|
378
|
-
// The "no-js" class may already have been removed because this function is
|
|
379
|
-
// run on every turbo:load event, in that case, it won't find an element.
|
|
380
|
-
if (!elem) return;
|
|
381
|
-
|
|
382
|
-
elem.classList.remove('no-js');
|
|
383
|
-
elem.classList.add('js');
|
|
384
|
-
});
|
|
385
|
-
|
|
386
584
|
const index = {
|
|
387
585
|
BookmarkToggle,
|
|
388
586
|
ButtonFocus,
|
|
587
|
+
ColorThemeSwitcher,
|
|
588
|
+
FacetSuggest,
|
|
389
589
|
Modal,
|
|
390
590
|
SearchContext,
|
|
391
|
-
Core
|
|
392
|
-
onLoad:
|
|
591
|
+
Core,
|
|
592
|
+
onLoad: Core.onLoad
|
|
393
593
|
};
|
|
394
594
|
|
|
395
595
|
export { index as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blacklight.esm.js","sources":["../../../javascript/blacklight/checkbox_submit.js","../../../javascript/blacklight/bookmark_toggle.js","../../../javascript/blacklight/button_focus.js","../../../javascript/blacklight/modal.js","../../../javascript/blacklight/search_context.js","../../../javascript/blacklight/core.js","../../../javascript/blacklight/index.js"],"sourcesContent":["/* Converts a \"toggle\" form, with single submit button to add/remove\n something, like used for Bookmarks, into an AJAXy checkbox instead.\n Apply to a form. Does require certain assumption about the form:\n 1) The same form 'action' href must be used for both ADD and REMOVE\n actions, with the different being the hidden input name=\"_method\"\n being set to \"put\" or \"delete\" -- that's the Rails method to pretend\n to be doing a certain HTTP verb. So same URL, PUT to add, DELETE\n to remove. This plugin assumes that.\n Plus, the form this is applied to should provide a data-doc-id\n attribute (HTML5-style doc-*) that contains the id/primary key\n of the object in question -- used by plugin for a unique value for\n DOM id's.\n Uses HTML for a checkbox compatible with Bootstrap 4.\n new CheckboxSubmit(document.querySelector('form.something')).render()\n*/\nexport default class CheckboxSubmit {\n constructor(form) {\n this.form = form\n }\n\n clicked(evt) {\n this.spanTarget.innerHTML = this.form.getAttribute('data-inprogress')\n this.labelTarget.setAttribute('disabled', 'disabled');\n this.checkboxTarget.setAttribute('disabled', 'disabled');\n fetch(this.formTarget.getAttribute('action'), {\n body: new FormData(this.formTarget),\n method: this.formTarget.getAttribute('method').toUpperCase(),\n headers: {\n 'Accept': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': document.querySelector('meta[name=csrf-token]')?.content\n }\n }).then((response) => {\n if (response.ok) return response.json();\n return Promise.reject('response was not ok')\n }).then((json) => {\n this.labelTarget.removeAttribute('disabled')\n this.checkboxTarget.removeAttribute('disabled')\n this.updateStateFor(!this.checked)\n document.querySelector('[data-role=bookmark-counter]').innerHTML = json.bookmarks.count\n }).catch((error) => {\n this.handleError(error)\n })\n }\n\n get checked() {\n return (this.form.querySelectorAll('input[name=_method][value=delete]').length != 0)\n }\n\n get formTarget() {\n return this.form\n }\n\n get labelTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"label\"]')\n }\n\n get checkboxTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"checkbox\"]')\n }\n\n get spanTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"span\"]')\n }\n\n handleError() {\n alert(\"Unable to save the bookmark at this time.\")\n }\n\n updateStateFor(state) {\n this.checkboxTarget.checked = state\n\n if (state) {\n this.labelTarget.classList.add('checked')\n //Set the Rails hidden field that fakes an HTTP verb\n //properly for current state action.\n this.formTarget.querySelector('input[name=_method]').value = 'delete'\n this.spanTarget.innerHTML = this.form.getAttribute('data-present')\n } else {\n this.labelTarget.classList.remove('checked')\n this.formTarget.querySelector('input[name=_method]').value = 'put'\n this.spanTarget.innerHTML = this.form.getAttribute('data-absent')\n }\n }\n}\n","import CheckboxSubmit from 'blacklight/checkbox_submit'\n\nconst BookmarkToggle = (e) => {\n if (e.target.matches('[data-checkboxsubmit-target=\"checkbox\"]')) {\n const form = e.target.closest('form')\n if (form) new CheckboxSubmit(form).clicked(e);\n }\n};\n\ndocument.addEventListener('click', BookmarkToggle);\n\nexport default BookmarkToggle\n","const ButtonFocus = (e) => {\n // Button clicks should change focus. As of 10/3/19, Firefox for Mac and\n // Safari both do not set focus to a button on button click.\n // See https://zellwk.com/blog/inconsistent-button-behavior/ for background information\n if (e.target.matches('[data-toggle=\"collapse\"]') || e.target.matches('[data-bs-toggle=\"collapse\"]')) {\n e.target.focus()\n }\n}\n\ndocument.addEventListener('click', ButtonFocus)\n\nexport default ButtonFocus\n","/*\n The blacklight modal plugin can display some interactions inside a Bootstrap\n modal window, including some multi-page interactions.\n\n It supports unobtrusive Javascript, where a link or form that would have caused\n a new page load is changed to display it's results inside a modal dialog,\n by this plugin. The plugin assumes there is a Bootstrap modal div\n on the page with id #blacklight-modal to use as the modal -- the standard Blacklight\n layout provides this.\n\n To make a link or form have their results display inside a modal, add\n `data-blacklight-modal=\"trigger\"` to the link or form. (Note, form itself not submit input)\n With Rails link_to helper, you'd do that like:\n\n link_to something, link, data: { blacklight_modal: \"trigger\" }\n\n The results of the link href or form submit will be displayed inside\n a modal -- they should include the proper HTML markup for a bootstrap modal's\n contents. Also, you ordinarily won't want the Rails template with wrapping\n navigational elements to be used. The Rails controller could suppress\n the layout when a JS AJAX request is detected, OR the response\n can include a `<div data-blacklight-modal=\"container\">` -- only the contents\n of the container will be placed inside the modal, the rest of the\n page will be ignored.\n\n Link or forms inside the modal will ordinarily cause page loads\n when they are triggered. However, if you'd like their results\n to stay within the modal, just add `data-blacklight-modal=\"preserve\"`\n to the link or form.\n\n Here's an example of what might be returned, demonstrating most of the devices available:\n\n <div data-blacklight-modal=\"container\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-bl-dismiss=\"modal\" aria-hidden=\"true\">×</button>\n <h3 class=\"modal-title\">Request Placed</h3>\n </div>\n\n <div class=\"modal-body\">\n <p>Some message</p>\n <%= link_to \"This result will still be within modal\", some_link, data: { blacklight_modal: \"preserve\" } %>\n </div>\n\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-bl-dismiss=\"modal\">Close</button>\n </div>\n </div>\n\n\n One additional feature. If the content returned from the AJAX form submission\n can be a turbo-stream that defines some HTML fragementsand where on the page to put them:\n https://turbo.hotwired.dev/handbook/streams\n*/\nimport ModalForm from 'blacklight/modalForm'\n\nconst Modal = (() => {\n const modal = {}\n\n // a Bootstrap modal div that should be already on the page hidden\n modal.modalSelector = '#blacklight-modal';\n\n // Trigger selectors identify forms or hyperlinks that should open\n // inside a modal dialog.\n modal.triggerLinkSelector = 'a[data-blacklight-modal~=trigger]';\n\n // preserve selectors identify forms or hyperlinks that, if activated already\n // inside a modal dialog, should have destinations remain inside the modal -- but\n // won't trigger a modal if not already in one.\n //\n // No need to repeat selectors from trigger selectors, those will already\n // be preserved. MUST be manually prefixed with the modal selector,\n // so they only apply to things inside a modal.\n modal.preserveLinkSelector = modal.modalSelector + ' a[data-blacklight-modal~=preserve]';\n\n modal.containerSelector = '[data-blacklight-modal~=container]';\n\n // Called on fatal failure of ajax load, function returns content\n // to show to user in modal. Right now called only for network errors.\n modal.onFailure = function (error) {\n console.error('Server error:', this.url, error);\n\n const contents = `<div class=\"modal-header\">\n <div class=\"modal-title\">There was a problem with your request.</div>\n <button type=\"button\" class=\"blacklight-modal-close btn-close close\" data-bl-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p>Expected a successful response from the server, but got an error</p>\n <pre>${this.url}\\n${error}</pre>\n </div>`\n\n document.querySelector(`${modal.modalSelector} .modal-content`).innerHTML = contents\n\n modal.show();\n }\n\n // Add the passed in contents to the modal and display it.\n // We have specific handling so that scripts returned from the ajax call are executed.\n // This enables adding a script like recaptcha to prevent bots from sending emails.\n modal.receiveAjax = function (contents) {\n const domparser = new DOMParser();\n const dom = domparser.parseFromString(contents, \"text/html\")\n // If there is a containerSelector on the document, use its children.\n let elements = dom.querySelectorAll(`${modal.containerSelector} > *`)\n const frag = document.createDocumentFragment()\n if (elements.length == 0) {\n // If the containerSelector wasn't found, use the whole document\n elements = dom.body.childNodes\n }\n elements.forEach((el) => frag.appendChild(el))\n modal.activateScripts(frag)\n \n document.querySelector(`${modal.modalSelector} .modal-content`).replaceChildren(frag)\n\n modal.show();\n };\n\n // DOMParser doesn't allow scripts to be executed. This fixes that.\n modal.activateScripts = function (frag) {\n frag.querySelectorAll('script').forEach((script) => {\n const fixedScript = document.createElement('script')\n fixedScript.src = script.src\n fixedScript.async = false\n script.parentNode.replaceChild(fixedScript, script)\n })\n }\n\n modal.modalAjaxLinkClick = function(e) {\n e.preventDefault();\n const href = e.target.getAttribute('href')\n fetch(href)\n .then(response => {\n if (!response.ok) {\n throw new TypeError(\"Request failed\");\n }\n return response.text();\n })\n .then(data => modal.receiveAjax(data))\n .catch(error => modal.onFailure(error))\n };\n\n modal.setupModal = function() {\n // Register both trigger and preserve selectors in ONE event handler, combining\n // into one selector with a comma, so if something matches BOTH selectors, it\n // still only gets the event handler called once.\n document.addEventListener('click', (e) => {\n if (e.target.closest(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))\n modal.modalAjaxLinkClick(e)\n else if (e.target.closest('[data-bl-dismiss=\"modal\"]'))\n modal.hide()\n })\n };\n\n modal.hide = function (el) {\n const dom = document.querySelector(modal.modalSelector)\n\n if (!dom.open) return\n dom.close()\n }\n\n modal.show = function(el) {\n const dom = document.querySelector(modal.modalSelector)\n\n if (dom.open) return\n dom.showModal()\n }\n\n modal.setupModal()\n\n return modal;\n})()\n\nexport default Modal\n","const SearchContext = (e) => {\n if (e.target.matches('[data-context-href]')) {\n SearchContext.handleSearchContextMethod.call(e.target, e)\n }\n}\n\nSearchContext.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content\nSearchContext.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content\n\n// this is the Rails.handleMethod with a couple adjustments, described inline:\n// first, we're attaching this directly to the event handler, so we can check for meta-keys\nSearchContext.handleSearchContextMethod = function(event) {\n const link = this\n\n // instead of using the normal href, we need to use the context href instead\n let href = link.getAttribute('data-context-href')\n let target = link.getAttribute('target')\n let csrfToken = SearchContext.csrfToken()\n let csrfParam = SearchContext.csrfParam()\n let form = document.createElement('form')\n form.method = 'post'\n form.action = href\n\n\n let formContent = `<input name=\"_method\" value=\"post\" type=\"hidden\" />\n <input name=\"redirect\" value=\"${link.getAttribute('href')}\" type=\"hidden\" />`\n\n // check for meta keys.. if set, we should open in a new tab\n if(event.metaKey || event.ctrlKey) {\n form.dataset.turbo = \"false\";\n target = '_blank';\n }\n\n if (csrfParam !== undefined && csrfToken !== undefined) {\n formContent += `<input name=\"${csrfParam}\" value=\"${csrfToken}\" type=\"hidden\" />`\n }\n\n // Must trigger submit by click on a button, else \"submit\" event handler won't work!\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n formContent += '<input type=\"submit\" />'\n\n if (target) { form.setAttribute('target', target); }\n\n form.style.display = 'none'\n form.innerHTML = formContent\n document.body.appendChild(form)\n form.querySelector('[type=\"submit\"]').click()\n\n event.preventDefault()\n};\n\ndocument.addEventListener('click', SearchContext)\n\nexport default SearchContext\n","const Blacklight = function() {\n const buffer = new Array;\n return {\n onLoad: function(func) {\n buffer.push(func);\n },\n\n activate: function() {\n for(let i = 0; i < buffer.length; i++) {\n buffer[i].call();\n }\n },\n\n listeners: function () {\n const listeners = [];\n if (typeof Turbo !== 'undefined') {\n listeners.push('turbo:load', 'turbo:frame-load');\n } else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {\n // Turbolinks 5\n if (Turbolinks.BrowserAdapter) {\n listeners.push('turbolinks:load');\n } else {\n // Turbolinks < 5\n listeners.push('page:load', 'DOMContentLoaded');\n }\n } else {\n listeners.push('DOMContentLoaded');\n }\n\n return listeners;\n }\n };\n}();\n\n// turbolinks triggers page:load events on page transition\n// If app isn't using turbolinks, this event will never be triggered, no prob.\nBlacklight.listeners().forEach(function(listener) {\n document.addEventListener(listener, function() {\n Blacklight.activate()\n })\n})\n\nBlacklight.onLoad(function () {\n const elem = document.querySelector('.no-js');\n\n // The \"no-js\" class may already have been removed because this function is\n // run on every turbo:load event, in that case, it won't find an element.\n if (!elem) return;\n\n elem.classList.remove('no-js')\n elem.classList.add('js')\n})\n\n\nexport default Blacklight\n","import BookmarkToggle from 'blacklight/bookmark_toggle'\nimport ButtonFocus from 'blacklight/button_focus'\nimport Modal from 'blacklight/modal'\nimport SearchContext from 'blacklight/search_context'\nimport Core from 'blacklight/core'\n\nexport default {\n BookmarkToggle,\n ButtonFocus,\n Modal,\n SearchContext,\n Core,\n onLoad: Core.onLoad\n}\n"],"names":["Core"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,MAAM,cAAc,CAAC;AACpC,EAAE,WAAW,CAAC,IAAI,EAAE;AACpB,IAAI,IAAI,CAAC,IAAI,GAAG,KAAI;AACpB,GAAG;AACH;AACA,EAAE,OAAO,CAAC,GAAG,EAAE;AACf,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAC;AACzE,IAAI,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAC1D,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAC7D,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ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AAC,CAAC;AAC5C,SAAS,MAAM;AACf;AACA,UAAU,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC;AAC1D,SAAS;AACT,OAAO,MAAM;AACb,QAAQ,SAAS,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;AAC3C,OAAO;AACP;AACA,MAAM,OAAO,SAAS,CAAC;AACvB,KAAK;AACL,GAAG,CAAC;AACJ,CAAC,EAAE,CAAC;AACJ;AACA;AACA;AACA,UAAU,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,SAAS,QAAQ,EAAE;AAClD,EAAE,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,WAAW;AACjD,IAAI,UAAU,CAAC,QAAQ,GAAE;AACzB,GAAG,EAAC;AACJ,CAAC,EAAC;AACF;AACA,UAAU,CAAC,MAAM,CAAC,YAAY;AAC9B,EAAE,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AAChD;AACA;AACA;AACA,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO;AACpB;AACA,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,EAAC;AAChC,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAC;AAC1B,CAAC;;AC7CD,cAAe;AACf,EAAE,cAAc;AAChB,EAAE,WAAW;AACb,EAAE,KAAK;AACP,EAAE,aAAa;AACf,QAAEA,UAAI;AACN,EAAE,MAAM,EAAEA,UAAI,CAAC,MAAM;AACrB;;;;"}
|
|
1
|
+
{"version":3,"file":"blacklight.esm.js","sources":["../../../javascript/blacklight-frontend/checkbox_submit.js","../../../javascript/blacklight-frontend/bookmark_toggle.js","../../../javascript/blacklight-frontend/button_focus.js","../../../javascript/blacklight-frontend/core.js","../../../javascript/blacklight-frontend/color_theme_switcher.js","../../../javascript/blacklight-frontend/debounce.js","../../../javascript/blacklight-frontend/facet_suggest.js","../../../javascript/blacklight-frontend/modal.js","../../../javascript/blacklight-frontend/search_context.js","../../../javascript/blacklight-frontend/index.js"],"sourcesContent":["/* Converts a \"toggle\" form, with single submit button to add/remove\n something, like used for Bookmarks, into an AJAXy checkbox instead.\n Apply to a form. Does require certain assumption about the form:\n 1) The same form 'action' href must be used for both ADD and REMOVE\n actions, with the different being the hidden input name=\"_method\"\n being set to \"put\" or \"delete\" -- that's the Rails method to pretend\n to be doing a certain HTTP verb. So same URL, PUT to add, DELETE\n to remove. This plugin assumes that.\n Plus, the form this is applied to should provide a data-doc-id\n attribute (HTML5-style doc-*) that contains the id/primary key\n of the object in question -- used by plugin for a unique value for\n DOM id's.\n Uses HTML for a checkbox compatible with Bootstrap.\n new CheckboxSubmit(document.querySelector('form.something')).render()\n*/\nexport default class CheckboxSubmit {\n constructor(form) {\n this.form = form\n }\n\n clicked(evt) {\n this.spanTarget.innerHTML = this.form.getAttribute('data-inprogress')\n this.labelTarget.setAttribute('disabled', 'disabled');\n this.checkboxTarget.setAttribute('disabled', 'disabled');\n fetch(this.formTarget.getAttribute('action'), {\n body: new FormData(this.formTarget),\n method: this.formTarget.getAttribute('method').toUpperCase(),\n headers: {\n 'Accept': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': document.querySelector('meta[name=csrf-token]')?.content\n }\n }).then((response) => {\n if (response.ok) return response.json();\n return Promise.reject('response was not ok')\n }).then((json) => {\n this.labelTarget.removeAttribute('disabled')\n this.checkboxTarget.removeAttribute('disabled')\n // For accessibility return keyboard focus\n // back to the checkbox after form submission\n this.checkboxTarget.focus()\n this.updateStateFor(!this.checked)\n this.bookmarksCounter().forEach(counter => {\n counter.innerHTML = json.bookmarks.count;\n });\n\n var e = new CustomEvent('bookmark.blacklight', { detail: { checked: this.checked }, bubbles: true });\n this.formTarget.dispatchEvent(e)\n }).catch((error) => {\n this.handleError(error)\n })\n }\n\n get checked() {\n return (this.form.querySelectorAll('input[name=_method][value=delete]').length != 0)\n }\n\n get formTarget() {\n return this.form\n }\n\n get labelTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"label\"]')\n }\n\n get checkboxTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"checkbox\"]')\n }\n\n get spanTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"span\"]')\n }\n\n bookmarksCounter() {\n return document.querySelectorAll('[data-role=\"bookmark-counter\"]')\n }\n\n handleError() {\n alert(\"Unable to save the bookmark at this time.\")\n }\n\n updateStateFor(state) {\n if (state) { this.checkboxTarget.setAttribute('checked', state) }\n else { this.checkboxTarget.removeAttribute('checked') }\n\n if (state) {\n this.labelTarget.classList.add('checked')\n //Set the Rails hidden field that fakes an HTTP verb\n //properly for current state action.\n this.formTarget.querySelector('input[name=_method]').value = 'delete'\n this.spanTarget.innerHTML = this.form.getAttribute('data-present')\n } else {\n this.labelTarget.classList.remove('checked')\n this.formTarget.querySelector('input[name=_method]').value = 'put'\n this.spanTarget.innerHTML = this.form.getAttribute('data-absent')\n }\n }\n}\n","import CheckboxSubmit from 'blacklight-frontend/checkbox_submit'\n\nconst BookmarkToggle = (e) => {\n const elementType = e.target.getAttribute('data-checkboxsubmit-target');\n if (elementType == 'checkbox' || elementType == 'label') {\n const form = e.target.closest('form');\n if (form) new CheckboxSubmit(form).clicked(e);\n if (e.code == 'Space') e.preventDefault();\n }\n};\n\ndocument.addEventListener('click', BookmarkToggle);\ndocument.addEventListener('keydown', function (e) {\n if (e.key === 'Enter' || e.code == 'Space') { BookmarkToggle(e); } }\n);\n\nexport default BookmarkToggle\n","const ButtonFocus = (e) => {\n // Button clicks should change focus. As of 10/3/19, Firefox for Mac and\n // Safari both do not set focus to a button on button click.\n // See https://zellwk.com/blog/inconsistent-button-behavior/ for background information\n if (e.target.matches('[data-bs-toggle=\"collapse\"]')) {\n e.target.focus()\n }\n}\n\ndocument.addEventListener('click', ButtonFocus)\n\nexport default ButtonFocus\n","const Core = function() {\n const buffer = new Array;\n return {\n onLoad: function(func) {\n buffer.push(func);\n },\n\n activate: function() {\n for(let i = 0; i < buffer.length; i++) {\n buffer[i].call();\n }\n },\n\n listeners: function () {\n const listeners = [];\n if (typeof Turbo !== 'undefined') {\n listeners.push('turbo:load', 'turbo:frame-load');\n } else {\n listeners.push('DOMContentLoaded');\n }\n\n return listeners;\n }\n };\n}();\n\n// turbo triggers turbo:load events on page transition\n// If app isn't using turbo, this event will never be triggered, no prob.\nCore.listeners().forEach(function(listener) {\n document.addEventListener(listener, function() {\n Core.activate()\n })\n})\n\nCore.onLoad(function () {\n const elem = document.querySelector('.no-js');\n\n // The \"no-js\" class may already have been removed because this function is\n // run on every turbo:load event, in that case, it won't find an element.\n if (!elem) return;\n\n elem.classList.remove('no-js')\n elem.classList.add('js')\n})\n\n\nexport default Core\n","/*!\n * Color mode toggler for Blacklight\n * Based on Bootstrap's color mode toggler (https://getbootstrap.com/docs/5.3/customize/color-modes/#javascript)\n */\n\nimport Core from 'blacklight-frontend/core'\n\nconst ColorThemeSwitcher = (() => {\n 'use strict'\n\n const getStoredTheme = () => localStorage.getItem('theme')\n const setStoredTheme = theme => localStorage.setItem('theme', theme)\n\n const getPreferredTheme = () => {\n const storedTheme = getStoredTheme()\n if (storedTheme) {\n return storedTheme\n }\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n }\n\n const setTheme = theme => {\n if (theme === 'auto') {\n document.documentElement.setAttribute('data-bs-theme', window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')\n } else {\n document.documentElement.setAttribute('data-bs-theme', theme)\n }\n }\n\n const showActiveTheme = (theme, focus = false) => {\n const themeSwitcher = document.querySelector('#bl-theme-switcher')\n if (!themeSwitcher) return\n\n // Reset all dropdown items\n document.querySelectorAll('[data-bs-theme-value]').forEach(element => {\n element.classList.remove('active')\n element.setAttribute('aria-pressed', 'false')\n const check = element.querySelector('.bl-theme-check')\n if (check) check.classList.add('d-none')\n })\n\n // Activate the selected item\n const btnToActive = document.querySelector(`[data-bs-theme-value=\"${theme}\"]`)\n if (btnToActive) {\n btnToActive.classList.add('active')\n btnToActive.setAttribute('aria-pressed', 'true')\n const check = btnToActive.querySelector('.bl-theme-check')\n if (check) check.classList.remove('d-none')\n }\n\n // Swap the toggle button icon\n themeSwitcher.querySelectorAll('.bl-theme-icon').forEach(icon => icon.classList.add('d-none'))\n const activeIcon = themeSwitcher.querySelector(`.bl-theme-icon[data-bl-theme-icon=\"${theme}\"]`)\n if (activeIcon) activeIcon.classList.remove('d-none')\n\n themeSwitcher.setAttribute('aria-label', `Toggle theme (${theme})`)\n\n if (focus) {\n themeSwitcher.focus()\n }\n }\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {\n const storedTheme = getStoredTheme()\n if (storedTheme !== 'light' && storedTheme !== 'dark') {\n setTheme(getPreferredTheme())\n }\n })\n\n document.addEventListener('click', e => {\n const btn = e.target.closest('[data-bs-theme-value]')\n if (!btn) return\n\n const theme = btn.getAttribute('data-bs-theme-value')\n setStoredTheme(theme)\n setTheme(theme)\n showActiveTheme(theme, true)\n })\n\n Core.onLoad(() => showActiveTheme(getPreferredTheme()))\n\n return { setTheme, getPreferredTheme, showActiveTheme }\n})()\n\nexport default ColorThemeSwitcher\n","// Usage:\n// ```\n// const basicFunction = (entry) => console.log(entry)\n// const debounced = debounce(basicFunction(\"I should only be called once\"));\n//\n// debounced // does NOT print to the screen because it is invoked again less than 200 milliseconds later\n// debounced // does print to the screen\n// ```\nexport default function debounce(func, timeout = 200) {\n let timer;\n return (...args) => {\n clearTimeout(timer);\n timer = setTimeout(() => { func.apply(this, args); }, timeout);\n };\n}\n","import debounce from \"blacklight-frontend/debounce\";\n\nconst FacetSuggest = async (e) => {\n if (e.target.matches('.facet-suggest')) {\n const queryFragment = e.target.value?.trim();\n const facetField = e.target.dataset.facetField;\n const facetArea = document.querySelector('.facet-extended-list');\n const prevNextLinks = document.querySelectorAll('.prev_next_links');\n\n if (!facetField) { return; }\n\n // Get the search params from the current query so the facet suggestions\n // can retain that context.\n const facetSearchContext = e.target.dataset.facetSearchContext;\n const url = new URL(facetSearchContext, window.location.origin);\n\n // Drop facet.page so a filtered suggestion list will always start on page 1\n url.searchParams.delete('facet.page');\n // add our queryFragment for facet filtering\n url.searchParams.append('query_fragment', queryFragment);\n\n const facetSearchParams = url.searchParams.toString();\n const basePathComponent = url.pathname.split('/')[1];\n\n const urlToFetch = `/${basePathComponent}/facet_suggest/${facetField}?${facetSearchParams}`;\n\n const response = await fetch(urlToFetch);\n if (response.ok) {\n const blob = await response.blob()\n const text = await blob.text()\n\n if (text && facetArea) {\n facetArea.innerHTML = text\n }\n }\n\n // Hide the prev/next links when a user enters text in the facet\n // suggestion input. They don't work with a filtered list.\n prevNextLinks.forEach(element => {\n element.classList.toggle('invisible', !!queryFragment);\n });\n\n // Add a class to distinguish suggested facet values vs. regular.\n facetArea.classList.toggle('facet-suggestions', !!queryFragment);\n }\n};\n\ndocument.addEventListener('input', debounce(FacetSuggest));\n\nexport default FacetSuggest\n","/*\n The blacklight modal plugin can display some interactions inside a Bootstrap\n modal window, including some multi-page interactions.\n\n It supports unobtrusive Javascript, where a link or form that would have caused\n a new page load is changed to display it's results inside a modal dialog,\n by this plugin. The plugin assumes there is a Bootstrap modal div\n on the page with id #blacklight-modal to use as the modal -- the standard Blacklight\n layout provides this.\n\n To make a link or form have their results display inside a modal, add\n `data-blacklight-modal=\"trigger\"` to the link or form. (Note, form itself not submit input)\n With Rails link_to helper, you'd do that like:\n\n link_to something, link, data: { blacklight_modal: \"trigger\" }\n\n The results of the link href or form submit will be displayed inside\n a modal -- they should include the proper HTML markup for a bootstrap modal's\n contents. Also, you ordinarily won't want the Rails template with wrapping\n navigational elements to be used. The Rails controller could suppress\n the layout when a JS AJAX request is detected, OR the response\n can include a `<div data-blacklight-modal=\"container\">` -- only the contents\n of the container will be placed inside the modal, the rest of the\n page will be ignored.\n\n Link or forms inside the modal will ordinarily cause page loads\n when they are triggered. However, if you'd like their results\n to stay within the modal, just add `data-blacklight-modal=\"preserve\"`\n to the link or form.\n\n Here's an example of what might be returned, demonstrating most of the devices available:\n\n <div data-blacklight-modal=\"container\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"btn-close\" data-bl-dismiss=\"modal\" aria-hidden=\"true\">×</button>\n <h3 class=\"modal-title\">Request Placed</h3>\n </div>\n\n <div class=\"modal-body\">\n <p>Some message</p>\n <%= link_to \"This result will still be within modal\", some_link, data: { blacklight_modal: \"preserve\" } %>\n </div>\n\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-bl-dismiss=\"modal\">Close</button>\n </div>\n </div>\n\n\n One additional feature. If the content returned from the AJAX form submission\n can be a turbo-stream that defines some HTML fragementsand where on the page to put them:\n https://turbo.hotwired.dev/handbook/streams\n*/\n\nconst Modal = (() => {\n const modal = {}\n\n // a Bootstrap modal div that should be already on the page hidden\n modal.modalSelector = '#blacklight-modal';\n\n // Trigger selectors identify forms or hyperlinks that should open\n // inside a modal dialog.\n modal.triggerLinkSelector = 'a[data-blacklight-modal~=trigger]';\n\n // preserve selectors identify forms or hyperlinks that, if activated already\n // inside a modal dialog, should have destinations remain inside the modal -- but\n // won't trigger a modal if not already in one.\n //\n // No need to repeat selectors from trigger selectors, those will already\n // be preserved. MUST be manually prefixed with the modal selector,\n // so they only apply to things inside a modal.\n modal.preserveLinkSelector = modal.modalSelector + ' a[data-blacklight-modal~=preserve]';\n\n modal.containerSelector = '[data-blacklight-modal~=container]';\n\n // Called on fatal failure of ajax load, function returns content\n // to show to user in modal. Right now called only for network errors.\n modal.onFailure = function (error) {\n console.error('Server error:', this.url, error);\n\n const contents = `<div class=\"modal-header\">\n <div class=\"modal-title\">There was a problem with your request.</div>\n <button type=\"button\" class=\"blacklight-modal-close btn-close\" data-bl-dismiss=\"modal\" aria-label=\"Close\">\n </button>\n </div>\n <div class=\"modal-body\">\n <p>Expected a successful response from the server, but got an error</p>\n <pre>${this.url}\\n${error}</pre>\n </div>`\n\n modal.target().querySelector('.modal-content').innerHTML = contents\n\n modal.show();\n }\n\n // Add the passed in contents to the modal and display it.\n // We have specific handling so that scripts returned from the ajax call are executed.\n // This enables adding a script like recaptcha to prevent bots from sending emails.\n modal.receiveAjax = function (contents) {\n const domparser = new DOMParser();\n const dom = domparser.parseFromString(contents, \"text/html\")\n // If there is a containerSelector on the document, use its children.\n let elements = dom.querySelectorAll(`${modal.containerSelector} > *`)\n const frag = document.createDocumentFragment()\n if (elements.length == 0) {\n // If the containerSelector wasn't found, use the whole document\n elements = dom.body.childNodes\n }\n elements.forEach((el) => frag.appendChild(el))\n modal.activateScripts(frag)\n\n modal.target().querySelector('.modal-content').replaceChildren(frag)\n\n // send custom event with the modal dialog div as the target\n var e = new CustomEvent('loaded.blacklight.blacklight-modal', { bubbles: true, cancelable: true });\n modal.target().dispatchEvent(e)\n\n // if they did preventDefault, don't show the dialog\n if (e.defaultPrevented) return;\n modal.show();\n };\n\n // DOMParser doesn't allow scripts to be executed. This fixes that.\n modal.activateScripts = function (frag) {\n frag.querySelectorAll('script').forEach((script) => {\n const fixedScript = document.createElement('script')\n fixedScript.src = script.src\n fixedScript.async = false\n script.parentNode.replaceChild(fixedScript, script)\n })\n }\n\n modal.modalAjaxLinkClick = function(e) {\n e.preventDefault();\n const href = e.target.closest('a').getAttribute('href')\n fetch(href, { headers: { 'X-Requested-With': 'XMLHttpRequest' }})\n .then(response => {\n if (!response.ok) {\n throw new TypeError(\"Request failed\");\n }\n return response.text();\n })\n .then(data => modal.receiveAjax(data))\n .catch(error => modal.onFailure(error))\n };\n\n modal.setupModal = function() {\n // Register several click handlers in ONE event handler for efficiency\n //\n // * close button OR click on backdrop (modal.modalSelector) closes modal\n // * trigger and preserve link in modal functionality -- if somethign matches both trigger and\n // preserve, still only called once.\n document.addEventListener('click', (e) => {\n if (e.target.closest(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))\n modal.modalAjaxLinkClick(e)\n else if (e.target.matches(`${modal.modalSelector}`) || e.target.closest('[data-bl-dismiss=\"modal\"]'))\n modal.hide()\n })\n\n // Make sure user-agent dismissal of html 'dialog', etc `esc` key, triggers\n // our hide logic, including events and scroll restoration.\n const modalDom = modal.target();\n if (modalDom) {\n modal.target().addEventListener('cancel', (e) => {\n e.preventDefault(); // 'hide' will close the modal unless cancelled\n\n modal.hide();\n });\n }\n };\n\n modal.hide = function (el) {\n const dom = modal.target();\n\n if (!dom.open) return\n\n var e = new CustomEvent('hide.blacklight.blacklight-modal', { bubbles: true, cancelable: true });\n dom.dispatchEvent(e)\n\n dom.close()\n\n // Turn body scrolling back to what it was\n document.body.style[\"overflow\"] = modal.originalBodyOverflow;\n document.body.style[\"padding-right\"] = modal.originalBodyPaddingRight;\n modal.originalBodyOverflow = undefined;\n modal.originalBodyPaddingRight = undefined;\n }\n\n modal.show = function(el) {\n const dom = modal.target();\n\n if (dom.open) return\n\n var e = new CustomEvent('show.blacklight.blacklight-modal', { bubbles: true, cancelable: true });\n dom.dispatchEvent(e)\n\n dom.showModal()\n\n // Turn off body scrolling\n modal.originalBodyOverflow = document.body.style['overflow'];\n modal.originalBodyPaddingRight = document.body.style['padding-right'];\n document.body.style[\"overflow\"] = \"hidden\"\n document.body.style[\"padding-right\"] = \"0px\"\n }\n\n modal.target = function() {\n return document.querySelector(modal.modalSelector);\n }\n\n modal.setupModal()\n\n return modal;\n})()\n\nexport default Modal\n","const SearchContext = (e) => {\n const contextLink = e.target.closest('[data-context-href]')\n if (contextLink) {\n SearchContext.handleSearchContextMethod.call(contextLink, e)\n }\n}\n\nSearchContext.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content\nSearchContext.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content\n\n// this is the Rails.handleMethod with a couple adjustments, described inline:\n// first, we're attaching this directly to the event handler, so we can check for meta-keys\nSearchContext.handleSearchContextMethod = function(event) {\n const link = this\n\n // instead of using the normal href, we need to use the context href instead\n let href = link.getAttribute('data-context-href')\n let target = link.getAttribute('target')\n let csrfToken = SearchContext.csrfToken()\n let csrfParam = SearchContext.csrfParam()\n let form = document.createElement('form')\n form.method = 'post'\n form.action = href\n\n\n let formContent = `<input name=\"_method\" value=\"post\" type=\"hidden\" />\n <input name=\"redirect\" value=\"${link.getAttribute('href')}\" type=\"hidden\" />`\n\n // check for meta keys.. if set, we should open in a new tab\n if(event.metaKey || event.ctrlKey) {\n form.dataset.turbo = \"false\";\n target = '_blank';\n }\n\n if (csrfParam !== undefined && csrfToken !== undefined) {\n formContent += `<input name=\"${csrfParam}\" value=\"${csrfToken}\" type=\"hidden\" />`\n }\n\n // Must trigger submit by click on a button, else \"submit\" event handler won't work!\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n formContent += '<input type=\"submit\" />'\n\n if (target) { form.setAttribute('target', target); }\n\n form.style.display = 'none'\n form.innerHTML = formContent\n document.body.appendChild(form)\n form.querySelector('[type=\"submit\"]').click()\n\n event.preventDefault()\n};\n\ndocument.addEventListener('click', SearchContext)\n\nexport default SearchContext\n","import BookmarkToggle from 'blacklight-frontend/bookmark_toggle'\nimport ButtonFocus from 'blacklight-frontend/button_focus'\nimport ColorThemeSwitcher from 'blacklight-frontend/color_theme_switcher'\nimport FacetSuggest from 'blacklight-frontend/facet_suggest'\nimport Modal from 'blacklight-frontend/modal'\nimport SearchContext from 'blacklight-frontend/search_context'\nimport Core from 'blacklight-frontend/core'\n\nexport default {\n BookmarkToggle,\n ButtonFocus,\n ColorThemeSwitcher,\n FacetSuggest,\n Modal,\n SearchContext,\n Core,\n onLoad: Core.onLoad\n}\n"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,MAAM,cAAc,CAAC;AACpC,EAAE,WAAW,CAAC,IAAI,EAAE;AACpB,IAAI,IAAI,CAAC,IAAI,GAAG;AAChB,EAAE;;AAEF,EAAE,OAAO,CAAC,GAAG,EAAE;AACf,IAAI,IAAI,CAAC,UAAU,CAAC,SA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,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;;AAErD,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG;AACvB,EAAE,IAAI,CAAC,SAAS,GAAG;AACnB,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI;AAChC,EAAE,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,KAAK;;AAE7C,EAAE,KAAK,CAAC,cAAc;AACtB,CAAC;;AAED,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,aAAa;;AC5ChD,cAAe;AACf,EAAE,cAAc;AAChB,EAAE,WAAW;AACb,EAAE,kBAAkB;AACpB,EAAE,YAAY;AACd,EAAE,KAAK;AACP,EAAE,aAAa;AACf,EAAE,IAAI;AACN,EAAE,MAAM,EAAE,IAAI,CAAC;AACf;;"}
|
|
@@ -47,14 +47,8 @@ Blacklight.onLoad(function () {
|
|
|
47
47
|
elem.classList.remove('no-js');
|
|
48
48
|
elem.classList.add('js');
|
|
49
49
|
});
|
|
50
|
-
Blacklight.csrfToken = () =>
|
|
51
|
-
|
|
52
|
-
return (_document$querySelect = document.querySelector('meta[name=csrf-token]')) === null || _document$querySelect === void 0 ? void 0 : _document$querySelect.content;
|
|
53
|
-
};
|
|
54
|
-
Blacklight.csrfParam = () => {
|
|
55
|
-
var _document$querySelect2;
|
|
56
|
-
return (_document$querySelect2 = document.querySelector('meta[name=csrf-param]')) === null || _document$querySelect2 === void 0 ? void 0 : _document$querySelect2.content;
|
|
57
|
-
};
|
|
50
|
+
Blacklight.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content;
|
|
51
|
+
Blacklight.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content;
|
|
58
52
|
window.Blacklight = Blacklight;
|
|
59
53
|
/*global Bloodhound */
|
|
60
54
|
|
|
@@ -481,7 +475,8 @@ Blacklight.handleSearchContextMethod = function (event) {
|
|
|
481
475
|
let form = document.createElement('form');
|
|
482
476
|
form.method = 'post';
|
|
483
477
|
form.action = href;
|
|
484
|
-
let formContent =
|
|
478
|
+
let formContent = `<input name="_method" value="post" type="hidden" />
|
|
479
|
+
<input name="redirect" value="${link.getAttribute('href')}" type="hidden" />`;
|
|
485
480
|
|
|
486
481
|
// check for meta keys.. if set, we should open in a new tab
|
|
487
482
|
if (event.metaKey || event.ctrlKey) {
|
|
@@ -489,7 +484,7 @@ Blacklight.handleSearchContextMethod = function (event) {
|
|
|
489
484
|
target = '_blank';
|
|
490
485
|
}
|
|
491
486
|
if (csrfParam !== undefined && csrfToken !== undefined) {
|
|
492
|
-
formContent +=
|
|
487
|
+
formContent += `<input name="${csrfParam}" value="${csrfToken}" type="hidden" />`;
|
|
493
488
|
}
|
|
494
489
|
|
|
495
490
|
// Must trigger submit by click on a button, else "submit" event handler won't work!
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blacklight.js","sources":["../../../javascript/blacklight/checkbox_submit.js","../../../javascript/blacklight/bookmark_toggle.js","../../../javascript/blacklight/button_focus.js","../../../javascript/blacklight/modal.js","../../../javascript/blacklight/search_context.js","../../../javascript/blacklight/core.js","../../../javascript/blacklight/index.js"],"sourcesContent":["/* Converts a \"toggle\" form, with single submit button to add/remove\n something, like used for Bookmarks, into an AJAXy checkbox instead.\n Apply to a form. Does require certain assumption about the form:\n 1) The same form 'action' href must be used for both ADD and REMOVE\n actions, with the different being the hidden input name=\"_method\"\n being set to \"put\" or \"delete\" -- that's the Rails method to pretend\n to be doing a certain HTTP verb. So same URL, PUT to add, DELETE\n to remove. This plugin assumes that.\n Plus, the form this is applied to should provide a data-doc-id\n attribute (HTML5-style doc-*) that contains the id/primary key\n of the object in question -- used by plugin for a unique value for\n DOM id's.\n Uses HTML for a checkbox compatible with Bootstrap 4.\n new CheckboxSubmit(document.querySelector('form.something')).render()\n*/\nexport default class CheckboxSubmit {\n constructor(form) {\n this.form = form\n }\n\n clicked(evt) {\n this.spanTarget.innerHTML = this.form.getAttribute('data-inprogress')\n this.labelTarget.setAttribute('disabled', 'disabled');\n this.checkboxTarget.setAttribute('disabled', 'disabled');\n fetch(this.formTarget.getAttribute('action'), {\n body: new FormData(this.formTarget),\n method: this.formTarget.getAttribute('method').toUpperCase(),\n headers: {\n 'Accept': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': document.querySelector('meta[name=csrf-token]')?.content\n }\n }).then((response) => {\n if (response.ok) return response.json();\n return Promise.reject('response was not ok')\n }).then((json) => {\n this.labelTarget.removeAttribute('disabled')\n this.checkboxTarget.removeAttribute('disabled')\n this.updateStateFor(!this.checked)\n document.querySelector('[data-role=bookmark-counter]').innerHTML = json.bookmarks.count\n }).catch((error) => {\n this.handleError(error)\n })\n }\n\n get checked() {\n return (this.form.querySelectorAll('input[name=_method][value=delete]').length != 0)\n }\n\n get formTarget() {\n return this.form\n }\n\n get labelTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"label\"]')\n }\n\n get checkboxTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"checkbox\"]')\n }\n\n get spanTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"span\"]')\n }\n\n handleError() {\n alert(\"Unable to save the bookmark at this time.\")\n }\n\n updateStateFor(state) {\n this.checkboxTarget.checked = state\n\n if (state) {\n this.labelTarget.classList.add('checked')\n //Set the Rails hidden field that fakes an HTTP verb\n //properly for current state action.\n this.formTarget.querySelector('input[name=_method]').value = 'delete'\n this.spanTarget.innerHTML = this.form.getAttribute('data-present')\n } else {\n this.labelTarget.classList.remove('checked')\n this.formTarget.querySelector('input[name=_method]').value = 'put'\n this.spanTarget.innerHTML = this.form.getAttribute('data-absent')\n }\n }\n}\n","import CheckboxSubmit from 'blacklight/checkbox_submit'\n\nconst BookmarkToggle = (e) => {\n if (e.target.matches('[data-checkboxsubmit-target=\"checkbox\"]')) {\n const form = e.target.closest('form')\n if (form) new CheckboxSubmit(form).clicked(e);\n }\n};\n\ndocument.addEventListener('click', BookmarkToggle);\n\nexport default BookmarkToggle\n","const ButtonFocus = (e) => {\n // Button clicks should change focus. As of 10/3/19, Firefox for Mac and\n // Safari both do not set focus to a button on button click.\n // See https://zellwk.com/blog/inconsistent-button-behavior/ for background information\n if (e.target.matches('[data-toggle=\"collapse\"]') || e.target.matches('[data-bs-toggle=\"collapse\"]')) {\n e.target.focus()\n }\n}\n\ndocument.addEventListener('click', ButtonFocus)\n\nexport default ButtonFocus\n","/*\n The blacklight modal plugin can display some interactions inside a Bootstrap\n modal window, including some multi-page interactions.\n\n It supports unobtrusive Javascript, where a link or form that would have caused\n a new page load is changed to display it's results inside a modal dialog,\n by this plugin. The plugin assumes there is a Bootstrap modal div\n on the page with id #blacklight-modal to use as the modal -- the standard Blacklight\n layout provides this.\n\n To make a link or form have their results display inside a modal, add\n `data-blacklight-modal=\"trigger\"` to the link or form. (Note, form itself not submit input)\n With Rails link_to helper, you'd do that like:\n\n link_to something, link, data: { blacklight_modal: \"trigger\" }\n\n The results of the link href or form submit will be displayed inside\n a modal -- they should include the proper HTML markup for a bootstrap modal's\n contents. Also, you ordinarily won't want the Rails template with wrapping\n navigational elements to be used. The Rails controller could suppress\n the layout when a JS AJAX request is detected, OR the response\n can include a `<div data-blacklight-modal=\"container\">` -- only the contents\n of the container will be placed inside the modal, the rest of the\n page will be ignored.\n\n Link or forms inside the modal will ordinarily cause page loads\n when they are triggered. However, if you'd like their results\n to stay within the modal, just add `data-blacklight-modal=\"preserve\"`\n to the link or form.\n\n Here's an example of what might be returned, demonstrating most of the devices available:\n\n <div data-blacklight-modal=\"container\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"close\" data-bl-dismiss=\"modal\" aria-hidden=\"true\">×</button>\n <h3 class=\"modal-title\">Request Placed</h3>\n </div>\n\n <div class=\"modal-body\">\n <p>Some message</p>\n <%= link_to \"This result will still be within modal\", some_link, data: { blacklight_modal: \"preserve\" } %>\n </div>\n\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-bl-dismiss=\"modal\">Close</button>\n </div>\n </div>\n\n\n One additional feature. If the content returned from the AJAX form submission\n can be a turbo-stream that defines some HTML fragementsand where on the page to put them:\n https://turbo.hotwired.dev/handbook/streams\n*/\nimport ModalForm from 'blacklight/modalForm'\n\nconst Modal = (() => {\n const modal = {}\n\n // a Bootstrap modal div that should be already on the page hidden\n modal.modalSelector = '#blacklight-modal';\n\n // Trigger selectors identify forms or hyperlinks that should open\n // inside a modal dialog.\n modal.triggerLinkSelector = 'a[data-blacklight-modal~=trigger]';\n\n // preserve selectors identify forms or hyperlinks that, if activated already\n // inside a modal dialog, should have destinations remain inside the modal -- but\n // won't trigger a modal if not already in one.\n //\n // No need to repeat selectors from trigger selectors, those will already\n // be preserved. MUST be manually prefixed with the modal selector,\n // so they only apply to things inside a modal.\n modal.preserveLinkSelector = modal.modalSelector + ' a[data-blacklight-modal~=preserve]';\n\n modal.containerSelector = '[data-blacklight-modal~=container]';\n\n // Called on fatal failure of ajax load, function returns content\n // to show to user in modal. Right now called only for network errors.\n modal.onFailure = function (error) {\n console.error('Server error:', this.url, error);\n\n const contents = `<div class=\"modal-header\">\n <div class=\"modal-title\">There was a problem with your request.</div>\n <button type=\"button\" class=\"blacklight-modal-close btn-close close\" data-bl-dismiss=\"modal\" aria-label=\"Close\">\n <span aria-hidden=\"true\" class=\"visually-hidden\">×</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p>Expected a successful response from the server, but got an error</p>\n <pre>${this.url}\\n${error}</pre>\n </div>`\n\n document.querySelector(`${modal.modalSelector} .modal-content`).innerHTML = contents\n\n modal.show();\n }\n\n // Add the passed in contents to the modal and display it.\n // We have specific handling so that scripts returned from the ajax call are executed.\n // This enables adding a script like recaptcha to prevent bots from sending emails.\n modal.receiveAjax = function (contents) {\n const domparser = new DOMParser();\n const dom = domparser.parseFromString(contents, \"text/html\")\n // If there is a containerSelector on the document, use its children.\n let elements = dom.querySelectorAll(`${modal.containerSelector} > *`)\n const frag = document.createDocumentFragment()\n if (elements.length == 0) {\n // If the containerSelector wasn't found, use the whole document\n elements = dom.body.childNodes\n }\n elements.forEach((el) => frag.appendChild(el))\n modal.activateScripts(frag)\n \n document.querySelector(`${modal.modalSelector} .modal-content`).replaceChildren(frag)\n\n modal.show();\n };\n\n // DOMParser doesn't allow scripts to be executed. This fixes that.\n modal.activateScripts = function (frag) {\n frag.querySelectorAll('script').forEach((script) => {\n const fixedScript = document.createElement('script')\n fixedScript.src = script.src\n fixedScript.async = false\n script.parentNode.replaceChild(fixedScript, script)\n })\n }\n\n modal.modalAjaxLinkClick = function(e) {\n e.preventDefault();\n const href = e.target.getAttribute('href')\n fetch(href)\n .then(response => {\n if (!response.ok) {\n throw new TypeError(\"Request failed\");\n }\n return response.text();\n })\n .then(data => modal.receiveAjax(data))\n .catch(error => modal.onFailure(error))\n };\n\n modal.setupModal = function() {\n // Register both trigger and preserve selectors in ONE event handler, combining\n // into one selector with a comma, so if something matches BOTH selectors, it\n // still only gets the event handler called once.\n document.addEventListener('click', (e) => {\n if (e.target.closest(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))\n modal.modalAjaxLinkClick(e)\n else if (e.target.closest('[data-bl-dismiss=\"modal\"]'))\n modal.hide()\n })\n };\n\n modal.hide = function (el) {\n const dom = document.querySelector(modal.modalSelector)\n\n if (!dom.open) return\n dom.close()\n }\n\n modal.show = function(el) {\n const dom = document.querySelector(modal.modalSelector)\n\n if (dom.open) return\n dom.showModal()\n }\n\n modal.setupModal()\n\n return modal;\n})()\n\nexport default Modal\n","const SearchContext = (e) => {\n if (e.target.matches('[data-context-href]')) {\n SearchContext.handleSearchContextMethod.call(e.target, e)\n }\n}\n\nSearchContext.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content\nSearchContext.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content\n\n// this is the Rails.handleMethod with a couple adjustments, described inline:\n// first, we're attaching this directly to the event handler, so we can check for meta-keys\nSearchContext.handleSearchContextMethod = function(event) {\n const link = this\n\n // instead of using the normal href, we need to use the context href instead\n let href = link.getAttribute('data-context-href')\n let target = link.getAttribute('target')\n let csrfToken = SearchContext.csrfToken()\n let csrfParam = SearchContext.csrfParam()\n let form = document.createElement('form')\n form.method = 'post'\n form.action = href\n\n\n let formContent = `<input name=\"_method\" value=\"post\" type=\"hidden\" />\n <input name=\"redirect\" value=\"${link.getAttribute('href')}\" type=\"hidden\" />`\n\n // check for meta keys.. if set, we should open in a new tab\n if(event.metaKey || event.ctrlKey) {\n form.dataset.turbo = \"false\";\n target = '_blank';\n }\n\n if (csrfParam !== undefined && csrfToken !== undefined) {\n formContent += `<input name=\"${csrfParam}\" value=\"${csrfToken}\" type=\"hidden\" />`\n }\n\n // Must trigger submit by click on a button, else \"submit\" event handler won't work!\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n formContent += '<input type=\"submit\" />'\n\n if (target) { form.setAttribute('target', target); }\n\n form.style.display = 'none'\n form.innerHTML = formContent\n document.body.appendChild(form)\n form.querySelector('[type=\"submit\"]').click()\n\n event.preventDefault()\n};\n\ndocument.addEventListener('click', SearchContext)\n\nexport default SearchContext\n","const Blacklight = function() {\n const buffer = new Array;\n return {\n onLoad: function(func) {\n buffer.push(func);\n },\n\n activate: function() {\n for(let i = 0; i < buffer.length; i++) {\n buffer[i].call();\n }\n },\n\n listeners: function () {\n const listeners = [];\n if (typeof Turbo !== 'undefined') {\n listeners.push('turbo:load', 'turbo:frame-load');\n } else if (typeof Turbolinks !== 'undefined' && Turbolinks.supported) {\n // Turbolinks 5\n if (Turbolinks.BrowserAdapter) {\n listeners.push('turbolinks:load');\n } else {\n // Turbolinks < 5\n listeners.push('page:load', 'DOMContentLoaded');\n }\n } else {\n listeners.push('DOMContentLoaded');\n }\n\n return listeners;\n }\n };\n}();\n\n// turbolinks triggers page:load events on page transition\n// If app isn't using turbolinks, this event will never be triggered, no prob.\nBlacklight.listeners().forEach(function(listener) {\n document.addEventListener(listener, function() {\n Blacklight.activate()\n })\n})\n\nBlacklight.onLoad(function () {\n const elem = document.querySelector('.no-js');\n\n // The \"no-js\" class may already have been removed because this function is\n // run on every turbo:load event, in that case, it won't find an element.\n if (!elem) return;\n\n elem.classList.remove('no-js')\n elem.classList.add('js')\n})\n\n\nexport default Blacklight\n","import BookmarkToggle from 'blacklight/bookmark_toggle'\nimport ButtonFocus from 'blacklight/button_focus'\nimport Modal from 'blacklight/modal'\nimport SearchContext from 'blacklight/search_context'\nimport Core from 'blacklight/core'\n\nexport default {\n BookmarkToggle,\n ButtonFocus,\n Modal,\n SearchContext,\n Core,\n onLoad: Core.onLoad\n}\n"],"names":["Core"],"mappings":";;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACe,MAAM,cAAc,CAAC;EACpC,EAAE,WAAW,CAAC,IAAI,EAAE;EACpB,IAAI,IAAI,CAAC,IAAI,GAAG,KAAI;EACpB,GAAG;AACH;EACA,EAAE,OAAO,CAAC,GAAG,EAAE;EACf,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,iBAAiB,EAAC;EACzE,IAAI,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;EAC1D,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;EAC7D,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE;EAClD,MAAM,IAAI,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC;EACzC,MAAM,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE;EAClE,MAAM,OAAO,EAAE;EACf,QAAQ,QAAQ,EAAE,kBAAkB;EACpC,QAAQ,kBAAkB,EAAE,gBAAgB;EAC5C,QAAQ,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,CAAC;AACJ;EACA;EACA;EACA,UAAU,CAAC,SAAS,EAAE,CAAC,OAAO,CAAC,SAAS,QAAQ,EAAE;EAClD,EAAE,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,EAAE,WAAW;EACjD,IAAI,UAAU,CAAC,QAAQ,GAAE;EACzB,GAAG,EAAC;EACJ,CAAC,EAAC;AACF;EACA,UAAU,CAAC,MAAM,CAAC,YAAY;EAC9B,EAAE,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;AAChD;EACA;EACA;EACA,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO;AACpB;EACA,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,EAAC;EAChC,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,EAAC;EAC1B,CAAC;;AC7CD,gBAAe;EACf,EAAE,cAAc;EAChB,EAAE,WAAW;EACb,EAAE,KAAK;EACP,EAAE,aAAa;EACf,QAAEA,UAAI;EACN,EAAE,MAAM,EAAEA,UAAI,CAAC,MAAM;EACrB;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"blacklight.js","sources":["../../../javascript/blacklight-frontend/checkbox_submit.js","../../../javascript/blacklight-frontend/bookmark_toggle.js","../../../javascript/blacklight-frontend/button_focus.js","../../../javascript/blacklight-frontend/core.js","../../../javascript/blacklight-frontend/color_theme_switcher.js","../../../javascript/blacklight-frontend/debounce.js","../../../javascript/blacklight-frontend/facet_suggest.js","../../../javascript/blacklight-frontend/modal.js","../../../javascript/blacklight-frontend/search_context.js","../../../javascript/blacklight-frontend/index.js"],"sourcesContent":["/* Converts a \"toggle\" form, with single submit button to add/remove\n something, like used for Bookmarks, into an AJAXy checkbox instead.\n Apply to a form. Does require certain assumption about the form:\n 1) The same form 'action' href must be used for both ADD and REMOVE\n actions, with the different being the hidden input name=\"_method\"\n being set to \"put\" or \"delete\" -- that's the Rails method to pretend\n to be doing a certain HTTP verb. So same URL, PUT to add, DELETE\n to remove. This plugin assumes that.\n Plus, the form this is applied to should provide a data-doc-id\n attribute (HTML5-style doc-*) that contains the id/primary key\n of the object in question -- used by plugin for a unique value for\n DOM id's.\n Uses HTML for a checkbox compatible with Bootstrap.\n new CheckboxSubmit(document.querySelector('form.something')).render()\n*/\nexport default class CheckboxSubmit {\n constructor(form) {\n this.form = form\n }\n\n clicked(evt) {\n this.spanTarget.innerHTML = this.form.getAttribute('data-inprogress')\n this.labelTarget.setAttribute('disabled', 'disabled');\n this.checkboxTarget.setAttribute('disabled', 'disabled');\n fetch(this.formTarget.getAttribute('action'), {\n body: new FormData(this.formTarget),\n method: this.formTarget.getAttribute('method').toUpperCase(),\n headers: {\n 'Accept': 'application/json',\n 'X-Requested-With': 'XMLHttpRequest',\n 'X-CSRF-Token': document.querySelector('meta[name=csrf-token]')?.content\n }\n }).then((response) => {\n if (response.ok) return response.json();\n return Promise.reject('response was not ok')\n }).then((json) => {\n this.labelTarget.removeAttribute('disabled')\n this.checkboxTarget.removeAttribute('disabled')\n // For accessibility return keyboard focus\n // back to the checkbox after form submission\n this.checkboxTarget.focus()\n this.updateStateFor(!this.checked)\n this.bookmarksCounter().forEach(counter => {\n counter.innerHTML = json.bookmarks.count;\n });\n\n var e = new CustomEvent('bookmark.blacklight', { detail: { checked: this.checked }, bubbles: true });\n this.formTarget.dispatchEvent(e)\n }).catch((error) => {\n this.handleError(error)\n })\n }\n\n get checked() {\n return (this.form.querySelectorAll('input[name=_method][value=delete]').length != 0)\n }\n\n get formTarget() {\n return this.form\n }\n\n get labelTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"label\"]')\n }\n\n get checkboxTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"checkbox\"]')\n }\n\n get spanTarget() {\n return this.form.querySelector('[data-checkboxsubmit-target=\"span\"]')\n }\n\n bookmarksCounter() {\n return document.querySelectorAll('[data-role=\"bookmark-counter\"]')\n }\n\n handleError() {\n alert(\"Unable to save the bookmark at this time.\")\n }\n\n updateStateFor(state) {\n if (state) { this.checkboxTarget.setAttribute('checked', state) }\n else { this.checkboxTarget.removeAttribute('checked') }\n\n if (state) {\n this.labelTarget.classList.add('checked')\n //Set the Rails hidden field that fakes an HTTP verb\n //properly for current state action.\n this.formTarget.querySelector('input[name=_method]').value = 'delete'\n this.spanTarget.innerHTML = this.form.getAttribute('data-present')\n } else {\n this.labelTarget.classList.remove('checked')\n this.formTarget.querySelector('input[name=_method]').value = 'put'\n this.spanTarget.innerHTML = this.form.getAttribute('data-absent')\n }\n }\n}\n","import CheckboxSubmit from 'blacklight-frontend/checkbox_submit'\n\nconst BookmarkToggle = (e) => {\n const elementType = e.target.getAttribute('data-checkboxsubmit-target');\n if (elementType == 'checkbox' || elementType == 'label') {\n const form = e.target.closest('form');\n if (form) new CheckboxSubmit(form).clicked(e);\n if (e.code == 'Space') e.preventDefault();\n }\n};\n\ndocument.addEventListener('click', BookmarkToggle);\ndocument.addEventListener('keydown', function (e) {\n if (e.key === 'Enter' || e.code == 'Space') { BookmarkToggle(e); } }\n);\n\nexport default BookmarkToggle\n","const ButtonFocus = (e) => {\n // Button clicks should change focus. As of 10/3/19, Firefox for Mac and\n // Safari both do not set focus to a button on button click.\n // See https://zellwk.com/blog/inconsistent-button-behavior/ for background information\n if (e.target.matches('[data-bs-toggle=\"collapse\"]')) {\n e.target.focus()\n }\n}\n\ndocument.addEventListener('click', ButtonFocus)\n\nexport default ButtonFocus\n","const Core = function() {\n const buffer = new Array;\n return {\n onLoad: function(func) {\n buffer.push(func);\n },\n\n activate: function() {\n for(let i = 0; i < buffer.length; i++) {\n buffer[i].call();\n }\n },\n\n listeners: function () {\n const listeners = [];\n if (typeof Turbo !== 'undefined') {\n listeners.push('turbo:load', 'turbo:frame-load');\n } else {\n listeners.push('DOMContentLoaded');\n }\n\n return listeners;\n }\n };\n}();\n\n// turbo triggers turbo:load events on page transition\n// If app isn't using turbo, this event will never be triggered, no prob.\nCore.listeners().forEach(function(listener) {\n document.addEventListener(listener, function() {\n Core.activate()\n })\n})\n\nCore.onLoad(function () {\n const elem = document.querySelector('.no-js');\n\n // The \"no-js\" class may already have been removed because this function is\n // run on every turbo:load event, in that case, it won't find an element.\n if (!elem) return;\n\n elem.classList.remove('no-js')\n elem.classList.add('js')\n})\n\n\nexport default Core\n","/*!\n * Color mode toggler for Blacklight\n * Based on Bootstrap's color mode toggler (https://getbootstrap.com/docs/5.3/customize/color-modes/#javascript)\n */\n\nimport Core from 'blacklight-frontend/core'\n\nconst ColorThemeSwitcher = (() => {\n 'use strict'\n\n const getStoredTheme = () => localStorage.getItem('theme')\n const setStoredTheme = theme => localStorage.setItem('theme', theme)\n\n const getPreferredTheme = () => {\n const storedTheme = getStoredTheme()\n if (storedTheme) {\n return storedTheme\n }\n return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'\n }\n\n const setTheme = theme => {\n if (theme === 'auto') {\n document.documentElement.setAttribute('data-bs-theme', window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light')\n } else {\n document.documentElement.setAttribute('data-bs-theme', theme)\n }\n }\n\n const showActiveTheme = (theme, focus = false) => {\n const themeSwitcher = document.querySelector('#bl-theme-switcher')\n if (!themeSwitcher) return\n\n // Reset all dropdown items\n document.querySelectorAll('[data-bs-theme-value]').forEach(element => {\n element.classList.remove('active')\n element.setAttribute('aria-pressed', 'false')\n const check = element.querySelector('.bl-theme-check')\n if (check) check.classList.add('d-none')\n })\n\n // Activate the selected item\n const btnToActive = document.querySelector(`[data-bs-theme-value=\"${theme}\"]`)\n if (btnToActive) {\n btnToActive.classList.add('active')\n btnToActive.setAttribute('aria-pressed', 'true')\n const check = btnToActive.querySelector('.bl-theme-check')\n if (check) check.classList.remove('d-none')\n }\n\n // Swap the toggle button icon\n themeSwitcher.querySelectorAll('.bl-theme-icon').forEach(icon => icon.classList.add('d-none'))\n const activeIcon = themeSwitcher.querySelector(`.bl-theme-icon[data-bl-theme-icon=\"${theme}\"]`)\n if (activeIcon) activeIcon.classList.remove('d-none')\n\n themeSwitcher.setAttribute('aria-label', `Toggle theme (${theme})`)\n\n if (focus) {\n themeSwitcher.focus()\n }\n }\n\n window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {\n const storedTheme = getStoredTheme()\n if (storedTheme !== 'light' && storedTheme !== 'dark') {\n setTheme(getPreferredTheme())\n }\n })\n\n document.addEventListener('click', e => {\n const btn = e.target.closest('[data-bs-theme-value]')\n if (!btn) return\n\n const theme = btn.getAttribute('data-bs-theme-value')\n setStoredTheme(theme)\n setTheme(theme)\n showActiveTheme(theme, true)\n })\n\n Core.onLoad(() => showActiveTheme(getPreferredTheme()))\n\n return { setTheme, getPreferredTheme, showActiveTheme }\n})()\n\nexport default ColorThemeSwitcher\n","// Usage:\n// ```\n// const basicFunction = (entry) => console.log(entry)\n// const debounced = debounce(basicFunction(\"I should only be called once\"));\n//\n// debounced // does NOT print to the screen because it is invoked again less than 200 milliseconds later\n// debounced // does print to the screen\n// ```\nexport default function debounce(func, timeout = 200) {\n let timer;\n return (...args) => {\n clearTimeout(timer);\n timer = setTimeout(() => { func.apply(this, args); }, timeout);\n };\n}\n","import debounce from \"blacklight-frontend/debounce\";\n\nconst FacetSuggest = async (e) => {\n if (e.target.matches('.facet-suggest')) {\n const queryFragment = e.target.value?.trim();\n const facetField = e.target.dataset.facetField;\n const facetArea = document.querySelector('.facet-extended-list');\n const prevNextLinks = document.querySelectorAll('.prev_next_links');\n\n if (!facetField) { return; }\n\n // Get the search params from the current query so the facet suggestions\n // can retain that context.\n const facetSearchContext = e.target.dataset.facetSearchContext;\n const url = new URL(facetSearchContext, window.location.origin);\n\n // Drop facet.page so a filtered suggestion list will always start on page 1\n url.searchParams.delete('facet.page');\n // add our queryFragment for facet filtering\n url.searchParams.append('query_fragment', queryFragment);\n\n const facetSearchParams = url.searchParams.toString();\n const basePathComponent = url.pathname.split('/')[1];\n\n const urlToFetch = `/${basePathComponent}/facet_suggest/${facetField}?${facetSearchParams}`;\n\n const response = await fetch(urlToFetch);\n if (response.ok) {\n const blob = await response.blob()\n const text = await blob.text()\n\n if (text && facetArea) {\n facetArea.innerHTML = text\n }\n }\n\n // Hide the prev/next links when a user enters text in the facet\n // suggestion input. They don't work with a filtered list.\n prevNextLinks.forEach(element => {\n element.classList.toggle('invisible', !!queryFragment);\n });\n\n // Add a class to distinguish suggested facet values vs. regular.\n facetArea.classList.toggle('facet-suggestions', !!queryFragment);\n }\n};\n\ndocument.addEventListener('input', debounce(FacetSuggest));\n\nexport default FacetSuggest\n","/*\n The blacklight modal plugin can display some interactions inside a Bootstrap\n modal window, including some multi-page interactions.\n\n It supports unobtrusive Javascript, where a link or form that would have caused\n a new page load is changed to display it's results inside a modal dialog,\n by this plugin. The plugin assumes there is a Bootstrap modal div\n on the page with id #blacklight-modal to use as the modal -- the standard Blacklight\n layout provides this.\n\n To make a link or form have their results display inside a modal, add\n `data-blacklight-modal=\"trigger\"` to the link or form. (Note, form itself not submit input)\n With Rails link_to helper, you'd do that like:\n\n link_to something, link, data: { blacklight_modal: \"trigger\" }\n\n The results of the link href or form submit will be displayed inside\n a modal -- they should include the proper HTML markup for a bootstrap modal's\n contents. Also, you ordinarily won't want the Rails template with wrapping\n navigational elements to be used. The Rails controller could suppress\n the layout when a JS AJAX request is detected, OR the response\n can include a `<div data-blacklight-modal=\"container\">` -- only the contents\n of the container will be placed inside the modal, the rest of the\n page will be ignored.\n\n Link or forms inside the modal will ordinarily cause page loads\n when they are triggered. However, if you'd like their results\n to stay within the modal, just add `data-blacklight-modal=\"preserve\"`\n to the link or form.\n\n Here's an example of what might be returned, demonstrating most of the devices available:\n\n <div data-blacklight-modal=\"container\">\n <div class=\"modal-header\">\n <button type=\"button\" class=\"btn-close\" data-bl-dismiss=\"modal\" aria-hidden=\"true\">×</button>\n <h3 class=\"modal-title\">Request Placed</h3>\n </div>\n\n <div class=\"modal-body\">\n <p>Some message</p>\n <%= link_to \"This result will still be within modal\", some_link, data: { blacklight_modal: \"preserve\" } %>\n </div>\n\n\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-secondary\" data-bl-dismiss=\"modal\">Close</button>\n </div>\n </div>\n\n\n One additional feature. If the content returned from the AJAX form submission\n can be a turbo-stream that defines some HTML fragementsand where on the page to put them:\n https://turbo.hotwired.dev/handbook/streams\n*/\n\nconst Modal = (() => {\n const modal = {}\n\n // a Bootstrap modal div that should be already on the page hidden\n modal.modalSelector = '#blacklight-modal';\n\n // Trigger selectors identify forms or hyperlinks that should open\n // inside a modal dialog.\n modal.triggerLinkSelector = 'a[data-blacklight-modal~=trigger]';\n\n // preserve selectors identify forms or hyperlinks that, if activated already\n // inside a modal dialog, should have destinations remain inside the modal -- but\n // won't trigger a modal if not already in one.\n //\n // No need to repeat selectors from trigger selectors, those will already\n // be preserved. MUST be manually prefixed with the modal selector,\n // so they only apply to things inside a modal.\n modal.preserveLinkSelector = modal.modalSelector + ' a[data-blacklight-modal~=preserve]';\n\n modal.containerSelector = '[data-blacklight-modal~=container]';\n\n // Called on fatal failure of ajax load, function returns content\n // to show to user in modal. Right now called only for network errors.\n modal.onFailure = function (error) {\n console.error('Server error:', this.url, error);\n\n const contents = `<div class=\"modal-header\">\n <div class=\"modal-title\">There was a problem with your request.</div>\n <button type=\"button\" class=\"blacklight-modal-close btn-close\" data-bl-dismiss=\"modal\" aria-label=\"Close\">\n </button>\n </div>\n <div class=\"modal-body\">\n <p>Expected a successful response from the server, but got an error</p>\n <pre>${this.url}\\n${error}</pre>\n </div>`\n\n modal.target().querySelector('.modal-content').innerHTML = contents\n\n modal.show();\n }\n\n // Add the passed in contents to the modal and display it.\n // We have specific handling so that scripts returned from the ajax call are executed.\n // This enables adding a script like recaptcha to prevent bots from sending emails.\n modal.receiveAjax = function (contents) {\n const domparser = new DOMParser();\n const dom = domparser.parseFromString(contents, \"text/html\")\n // If there is a containerSelector on the document, use its children.\n let elements = dom.querySelectorAll(`${modal.containerSelector} > *`)\n const frag = document.createDocumentFragment()\n if (elements.length == 0) {\n // If the containerSelector wasn't found, use the whole document\n elements = dom.body.childNodes\n }\n elements.forEach((el) => frag.appendChild(el))\n modal.activateScripts(frag)\n\n modal.target().querySelector('.modal-content').replaceChildren(frag)\n\n // send custom event with the modal dialog div as the target\n var e = new CustomEvent('loaded.blacklight.blacklight-modal', { bubbles: true, cancelable: true });\n modal.target().dispatchEvent(e)\n\n // if they did preventDefault, don't show the dialog\n if (e.defaultPrevented) return;\n modal.show();\n };\n\n // DOMParser doesn't allow scripts to be executed. This fixes that.\n modal.activateScripts = function (frag) {\n frag.querySelectorAll('script').forEach((script) => {\n const fixedScript = document.createElement('script')\n fixedScript.src = script.src\n fixedScript.async = false\n script.parentNode.replaceChild(fixedScript, script)\n })\n }\n\n modal.modalAjaxLinkClick = function(e) {\n e.preventDefault();\n const href = e.target.closest('a').getAttribute('href')\n fetch(href, { headers: { 'X-Requested-With': 'XMLHttpRequest' }})\n .then(response => {\n if (!response.ok) {\n throw new TypeError(\"Request failed\");\n }\n return response.text();\n })\n .then(data => modal.receiveAjax(data))\n .catch(error => modal.onFailure(error))\n };\n\n modal.setupModal = function() {\n // Register several click handlers in ONE event handler for efficiency\n //\n // * close button OR click on backdrop (modal.modalSelector) closes modal\n // * trigger and preserve link in modal functionality -- if somethign matches both trigger and\n // preserve, still only called once.\n document.addEventListener('click', (e) => {\n if (e.target.closest(`${modal.triggerLinkSelector}, ${modal.preserveLinkSelector}`))\n modal.modalAjaxLinkClick(e)\n else if (e.target.matches(`${modal.modalSelector}`) || e.target.closest('[data-bl-dismiss=\"modal\"]'))\n modal.hide()\n })\n\n // Make sure user-agent dismissal of html 'dialog', etc `esc` key, triggers\n // our hide logic, including events and scroll restoration.\n const modalDom = modal.target();\n if (modalDom) {\n modal.target().addEventListener('cancel', (e) => {\n e.preventDefault(); // 'hide' will close the modal unless cancelled\n\n modal.hide();\n });\n }\n };\n\n modal.hide = function (el) {\n const dom = modal.target();\n\n if (!dom.open) return\n\n var e = new CustomEvent('hide.blacklight.blacklight-modal', { bubbles: true, cancelable: true });\n dom.dispatchEvent(e)\n\n dom.close()\n\n // Turn body scrolling back to what it was\n document.body.style[\"overflow\"] = modal.originalBodyOverflow;\n document.body.style[\"padding-right\"] = modal.originalBodyPaddingRight;\n modal.originalBodyOverflow = undefined;\n modal.originalBodyPaddingRight = undefined;\n }\n\n modal.show = function(el) {\n const dom = modal.target();\n\n if (dom.open) return\n\n var e = new CustomEvent('show.blacklight.blacklight-modal', { bubbles: true, cancelable: true });\n dom.dispatchEvent(e)\n\n dom.showModal()\n\n // Turn off body scrolling\n modal.originalBodyOverflow = document.body.style['overflow'];\n modal.originalBodyPaddingRight = document.body.style['padding-right'];\n document.body.style[\"overflow\"] = \"hidden\"\n document.body.style[\"padding-right\"] = \"0px\"\n }\n\n modal.target = function() {\n return document.querySelector(modal.modalSelector);\n }\n\n modal.setupModal()\n\n return modal;\n})()\n\nexport default Modal\n","const SearchContext = (e) => {\n const contextLink = e.target.closest('[data-context-href]')\n if (contextLink) {\n SearchContext.handleSearchContextMethod.call(contextLink, e)\n }\n}\n\nSearchContext.csrfToken = () => document.querySelector('meta[name=csrf-token]')?.content\nSearchContext.csrfParam = () => document.querySelector('meta[name=csrf-param]')?.content\n\n// this is the Rails.handleMethod with a couple adjustments, described inline:\n// first, we're attaching this directly to the event handler, so we can check for meta-keys\nSearchContext.handleSearchContextMethod = function(event) {\n const link = this\n\n // instead of using the normal href, we need to use the context href instead\n let href = link.getAttribute('data-context-href')\n let target = link.getAttribute('target')\n let csrfToken = SearchContext.csrfToken()\n let csrfParam = SearchContext.csrfParam()\n let form = document.createElement('form')\n form.method = 'post'\n form.action = href\n\n\n let formContent = `<input name=\"_method\" value=\"post\" type=\"hidden\" />\n <input name=\"redirect\" value=\"${link.getAttribute('href')}\" type=\"hidden\" />`\n\n // check for meta keys.. if set, we should open in a new tab\n if(event.metaKey || event.ctrlKey) {\n form.dataset.turbo = \"false\";\n target = '_blank';\n }\n\n if (csrfParam !== undefined && csrfToken !== undefined) {\n formContent += `<input name=\"${csrfParam}\" value=\"${csrfToken}\" type=\"hidden\" />`\n }\n\n // Must trigger submit by click on a button, else \"submit\" event handler won't work!\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit\n formContent += '<input type=\"submit\" />'\n\n if (target) { form.setAttribute('target', target); }\n\n form.style.display = 'none'\n form.innerHTML = formContent\n document.body.appendChild(form)\n form.querySelector('[type=\"submit\"]').click()\n\n event.preventDefault()\n};\n\ndocument.addEventListener('click', SearchContext)\n\nexport default SearchContext\n","import BookmarkToggle from 'blacklight-frontend/bookmark_toggle'\nimport ButtonFocus from 'blacklight-frontend/button_focus'\nimport ColorThemeSwitcher from 'blacklight-frontend/color_theme_switcher'\nimport FacetSuggest from 'blacklight-frontend/facet_suggest'\nimport Modal from 'blacklight-frontend/modal'\nimport SearchContext from 'blacklight-frontend/search_context'\nimport Core from 'blacklight-frontend/core'\n\nexport default {\n BookmarkToggle,\n ButtonFocus,\n ColorThemeSwitcher,\n FacetSuggest,\n Modal,\n SearchContext,\n Core,\n onLoad: Core.onLoad\n}\n"],"names":[],"mappings":";;;;;;EAAA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACe,MAAM,cAAc,CAAC;EACpC,EAAE,WAAW,CAAC,IAAI,EAAE;EACpB,IAAI,IAAI,CAAC,IAAI,GAAG;EAChB,EAAE;;EAEF,EAAE,OAAO,CAAC,GAAG,EAAE;EACf,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,iBAAiB;EACxE,IAAI,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC;EACzD,IAAI,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,UAAU,EAAE,UAAU,CAAC;EAC5D,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,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;EACtB,CAAC;;EAED,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,aAAa;;AC5ChD,gBAAe;EACf,EAAE,cAAc;EAChB,EAAE,WAAW;EACb,EAAE,kBAAkB;EACpB,EAAE,YAAY;EACd,EAAE,KAAK;EACP,EAAE,aAAa;EACf,EAAE,IAAI;EACN,EAAE,MAAM,EAAE,IAAI,CAAC;EACf;;;;"}
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
white-space: nowrap;
|
|
16
16
|
|
|
17
17
|
@media (max-width: breakpoint-min(sm)) {
|
|
18
|
-
max-width: breakpoint-min(sm) * .5;
|
|
18
|
+
max-width: breakpoint-min(sm) * 0.5;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
@media (min-width: breakpoint-min(sm)) and (max-width: breakpoint-max(sm)) {
|
|
22
|
-
max-width: breakpoint-min(sm) * .5;
|
|
22
|
+
max-width: breakpoint-min(sm) * 0.5;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
@media (min-width: breakpoint-min(md)) and (max-width: breakpoint-max(md)) {
|
|
26
|
-
max-width: breakpoint-min(md) * .5;
|
|
26
|
+
max-width: breakpoint-min(md) * 0.5;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
@media (min-width: breakpoint-min(lg)) {
|
|
30
|
-
max-width: breakpoint-min(lg) * .5;
|
|
30
|
+
max-width: breakpoint-min(lg) * 0.5;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
&:hover, &:active {
|