blacklight 9.1.0 → 9.2.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.
- checksums.yaml +4 -4
- data/.github/workflows/build.yml +1 -1
- data/.github/workflows/lint.yml +1 -1
- data/.github/workflows/test.yml +2 -2
- data/VERSION +1 -1
- data/app/assets/javascripts/blacklight/blacklight.esm.js.map +1 -1
- data/app/assets/javascripts/blacklight/blacklight.js.map +1 -1
- data/app/components/blacklight/metadata_field_component.rb +2 -2
- data/app/controllers/concerns/blacklight/controller_runtime.rb +42 -0
- data/lib/blacklight/abstract_repository.rb +2 -0
- data/lib/blacklight/engine.rb +9 -0
- data/lib/blacklight/log_subscriber.rb +25 -0
- data/lib/blacklight/runtime_registry.rb +24 -0
- data/lib/blacklight/search_builder.rb +2 -1
- data/lib/blacklight/solr/repository.rb +15 -10
- data/lib/generators/blacklight/install_generator.rb +5 -0
- data/package.json +1 -1
- data/spec/components/blacklight/metadata_field_component_spec.rb +15 -0
- data/spec/controllers/application_controller_spec.rb +23 -0
- data/spec/features/axe_spec.rb +6 -0
- data/spec/features/search_pagination_spec.rb +14 -0
- data/spec/lib/blacklight/runtime_registry_spec.rb +46 -0
- data/spec/models/blacklight/solr/repository_spec.rb +69 -0
- data/spec/support/features/turbo_helpers.rb +1 -0
- data/spec/test_app_templates/Gemfile.extra +3 -0
- metadata +7 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 796b61a9e49f3a1fd99017bcd810cf1d6a497156e4389b047ab977a0cff13e22
|
|
4
|
+
data.tar.gz: 62b9dc70cb54ade0ee25c5b3704fbd98396235052831c28f73b630bc34be3f62
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 695f162e8b29894d856176eba6354017897777aa01eccf6e706c3c2312ebcef27c9d5483440e0b8ce2b39c7c675205c8dfe2c2e0a29e29c0220fda84a637ab35
|
|
7
|
+
data.tar.gz: 99fb5e3eff927b49862fe5925ecac89ee5443f4d1861d3b608248d4c5b3c123db4b8c87b02fed345252b0f1b009f7f0cb2cb75d38614970d85b2a17dec9a8393
|
data/.github/workflows/build.yml
CHANGED
data/.github/workflows/lint.yml
CHANGED
data/.github/workflows/test.yml
CHANGED
|
@@ -13,7 +13,7 @@ jobs:
|
|
|
13
13
|
matrix: ${{ steps.matrix.outputs.matrix }}
|
|
14
14
|
steps:
|
|
15
15
|
- name: Checkout repository
|
|
16
|
-
uses: actions/checkout@
|
|
16
|
+
uses: actions/checkout@v7
|
|
17
17
|
with:
|
|
18
18
|
ref: ${{ inputs.ref }}
|
|
19
19
|
- name: Echo ./.github/matrix.json
|
|
@@ -38,7 +38,7 @@ jobs:
|
|
|
38
38
|
ENGINE_CART_RAILS_OPTIONS: "--skip-git --skip-listen --skip-spring --skip-keeps --skip-kamal --skip-thruster --skip-solid --skip-coffee --skip-test ${{ matrix.additional_engine_cart_rails_options }}"
|
|
39
39
|
BUNDLER_VERSION: ${{ matrix.bundler_version || '2.7.2' }}
|
|
40
40
|
steps:
|
|
41
|
-
- uses: actions/checkout@
|
|
41
|
+
- uses: actions/checkout@v7
|
|
42
42
|
with:
|
|
43
43
|
ref: ${{ inputs.ref }}
|
|
44
44
|
- name: Set up Ruby
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
9.
|
|
1
|
+
9.2.0
|
|
@@ -1 +1 @@
|
|
|
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;;AAEA,EAAE,OAAO,CAAC,GAAG,EAAE;AACf,IAAI,IAA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AW;AACb,EAAE,kBAAkB;AACpB,EAAE,YAAY;AACd,EAAE,KAAK;AACP,EAAE,aAAa;AACf,EAAE,IAAI;AACN,EAAE,MAAM,EAAE,IAAI,CAAC;AACf;;;;"}
|
|
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,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,CAAC,EAAE;AAClD,MAAM,IAAI,EAAE,IAAI,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC;AACzC,MAAM,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAE;AAClE,MAAM,OAAO,EAAE;AACf,QAAQ,QAAQ,EAAE,kBAAkB;AACpC,QAAQ,kBAAkB,EAAE,gBAAgB;AAC5C,QAAQ,cAAc,EAAE,QAAQ,CAAC,aAAa,CAAC,uBAAuB,CAAC,EAAE,OAAO;AAChF,OAAO;AACP,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK;AAC1B,MAAM,IAAI,QAAQ,CAAC,EAAE,EAAE,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC9C,MAAM,OAAO,OAAO,CAAC,MAAM,CAAC,qB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CAAC,kBAAkB,EAAC;AACjF;AACA;AACA,EAAE,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,EAAE;AACrC,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC;AACjC,IAAI,MAAM,GAAG,QAAQ,CAAC;AACtB,GAAG;AACH;AACA,EAAE,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,SAAS,EAAE;AAC1D,IAAI,WAAW,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,kBAAkB,EAAC;AACrF,GAAG;AACH;AACA;AACA;AACA,EAAE,WAAW,IAAI,0BAAyB;AAC1C;AACA,EAAE,IAAI,MAAM,EAAE,EAAE,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,EAAE;AACtD;AACA,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,OAAM;AAC7B,EAAE,IAAI,CAAC,SAAS,GAAG,YAAW;AAC9B,EAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,EAAC;AACjC,EAAE,IAAI,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,KAAK,GAAE;AAC/C;AACA,EAAE,KAAK,CAAC,cAAc,GAAE;AACxB,CAAC,CAAC;AACF;AACA,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,MAAM;AACrB;;;;"}
|
|
@@ -1 +1 @@
|
|
|
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,EA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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;;;;;;;;"}
|
|
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,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,cAAc,EAAE,QAAQ,CAAC,aAAa,CAAC,uBAAuB,CAAC,EAAE,OAAO;EAChF,OAAO;EACP,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,KAAK;EAC1B,MAAM,IAAI,QA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
|
|
24
24
|
|
|
25
25
|
def render?
|
|
26
|
-
@field.render_field?
|
|
26
|
+
@field.render_field? && render_field_values.present?
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
# Override this method in a subclass to change the way this value is rendered
|
|
30
30
|
# @return [Array]
|
|
31
31
|
def render_field_values
|
|
32
|
-
@field.render
|
|
32
|
+
@render_field_values ||= @field.render
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
##
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Blacklight
|
|
4
|
+
# Adds Solr timing to the Rails request log line, mirroring how
|
|
5
|
+
# ActiveRecord::Railties::ControllerRuntime adds ActiveRecord timing, e.g.:
|
|
6
|
+
# Completed 200 OK in 62ms (Views: 12.0ms | ActiveRecord: 1.2ms | Solr: 45.3ms (2 queries))
|
|
7
|
+
module ControllerRuntime
|
|
8
|
+
extend ActiveSupport::Concern
|
|
9
|
+
|
|
10
|
+
protected
|
|
11
|
+
|
|
12
|
+
def process_action(action, *args)
|
|
13
|
+
Blacklight::RuntimeRegistry.stats.reset
|
|
14
|
+
super
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def append_info_to_payload(payload)
|
|
18
|
+
super
|
|
19
|
+
stats = Blacklight::RuntimeRegistry.stats
|
|
20
|
+
payload[:solr_runtime] = stats.solr_runtime
|
|
21
|
+
payload[:solr_query_count] = stats.solr_query_count
|
|
22
|
+
stats.reset
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
module ClassMethods
|
|
26
|
+
def log_process_action(payload)
|
|
27
|
+
messages = super
|
|
28
|
+
count = payload[:solr_query_count].to_i
|
|
29
|
+
return messages unless count.positive?
|
|
30
|
+
|
|
31
|
+
messages << solr_log_message(payload[:solr_runtime], count)
|
|
32
|
+
messages
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
private
|
|
36
|
+
|
|
37
|
+
def solr_log_message(runtime, count)
|
|
38
|
+
format("Solr: %.1fms (%d %s)", runtime.to_f, count, "query".pluralize(count))
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -10,9 +10,11 @@ module Blacklight
|
|
|
10
10
|
attr_writer :connection
|
|
11
11
|
|
|
12
12
|
# (Note: ActiveSupport::Benchmarkable requires a logger method)
|
|
13
|
+
# No longer used in core Blacklight, keeping for downstream consumers
|
|
13
14
|
# @return [Logger]
|
|
14
15
|
attr_writer :logger
|
|
15
16
|
|
|
17
|
+
# No longer used in core Blacklight, keeping for downstream consumers
|
|
16
18
|
include ActiveSupport::Benchmarkable
|
|
17
19
|
|
|
18
20
|
##
|
data/lib/blacklight/engine.rb
CHANGED
|
@@ -22,6 +22,15 @@ module Blacklight
|
|
|
22
22
|
Blacklight::Configuration.initialize_default_configuration
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
initializer "blacklight.runtime_registry" do
|
|
26
|
+
ActiveSupport::Notifications.monotonic_subscribe("solr_request.blacklight", Blacklight::RuntimeRegistry)
|
|
27
|
+
Blacklight::LogSubscriber.attach_to :blacklight
|
|
28
|
+
|
|
29
|
+
# ActionController::LogSubscriber#process_action calls ActionController::Base.log_process_action,
|
|
30
|
+
# so this has to live on ActionController::Base itself - a subclass's override is never consulted.
|
|
31
|
+
ActiveSupport.on_load(:action_controller) { include Blacklight::ControllerRuntime }
|
|
32
|
+
end
|
|
33
|
+
|
|
25
34
|
# This makes our rake tasks visible.
|
|
26
35
|
rake_tasks do
|
|
27
36
|
Dir.chdir(File.expand_path(File.join(File.dirname(__FILE__), '..'))) do
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Blacklight
|
|
4
|
+
# Debug-only logging for solr_request.blacklight notifications
|
|
5
|
+
# see Blacklight::ControllerRuntime for the :info-level per-request summary.
|
|
6
|
+
class LogSubscriber < ActiveSupport::LogSubscriber
|
|
7
|
+
# ActiveSupport::LogSubscriber#debug/#info call the instance method
|
|
8
|
+
# `logger`, which the base class hardcodes to `LogSubscriber.logger`
|
|
9
|
+
# (itself) rather than `self.class.logger`. If that's ever fixed
|
|
10
|
+
# upstream, a `self.logger` override here would be worth implementing.
|
|
11
|
+
delegate :logger, to: :Blacklight
|
|
12
|
+
|
|
13
|
+
def solr_request(event)
|
|
14
|
+
payload = event.payload
|
|
15
|
+
debug { "Solr fetch (#{event.duration.round(1)}ms): #{payload[:method]} #{payload[:path]} #{payload[:params].to_hash.inspect}" }
|
|
16
|
+
debug { "Solr response: #{payload[:response].inspect}" } if verbose_logging?
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
private
|
|
20
|
+
|
|
21
|
+
def verbose_logging?
|
|
22
|
+
defined?(::BLACKLIGHT_VERBOSE_LOGGING) && ::BLACKLIGHT_VERBOSE_LOGGING
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -3,5 +3,29 @@
|
|
|
3
3
|
module Blacklight
|
|
4
4
|
class RuntimeRegistry
|
|
5
5
|
thread_mattr_accessor :connection, :connection_config
|
|
6
|
+
|
|
7
|
+
# per-thread/fiber Solr timing, read by Blacklight::ControllerRuntime
|
|
8
|
+
class Stats
|
|
9
|
+
attr_accessor :solr_runtime, :solr_query_count
|
|
10
|
+
|
|
11
|
+
def initialize
|
|
12
|
+
@solr_runtime = 0.0
|
|
13
|
+
@solr_query_count = 0
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
public alias_method :reset, :initialize
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class << self
|
|
20
|
+
def stats
|
|
21
|
+
ActiveSupport::IsolatedExecutionState[:blacklight_solr_runtime] ||= Stats.new
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# @see ActiveSupport::Notifications.monotonic_subscribe
|
|
25
|
+
def call(_name, start, finish, _id, _payload)
|
|
26
|
+
stats.solr_runtime += (finish - start) * 1000.0
|
|
27
|
+
stats.solr_query_count += 1
|
|
28
|
+
end
|
|
29
|
+
end
|
|
6
30
|
end
|
|
7
31
|
end
|
|
@@ -230,7 +230,8 @@ module Blacklight
|
|
|
230
230
|
return if value.nil?
|
|
231
231
|
|
|
232
232
|
params_will_change!
|
|
233
|
-
|
|
233
|
+
new_rows = value.to_i.then { |parsed| parsed.positive? ? parsed : blacklight_config.default_per_page }
|
|
234
|
+
@rows = [new_rows, blacklight_config.max_per_page.to_i].min
|
|
234
235
|
end
|
|
235
236
|
|
|
236
237
|
# @param [#to_i] value
|
|
@@ -38,8 +38,10 @@ module Blacklight::Solr
|
|
|
38
38
|
# @param [Hash] request_params
|
|
39
39
|
# @return [Blacklight::Suggest::Response]
|
|
40
40
|
def suggestions(request_params)
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
instrument_solr_request(suggest_handler_path, request_params) do
|
|
42
|
+
suggest_results = connection.send_and_receive(suggest_handler_path, params: request_params)
|
|
43
|
+
Blacklight::Suggest::Response.new suggest_results, request_params, suggest_handler_path, suggester_name
|
|
44
|
+
end
|
|
43
45
|
end
|
|
44
46
|
|
|
45
47
|
##
|
|
@@ -53,7 +55,7 @@ module Blacklight::Solr
|
|
|
53
55
|
##
|
|
54
56
|
# @return [boolean] true if the repository is reachable
|
|
55
57
|
def ping?
|
|
56
|
-
response = connection.send_and_receive
|
|
58
|
+
response = instrument_solr_request('admin/ping', {}) { connection.send_and_receive('admin/ping', {}) }
|
|
57
59
|
Blacklight.logger&.info("Ping [#{connection.uri}] returned: '#{response['status']}'")
|
|
58
60
|
response['status'] == "OK"
|
|
59
61
|
end
|
|
@@ -69,13 +71,10 @@ module Blacklight::Solr
|
|
|
69
71
|
# @param [Hash, Blacklight::SearchBuilder] solr_params parameters for RSolr::Client#send_and_receive
|
|
70
72
|
# @return [Blacklight::Solr::Response] the solr response object
|
|
71
73
|
def send_and_receive(path, solr_params = {})
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
Blacklight.logger&.debug("Solr query: #{blacklight_config.http_method} #{path} #{solr_params.to_hash.inspect}")
|
|
77
|
-
Blacklight.logger&.debug("Solr response: #{solr_response.inspect}") if defined?(::BLACKLIGHT_VERBOSE_LOGGING) && ::BLACKLIGHT_VERBOSE_LOGGING
|
|
78
|
-
solr_response
|
|
74
|
+
request = build_solr_request(solr_params)
|
|
75
|
+
instrument_solr_request(path, solr_params, method: request[:method]) do
|
|
76
|
+
res = connection.send_and_receive(path, request)
|
|
77
|
+
blacklight_config.response_model.new(res, solr_params, document_model: blacklight_config.document_model, blacklight_config: blacklight_config)
|
|
79
78
|
end
|
|
80
79
|
rescue *defined_rsolr_timeout_exceptions => e
|
|
81
80
|
raise Blacklight::Exceptions::RepositoryTimeout, "Timeout connecting to Solr instance using #{connection.inspect}: #{e.inspect}"
|
|
@@ -106,6 +105,12 @@ module Blacklight::Solr
|
|
|
106
105
|
|
|
107
106
|
private
|
|
108
107
|
|
|
108
|
+
def instrument_solr_request(path, params, method: :get)
|
|
109
|
+
ActiveSupport::Notifications.instrument("solr_request.blacklight", path: path, params: params, method: method) do |payload|
|
|
110
|
+
payload[:response] = yield
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
109
114
|
##
|
|
110
115
|
# @return [String]
|
|
111
116
|
def suggest_handler_path
|
|
@@ -41,6 +41,11 @@ module Blacklight
|
|
|
41
41
|
generate "blacklight:assets", generated_options unless options[:'skip-assets']
|
|
42
42
|
end
|
|
43
43
|
|
|
44
|
+
def pin_json_version
|
|
45
|
+
# json 3.0's JSON.parse rejects ActiveSupport::JSON.decode's positional options hash; unfixed as of Rails 8.1.3.
|
|
46
|
+
gem 'json', '< 3.0'
|
|
47
|
+
end
|
|
48
|
+
|
|
44
49
|
def bundle_install
|
|
45
50
|
inside destination_root do
|
|
46
51
|
Bundler.with_unbundled_env do
|
data/package.json
CHANGED
|
@@ -33,6 +33,21 @@ RSpec.describe Blacklight::MetadataFieldComponent, type: :component do
|
|
|
33
33
|
end
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
+
context 'when the configured helper method returns nil' do
|
|
37
|
+
let(:field_config) { Blacklight::Configuration::Field.new(key: 'field', field: 'field', label: 'Field label', helper_method: :field_helper) }
|
|
38
|
+
|
|
39
|
+
before do
|
|
40
|
+
allow(view_context).to receive(:field_helper).and_return(nil)
|
|
41
|
+
|
|
42
|
+
render_inline(described_class.new(field: field))
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it 'does not render the field label without any values' do
|
|
46
|
+
expect(page).to have_no_css 'dt'
|
|
47
|
+
expect(page).to have_no_css 'dd'
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
36
51
|
context 'from a show view' do
|
|
37
52
|
before do
|
|
38
53
|
allow(field).to receive(:label).with('show').and_return('custom label')
|
|
@@ -7,6 +7,29 @@
|
|
|
7
7
|
BLACKLIGHT_MANAGES_GUESTS = !defined?(DeviseGuests)
|
|
8
8
|
|
|
9
9
|
RSpec.describe ApplicationController do
|
|
10
|
+
describe ".log_process_action" do
|
|
11
|
+
it "appends Solr runtime to the messages ActiveRecord/ActionController already log" do
|
|
12
|
+
messages = described_class.log_process_action(solr_runtime: 45.3, solr_query_count: 2)
|
|
13
|
+
expect(messages).to include("Solr: 45.3ms (2 queries)")
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "uses singular 'query' for a single Solr request" do
|
|
17
|
+
messages = described_class.log_process_action(solr_runtime: 12.0, solr_query_count: 1)
|
|
18
|
+
expect(messages).to include("Solr: 12.0ms (1 query)")
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it "does not add a message when no Solr request was made" do
|
|
22
|
+
messages = described_class.log_process_action({})
|
|
23
|
+
expect(messages.grep(/Solr/)).to be_empty
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it "does not add a message when the payload reports zero Solr queries" do
|
|
27
|
+
# Stats#solr_runtime defaults to 0.0 (truthy, never nil) - query count is the real "did Solr get queried" signal.
|
|
28
|
+
messages = described_class.log_process_action(solr_runtime: 0.0, solr_query_count: 0)
|
|
29
|
+
expect(messages.grep(/Solr/)).to be_empty
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
10
33
|
describe "#blacklight_config" do
|
|
11
34
|
it "provides a default blacklight_config everywhere" do
|
|
12
35
|
expect(controller.blacklight_config).to eq CatalogController.blacklight_config
|
data/spec/features/axe_spec.rb
CHANGED
|
@@ -11,6 +11,8 @@ RSpec.describe 'Accessibility testing', :js, api: false do
|
|
|
11
11
|
|
|
12
12
|
it 'validates the home page' do
|
|
13
13
|
visit root_path
|
|
14
|
+
wait_for_turbo
|
|
15
|
+
|
|
14
16
|
expect(page).to be_axe_clean
|
|
15
17
|
end
|
|
16
18
|
|
|
@@ -33,11 +35,15 @@ RSpec.describe 'Accessibility testing', :js, api: false do
|
|
|
33
35
|
|
|
34
36
|
it 'validates the advanced search form' do
|
|
35
37
|
visit advanced_search_catalog_path
|
|
38
|
+
wait_for_turbo
|
|
39
|
+
|
|
36
40
|
expect(page).to be_axe_clean
|
|
37
41
|
end
|
|
38
42
|
|
|
39
43
|
it 'validates the single results page' do
|
|
40
44
|
visit solr_document_path('2007020969')
|
|
45
|
+
wait_for_turbo
|
|
46
|
+
|
|
41
47
|
expect(page).to be_axe_clean
|
|
42
48
|
end
|
|
43
49
|
end
|
|
@@ -93,4 +93,18 @@ RSpec.describe "Search Pagination" do
|
|
|
93
93
|
expect(page).to have_text "1 - 20 of "
|
|
94
94
|
end
|
|
95
95
|
end
|
|
96
|
+
|
|
97
|
+
it 'falls back to the default in the case of negative rows param' do
|
|
98
|
+
visit '/catalog?search_field=all_fields&q=&rows=-20'
|
|
99
|
+
within("#sortAndPerPage") do
|
|
100
|
+
expect(page).to have_text "1 - 10 of "
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
it 'falls back to the default in the case of negative per_page param' do
|
|
105
|
+
visit '/catalog?search_field=all_fields&q=&per_page=-20'
|
|
106
|
+
within("#sortAndPerPage") do
|
|
107
|
+
expect(page).to have_text "1 - 10 of "
|
|
108
|
+
end
|
|
109
|
+
end
|
|
96
110
|
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
RSpec.describe Blacklight::RuntimeRegistry do
|
|
4
|
+
before { described_class.stats.reset }
|
|
5
|
+
|
|
6
|
+
describe ".call" do
|
|
7
|
+
it "accumulates the event's duration into stats.solr_runtime" do
|
|
8
|
+
described_class.call("solr_request.blacklight", 0.0, 0.0125, nil, {})
|
|
9
|
+
|
|
10
|
+
expect(described_class.stats.solr_runtime).to eq 12.5
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
it "increments stats.solr_query_count" do
|
|
14
|
+
described_class.call("solr_request.blacklight", 0.0, 0.0125, nil, {})
|
|
15
|
+
described_class.call("solr_request.blacklight", 0.0, 0.0125, nil, {})
|
|
16
|
+
|
|
17
|
+
expect(described_class.stats.solr_query_count).to eq 2
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
describe ".stats" do
|
|
22
|
+
it "is thread-local" do
|
|
23
|
+
described_class.call("solr_request.blacklight", 0.0, 0.0125, nil, {})
|
|
24
|
+
|
|
25
|
+
Thread.new { expect(described_class.stats.solr_runtime).to eq 0.0 }.join
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe "Stats#reset" do
|
|
30
|
+
it "clears the accumulated runtime and query count" do
|
|
31
|
+
stats = described_class.stats
|
|
32
|
+
described_class.call("solr_request.blacklight", 0.0, 0.0125, nil, {})
|
|
33
|
+
|
|
34
|
+
stats.reset
|
|
35
|
+
|
|
36
|
+
expect(stats.solr_runtime).to eq 0.0
|
|
37
|
+
expect(stats.solr_query_count).to eq 0
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
describe "subscribed to solr_request.blacklight notifications" do
|
|
42
|
+
it "fires without raising (Blacklight::Engine subscribes this at boot)" do
|
|
43
|
+
expect { ActiveSupport::Notifications.instrument("solr_request.blacklight") }.not_to raise_error
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -143,6 +143,31 @@ RSpec.describe Blacklight::Solr::Repository, :api do
|
|
|
143
143
|
allow(repository.connection).to receive(:send_and_receive).and_raise(rsolr_timeout)
|
|
144
144
|
expect { subject.search(params: {}) }.to raise_exception(Blacklight::Exceptions::RepositoryTimeout, /Timeout connecting to Solr instance/)
|
|
145
145
|
end
|
|
146
|
+
|
|
147
|
+
it "instruments the request with ActiveSupport::Notifications" do
|
|
148
|
+
allow(subject.connection).to receive(:send_and_receive).and_return(mock_response)
|
|
149
|
+
|
|
150
|
+
payload = nil
|
|
151
|
+
callback = ->(event) { payload = event.payload }
|
|
152
|
+
ActiveSupport::Notifications.subscribed(callback, "solr_request.blacklight") do
|
|
153
|
+
subject.search(params: {})
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
expect(payload).to include(path: 'select', method: :get)
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
it "instruments a json query dsl request as post, regardless of http_method configuration" do
|
|
160
|
+
blacklight_config.http_method = :get
|
|
161
|
+
allow(subject.connection).to receive(:send_and_receive).and_return(mock_response)
|
|
162
|
+
|
|
163
|
+
payload = nil
|
|
164
|
+
callback = ->(event) { payload = event.payload }
|
|
165
|
+
ActiveSupport::Notifications.subscribed(callback, "solr_request.blacklight") do
|
|
166
|
+
subject.search(params: { json: { query: 'foo' } })
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
expect(payload).to include(method: :post)
|
|
170
|
+
end
|
|
146
171
|
end
|
|
147
172
|
|
|
148
173
|
describe "#build_solr_request" do
|
|
@@ -230,5 +255,49 @@ RSpec.describe Blacklight::Solr::Repository, :api do
|
|
|
230
255
|
subject { repository.ping }
|
|
231
256
|
|
|
232
257
|
it { is_expected.to be true }
|
|
258
|
+
|
|
259
|
+
it "instruments the request with ActiveSupport::Notifications" do
|
|
260
|
+
payload = nil
|
|
261
|
+
callback = ->(event) { payload = event.payload }
|
|
262
|
+
ActiveSupport::Notifications.subscribed(callback, "solr_request.blacklight") do
|
|
263
|
+
repository.ping
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
expect(payload).to include(path: 'admin/ping', method: :get)
|
|
267
|
+
end
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
describe "debug logging" do
|
|
271
|
+
let(:io) { StringIO.new }
|
|
272
|
+
let(:test_logger) { Logger.new(io, level: Logger::DEBUG) }
|
|
273
|
+
|
|
274
|
+
before do
|
|
275
|
+
allow(Blacklight).to receive(:logger).and_return(test_logger)
|
|
276
|
+
allow(subject.connection).to receive(:send_and_receive).and_return(mock_response)
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
it "logs the solr query at debug, never at info" do
|
|
280
|
+
subject.search(params: { q: 'test' })
|
|
281
|
+
|
|
282
|
+
expect(io.string).to include("test")
|
|
283
|
+
expect(io.string).not_to include("INFO")
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
it "does not log the full response by default" do
|
|
287
|
+
subject.search(params: { q: 'test' })
|
|
288
|
+
|
|
289
|
+
expect(io.string).not_to include("Solr response")
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
context "when BLACKLIGHT_VERBOSE_LOGGING is set" do
|
|
293
|
+
before { stub_const('BLACKLIGHT_VERBOSE_LOGGING', true) }
|
|
294
|
+
|
|
295
|
+
it "logs the full response at debug, never at info" do
|
|
296
|
+
subject.search(params: { q: 'test' })
|
|
297
|
+
|
|
298
|
+
expect(io.string).to include("Solr response")
|
|
299
|
+
expect(io.string).not_to include("INFO")
|
|
300
|
+
end
|
|
301
|
+
end
|
|
233
302
|
end
|
|
234
303
|
end
|
|
@@ -7,6 +7,7 @@ module Features
|
|
|
7
7
|
# clicks return before the visit completes, so wait for the busy state to clear
|
|
8
8
|
# before making assertions that don't wait on their own (e.g. be_axe_clean).
|
|
9
9
|
def wait_for_turbo
|
|
10
|
+
page.has_css?('html[aria-busy]', visible: :all, wait: 0.5)
|
|
10
11
|
expect(page).to have_no_css('html[aria-busy]', visible: :all)
|
|
11
12
|
end
|
|
12
13
|
end
|
|
@@ -3,3 +3,6 @@ gem 'rails-controller-testing'
|
|
|
3
3
|
unless ENV['VIEW_COMPONENT_VERSION'].to_s == ""
|
|
4
4
|
gem 'view_component', ENV.fetch('VIEW_COMPONENT_VERSION')
|
|
5
5
|
end
|
|
6
|
+
|
|
7
|
+
# json 3.0's JSON.parse rejects ActiveSupport::JSON.decode's positional options hash; unfixed as of Rails 8.1.3.
|
|
8
|
+
gem 'json', '< 3.0'
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: blacklight
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 9.
|
|
4
|
+
version: 9.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jonathan Rochkind
|
|
@@ -16,7 +16,7 @@ authors:
|
|
|
16
16
|
- Justin Coyne
|
|
17
17
|
bindir: exe
|
|
18
18
|
cert_chain: []
|
|
19
|
-
date:
|
|
19
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
20
20
|
dependencies:
|
|
21
21
|
- !ruby/object:Gem::Dependency
|
|
22
22
|
name: rails
|
|
@@ -588,6 +588,7 @@ files:
|
|
|
588
588
|
- app/controllers/concerns/blacklight/bookmarks.rb
|
|
589
589
|
- app/controllers/concerns/blacklight/catalog.rb
|
|
590
590
|
- app/controllers/concerns/blacklight/controller.rb
|
|
591
|
+
- app/controllers/concerns/blacklight/controller_runtime.rb
|
|
591
592
|
- app/controllers/concerns/blacklight/guest_user.rb
|
|
592
593
|
- app/controllers/concerns/blacklight/search_context.rb
|
|
593
594
|
- app/controllers/concerns/blacklight/search_history.rb
|
|
@@ -779,6 +780,7 @@ files:
|
|
|
779
780
|
- lib/blacklight/configuration/view_config.rb
|
|
780
781
|
- lib/blacklight/engine.rb
|
|
781
782
|
- lib/blacklight/exceptions.rb
|
|
783
|
+
- lib/blacklight/log_subscriber.rb
|
|
782
784
|
- lib/blacklight/nested_open_struct_with_hash_access.rb
|
|
783
785
|
- lib/blacklight/open_struct_with_hash_access.rb
|
|
784
786
|
- lib/blacklight/parameters.rb
|
|
@@ -931,6 +933,7 @@ files:
|
|
|
931
933
|
- spec/lib/blacklight/nested_open_struct_with_hash_access_spec.rb
|
|
932
934
|
- spec/lib/blacklight/open_struct_with_hash_access_spec.rb
|
|
933
935
|
- spec/lib/blacklight/parameters_spec.rb
|
|
936
|
+
- spec/lib/blacklight/runtime_registry_spec.rb
|
|
934
937
|
- spec/lib/blacklight/search_state/filter_field_spec.rb
|
|
935
938
|
- spec/lib/blacklight/search_state/pivot_filter_field_spec.rb
|
|
936
939
|
- spec/lib/blacklight/search_state_spec.rb
|
|
@@ -1030,7 +1033,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1030
1033
|
- !ruby/object:Gem::Version
|
|
1031
1034
|
version: '0'
|
|
1032
1035
|
requirements: []
|
|
1033
|
-
rubygems_version:
|
|
1036
|
+
rubygems_version: 4.0.15
|
|
1034
1037
|
specification_version: 4
|
|
1035
1038
|
summary: Blacklight provides a discovery interface for any Solr (http://lucene.apache.org/solr)
|
|
1036
1039
|
index.
|
|
@@ -1117,6 +1120,7 @@ test_files:
|
|
|
1117
1120
|
- spec/lib/blacklight/nested_open_struct_with_hash_access_spec.rb
|
|
1118
1121
|
- spec/lib/blacklight/open_struct_with_hash_access_spec.rb
|
|
1119
1122
|
- spec/lib/blacklight/parameters_spec.rb
|
|
1123
|
+
- spec/lib/blacklight/runtime_registry_spec.rb
|
|
1120
1124
|
- spec/lib/blacklight/search_state/filter_field_spec.rb
|
|
1121
1125
|
- spec/lib/blacklight/search_state/pivot_filter_field_spec.rb
|
|
1122
1126
|
- spec/lib/blacklight/search_state_spec.rb
|